mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 16:11:57 +00:00
This adds support for the OpenCodeGraph prototype. Feature-flagged off by default behind the `opencodegraph` feature flag. See https://www.loom.com/share/5549d92a7c244863ac86ce56692ca030 for more information. Also, for our CodeMirror, remove `background:transparent` so that line bg applies to block widgets
83 lines
2.5 KiB
JSON
83 lines
2.5 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"$id": "opencodegraph.schema.json#",
|
|
"title": "OpenCodeGraphData",
|
|
"description": "Metadata about code",
|
|
"allowComments": true,
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["items", "annotations"],
|
|
"properties": {
|
|
"items": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/definitions/OpenCodeGraphItem" }
|
|
},
|
|
"annotations": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/definitions/OpenCodeGraphAnnotation" }
|
|
}
|
|
},
|
|
"definitions": {
|
|
"OpenCodeGraphItem": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["id", "title"],
|
|
"properties": {
|
|
"id": { "type": "string" },
|
|
"title": { "type": "string" },
|
|
"detail": { "type": "string" },
|
|
"url": { "description": "An external URL with more information.", "type": "string", "format": "uri" },
|
|
"preview": { "description": "Show a preview of the link.", "type": "boolean" },
|
|
"previewUrl": {
|
|
"description": "If `preview` is set, show this URL as the preview instead of `url`.",
|
|
"type": "string"
|
|
},
|
|
"image": { "$ref": "#/definitions/OpenCodeGraphImage" }
|
|
}
|
|
},
|
|
"OpenCodeGraphImage": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["url"],
|
|
"properties": {
|
|
"url": { "type": "string", "format": "uri" },
|
|
"width": { "type": "number" },
|
|
"height": { "type": "number" },
|
|
"alt": { "type": "string" }
|
|
}
|
|
},
|
|
"OpenCodeGraphAnnotation": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["range", "item"],
|
|
"properties": {
|
|
"range": { "$ref": "#/definitions/OpenCodeGraphRange" },
|
|
"item": {
|
|
"title": "OpenCodeGraphItemRef",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["id"],
|
|
"properties": {
|
|
"id": { "type": "string" }
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"OpenCodeGraphRange": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["start", "end"],
|
|
"properties": {
|
|
"start": { "$ref": "#/definitions/OpenCodeGraphPosition" },
|
|
"end": { "$ref": "#/definitions/OpenCodeGraphPosition" }
|
|
}
|
|
},
|
|
"OpenCodeGraphPosition": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["line", "character"],
|
|
"properties": { "line": { "type": "integer" }, "character": { "type": "integer" } }
|
|
}
|
|
}
|
|
}
|