From 402df1a50d04a4e91b02855979a9f239c9884a8a Mon Sep 17 00:00:00 2001 From: Max Kasperowski Date: Thu, 10 Oct 2024 11:36:24 +0200 Subject: [PATCH] additional actions and messages --- schema/klighd/SKGraphSchema.json | 24 +++ schema/klighd/ValuedSynthesisOption.json | 141 +++++++++++++++++ schema/klighd/actions/checkImages.json | 34 +++++ schema/klighd/actions/checkedImages.json | 37 +++++ schema/klighd/actions/performAction.json | 26 ++++ schema/klighd/actions/refreshDiagram.json | 14 ++ schema/klighd/actions/refreshLayout.json | 14 ++ .../klighd/actions/requestDiagramPiece.json | 17 +++ schema/klighd/actions/setDiagramPiece.json | 17 +++ schema/klighd/actions/setSynthesis.json | 17 +++ schema/klighd/actions/storeImages.json | 27 ++++ schema/klighd/actions/updateOptions.json | 142 +----------------- .../messages/diagramOptionsPerformAction.json | 25 +++ .../diagramOptionsSetLayoutOptions.json | 35 +++++ .../diagramOptionsSetSynthesisOptions.json | 28 ++++ ...es.json => preferencesSetPreferences.json} | 2 +- schema/lsp/generalSendMessage.json | 19 +++ schema/lsp/range.json | 29 ++++ schema/lsp/requestMessage.json | 2 +- schema/lsp/textDocumentDocumentHighlight.json | 29 ++++ schema/sprotty/actions/action.json | 3 + schema/sprotty/actions/allSelected.json | 17 +++ schema/sprotty/actions/elementSelected.json | 29 ++++ schema/sprotty/actions/fit.json | 26 ++++ schema/sprotty/actions/setModel.json | 17 +++ schema/sprotty/actions/updateModel.json | 17 +++ schema/sprotty/diagramOpenInTextEditor.json | 39 +++++ 27 files changed, 685 insertions(+), 142 deletions(-) create mode 100644 schema/klighd/ValuedSynthesisOption.json create mode 100644 schema/klighd/actions/checkImages.json create mode 100644 schema/klighd/actions/checkedImages.json create mode 100644 schema/klighd/actions/performAction.json create mode 100644 schema/klighd/actions/refreshDiagram.json create mode 100644 schema/klighd/actions/refreshLayout.json create mode 100644 schema/klighd/actions/requestDiagramPiece.json create mode 100644 schema/klighd/actions/setDiagramPiece.json create mode 100644 schema/klighd/actions/setSynthesis.json create mode 100644 schema/klighd/actions/storeImages.json create mode 100644 schema/klighd/messages/diagramOptionsPerformAction.json create mode 100644 schema/klighd/messages/diagramOptionsSetLayoutOptions.json create mode 100644 schema/klighd/messages/diagramOptionsSetSynthesisOptions.json rename schema/klighd/messages/{setPreferences.json => preferencesSetPreferences.json} (94%) create mode 100644 schema/lsp/generalSendMessage.json create mode 100644 schema/lsp/range.json create mode 100644 schema/lsp/textDocumentDocumentHighlight.json create mode 100644 schema/sprotty/actions/allSelected.json create mode 100644 schema/sprotty/actions/elementSelected.json create mode 100644 schema/sprotty/actions/fit.json create mode 100644 schema/sprotty/actions/setModel.json create mode 100644 schema/sprotty/actions/updateModel.json create mode 100644 schema/sprotty/diagramOpenInTextEditor.json diff --git a/schema/klighd/SKGraphSchema.json b/schema/klighd/SKGraphSchema.json index 8e38b258..fb86effc 100644 --- a/schema/klighd/SKGraphSchema.json +++ b/schema/klighd/SKGraphSchema.json @@ -62,6 +62,18 @@ } }, "default": { "width": 0.0, "height": 0.0 } + }, + "position": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "default": { "x": 0.0, "y": 0.0 } } } @@ -76,6 +88,18 @@ }, "revision": { "type": "number" + }, + "children": { + "type": "array", + "required": ["items"], + "items": [ + { + "$ref": "#/definitions/SModelElement" + } + ], + "default": [], + "minItems": 1, + "maxItems": 1 } } }, diff --git a/schema/klighd/ValuedSynthesisOption.json b/schema/klighd/ValuedSynthesisOption.json new file mode 100644 index 00000000..b5705837 --- /dev/null +++ b/schema/klighd/ValuedSynthesisOption.json @@ -0,0 +1,141 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/ValuedSynthesisOption.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ValuedSynthesisOption", + "type": "object", + "required": ["synthesisOption", "currentValue"], + "properties": { + "synthesisOption": { + "anyOf": [ + {"$ref": "#/definitions/checkSynthesisOption"}, + {"$ref": "#/definitions/choiceSynthesisOption"}, + {"$ref": "#/definitions/rangeSynthesisOption"}, + {"$ref": "#/definitions/textSynthesisOption"}, + {"$ref": "#/definitions/separatorSynthesisOption"}, + {"$ref": "#/definitions/categorySynthesisOption"} + ] + }, + "currentValue": { + "type": ["string", "number", "boolean"] + } + }, + "definitions": { + "SynthesisOption": { + "type": "object", + "required": ["id", "name", "type", "sourceHash", "initialValue"], + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "number", + "enum": [0, 1, 2, 3, 4, 5] + }, + "updateAction": { + "type": "string" + }, + "category": { + "$ref": "#/definitions/categorySynthesisOption" + }, + "sourceHash": { + "type": "string" + }, + "initialValue": {} + } + }, + "checkSynthesisOption": { + "allOf": [{"$ref": "#/definitions/SynthesisOption"}], + "properties": { + "type": { + "type": "number", + "enum": [0] + }, + "initialValue": { + "type": "boolean" + } + } + }, + "choiceSynthesisOption": { + "allOf": [{"$ref": "#/definitions/SynthesisOption"}], + "required": ["values"], + "properties": { + "type": { + "type": "number", + "enum": [1] + }, + "initialValue": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "rangeSynthesisOption": { + "allOf": [{"$ref": "#/definitions/SynthesisOption"}], + "required": ["range", "stepSize"], + "properties": { + "type": { + "type": "number", + "enum": [2] + }, + "initialValue": { + "type": "number" + }, + "range": { + "type": "object", + "properties": { + "first": { + "type": "number" + }, + "second": { + "type": "number" + } + } + }, + "stepSize": { + "type": "number" + } + } + }, + "textSynthesisOption": { + "allOf": [{"$ref": "#/definitions/SynthesisOption"}], + "properties": { + "type": { + "type": "number", + "enum": [3] + }, + "initialValue": { + "type": "string" + } + } + }, + "separatorSynthesisOption": { + "allOf": [{"$ref": "#/definitions/SynthesisOption"}], + "properties": { + "type": { + "type": "number", + "enum": [4] + } + } + }, + "categorySynthesisOption": { + "allOf": [{"$ref": "#/definitions/SynthesisOption"}], + "properties": { + "type": { + "type": "number", + "enum": [5] + }, + "initialValue": { + "type": "boolean" + } + } + } + } +} \ No newline at end of file diff --git a/schema/klighd/actions/checkImages.json b/schema/klighd/actions/checkImages.json new file mode 100644 index 00000000..c5c7006a --- /dev/null +++ b/schema/klighd/actions/checkImages.json @@ -0,0 +1,34 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/actions/checkImages.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "checkImages", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/action.json"}], + "required": ["kind", "images"], + "properties": { + "kind": { + "type": "string", + "enum": ["checkImages"] + }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/image" + } + } + }, + "definitions": { + "image": { + "type": "object", + "required": ["bundleName", "imagePath"], + "properties": { + "bundleName": { + "type": "string" + }, + "imagePath": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schema/klighd/actions/checkedImages.json b/schema/klighd/actions/checkedImages.json new file mode 100644 index 00000000..6e5445cc --- /dev/null +++ b/schema/klighd/actions/checkedImages.json @@ -0,0 +1,37 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/actions/checkedImages.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "checkedImages", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/action.json"}], + "required": ["kind", "notCached", "responseId"], + "properties": { + "kind": { + "type": "string", + "enum": ["checkedImages"] + }, + "notCached": { + "type": "array", + "items": { + "$ref": "#/definitions/notCachedImage" + } + }, + "responseId": { + "type": "string" + } + }, + "definitions": { + "notCachedImage": { + "type": "object", + "required": ["k", "v"], + "properties": { + "k": { + "type": "string" + }, + "v": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schema/klighd/actions/performAction.json b/schema/klighd/actions/performAction.json new file mode 100644 index 00000000..0dfe923d --- /dev/null +++ b/schema/klighd/actions/performAction.json @@ -0,0 +1,26 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/actions/performAction.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "performAction", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/actions/action.json"}], + "required": ["kind", "actionId", "kGraphElementId", "kRenderingId", "revision"], + "properties": { + "kind": { + "type": "string", + "enum": ["performAction"] + }, + "actionId": { + "type": "string" + }, + "kGraphElementId": { + "type": "string" + }, + "kRenderingId": { + "type": "string" + }, + "revision": { + "type": "number" + } + } +} \ No newline at end of file diff --git a/schema/klighd/actions/refreshDiagram.json b/schema/klighd/actions/refreshDiagram.json new file mode 100644 index 00000000..56fc6379 --- /dev/null +++ b/schema/klighd/actions/refreshDiagram.json @@ -0,0 +1,14 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/actions/refreshDiagram.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "refreshDiagram", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/action.json"}], + "required": ["kind"], + "properties": { + "kind": { + "type": "string", + "enum": ["refreshDiagram"] + } + } +} \ No newline at end of file diff --git a/schema/klighd/actions/refreshLayout.json b/schema/klighd/actions/refreshLayout.json new file mode 100644 index 00000000..0f322b89 --- /dev/null +++ b/schema/klighd/actions/refreshLayout.json @@ -0,0 +1,14 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/actions/refreshLayout.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "refreshLayout", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/action.json"}], + "required": ["kind"], + "properties": { + "kind": { + "type": "string", + "enum": ["refreshLayout"] + } + } +} \ No newline at end of file diff --git a/schema/klighd/actions/requestDiagramPiece.json b/schema/klighd/actions/requestDiagramPiece.json new file mode 100644 index 00000000..9d92c8eb --- /dev/null +++ b/schema/klighd/actions/requestDiagramPiece.json @@ -0,0 +1,17 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/actions/requestDiagramPiece.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "requestDiagramPiece", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/action.json"}], + "required": ["kind", "modelElementId"], + "properties": { + "kind": { + "type": "string", + "enum": ["requestDiagramPiece"] + }, + "modelElementId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schema/klighd/actions/setDiagramPiece.json b/schema/klighd/actions/setDiagramPiece.json new file mode 100644 index 00000000..b538bb30 --- /dev/null +++ b/schema/klighd/actions/setDiagramPiece.json @@ -0,0 +1,17 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/actions/setDiagramPiece.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "setDiagramPiece", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/action.json"}], + "required": ["kind", "diagramPiece"], + "properties": { + "kind": { + "type": "string", + "enum": ["setDiagramPiece"] + }, + "diagramPiece": { + "$ref": "/kieler/klighd-vscode/tree/main/schema/klighd/SKGraphSchema.json#/definitions/SKNode" + } + } +} \ No newline at end of file diff --git a/schema/klighd/actions/setSynthesis.json b/schema/klighd/actions/setSynthesis.json new file mode 100644 index 00000000..1cdc4d50 --- /dev/null +++ b/schema/klighd/actions/setSynthesis.json @@ -0,0 +1,17 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/actions/setSynthesis.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "setSynthesis", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/action.json"}], + "required": ["kind", "id"], + "properties": { + "kind": { + "type": "string", + "enum": ["setSynthesis"] + }, + "id": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schema/klighd/actions/storeImages.json b/schema/klighd/actions/storeImages.json new file mode 100644 index 00000000..c58f4c66 --- /dev/null +++ b/schema/klighd/actions/storeImages.json @@ -0,0 +1,27 @@ + +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/actions/storeImages.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "storeImages", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/action.json"}], + "required": ["kind", "images"], + "properties": { + "kind": { + "type": "string", + "enum": ["storeImages"] + }, + "images": { + "type": "object", + "required": ["k", "v"], + "properties": { + "k": { + "$ref": "/kieler/klighd-vscode/tree/main/schema/klighd/actions/checkedImages.json#/definitions/notCachedImage" + }, + "v": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schema/klighd/actions/updateOptions.json b/schema/klighd/actions/updateOptions.json index b570d319..8084bf9a 100644 --- a/schema/klighd/actions/updateOptions.json +++ b/schema/klighd/actions/updateOptions.json @@ -13,7 +13,7 @@ "valuedSynthesisOptions": { "type": "array", "items": { - "$ref": "#/definitions/ValuedSynthesisOption" + "$ref": "/kieler/klighd-vscode/tree/main/schema/klighd/valuedSynthesisOption.json" } }, "layoutOptions": { @@ -25,143 +25,5 @@ "modelUri": { "type": "string" } - }, - "definitions": { - "ValuedSynthesisOption": { - "type": "object", - "required": ["synthesisOption", "currentValue"], - "properties": { - "synthesisOption": { - "anyOf": [ - {"$ref": "#/definitions/checkSynthesisOption"}, - {"$ref": "#/definitions/choiceSynthesisOption"}, - {"$ref": "#/definitions/rangeSynthesisOption"}, - {"$ref": "#/definitions/textSynthesisOption"}, - {"$ref": "#/definitions/separatorSynthesisOption"}, - {"$ref": "#/definitions/categorySynthesisOption"} - ] - }, - "currentValue": { - "type": ["string", "number", "boolean"] - } - } - }, - "SynthesisOption": { - "type": "object", - "required": ["id", "name", "type", "sourceHash", "initialValue"], - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "type": "number", - "enum": [0, 1, 2, 3, 4, 5] - }, - "updateAction": { - "type": "string" - }, - "category": { - "$ref": "#/definitions/categorySynthesisOption" - }, - "sourceHash": { - "type": "string" - }, - "initialValue": {} - } - }, - "checkSynthesisOption": { - "allOf": [{"$ref": "#/definitions/SynthesisOption"}], - "properties": { - "type": { - "type": "number", - "enum": [0] - }, - "initialValue": { - "type": "boolean" - } - } - }, - "choiceSynthesisOption": { - "allOf": [{"$ref": "#/definitions/SynthesisOption"}], - "required": ["values"], - "properties": { - "type": { - "type": "number", - "enum": [1] - }, - "initialValue": { - "type": "string" - }, - "values": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "rangeSynthesisOption": { - "allOf": [{"$ref": "#/definitions/SynthesisOption"}], - "required": ["range", "stepSize"], - "properties": { - "type": { - "type": "number", - "enum": [2] - }, - "initialValue": { - "type": "number" - }, - "range": { - "type": "object", - "properties": { - "first": { - "type": "number" - }, - "second": { - "type": "number" - } - } - }, - "stepSize": { - "type": "number" - } - } - }, - "textSynthesisOption": { - "allOf": [{"$ref": "#/definitions/SynthesisOption"}], - "properties": { - "type": { - "type": "number", - "enum": [3] - }, - "initialValue": { - "type": "string" - } - } - }, - "separatorSynthesisOption": { - "allOf": [{"$ref": "#/definitions/SynthesisOption"}], - "properties": { - "type": { - "type": "number", - "enum": [4] - } - } - }, - "categorySynthesisOption": { - "allOf": [{"$ref": "#/definitions/SynthesisOption"}], - "properties": { - "type": { - "type": "number", - "enum": [5] - }, - "initialValue": { - "type": "boolean" - } - } - } - } + } } \ No newline at end of file diff --git a/schema/klighd/messages/diagramOptionsPerformAction.json b/schema/klighd/messages/diagramOptionsPerformAction.json new file mode 100644 index 00000000..48628e22 --- /dev/null +++ b/schema/klighd/messages/diagramOptionsPerformAction.json @@ -0,0 +1,25 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/messages/diagramOptionsPerformAction.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "keith/diagramOptions/performAction", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/requestMessage.json"}], + "required": ["method", "params"], + "properties": { + "method": { + "type": "string", + "enum": ["keith/diagramOptions/performAction"] + }, + "params": { + "type": "object", + "required": ["actionId", "uri"], + "properties": { + "actionId": { + "type": "string" + }, + "uri": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schema/klighd/messages/diagramOptionsSetLayoutOptions.json b/schema/klighd/messages/diagramOptionsSetLayoutOptions.json new file mode 100644 index 00000000..cacc7e8e --- /dev/null +++ b/schema/klighd/messages/diagramOptionsSetLayoutOptions.json @@ -0,0 +1,35 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/messages/diagramOptionsSetLayoutOptions.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "keith/diagramOptions/setLayoutOptions", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/requestMessage.json"}], + "required": ["method", "params"], + "properties": { + "method": { + "type": "string", + "enum": ["keith/diagramOptions/setLayoutOptions"] + }, + "params": { + "type": "object", + "required": ["layoutOptions", "uri"], + "properties": { + "layoutOptions": { + "type": "array", + "items": { + "type": "object", + "required": ["optionId", "value"], + "properties": { + "optionId": { + "type": "string" + }, + "value": {} + } + } + }, + "uri": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schema/klighd/messages/diagramOptionsSetSynthesisOptions.json b/schema/klighd/messages/diagramOptionsSetSynthesisOptions.json new file mode 100644 index 00000000..6d60dae1 --- /dev/null +++ b/schema/klighd/messages/diagramOptionsSetSynthesisOptions.json @@ -0,0 +1,28 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/messages/diagramOptionsSetSynthesisOptions.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "keith/diagramOptions/setSynthesisOptions", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/requestMessage.json"}], + "required": ["method", "params"], + "properties": { + "method": { + "type": "string", + "enum": ["keith/diagramOptions/setSynthesisOptions"] + }, + "params": { + "type": "object", + "required": ["synthesisOptions"], + "properties": { + "synthesisOptions": { + "type": "array", + "items": { + "$ref": "/kieler/klighd-vscode/tree/main/schema/klighd/valuedSynthesisOption.json" + } + }, + "uri": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schema/klighd/messages/setPreferences.json b/schema/klighd/messages/preferencesSetPreferences.json similarity index 94% rename from schema/klighd/messages/setPreferences.json rename to schema/klighd/messages/preferencesSetPreferences.json index 75c6b943..227f8265 100644 --- a/schema/klighd/messages/setPreferences.json +++ b/schema/klighd/messages/preferencesSetPreferences.json @@ -1,5 +1,5 @@ { - "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/messages/setPreferences.json", + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/klighd/messages/preferencesSetPreferences.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "keith/preferences/setPreferences", "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/requestMessage.json"}], diff --git a/schema/lsp/generalSendMessage.json b/schema/lsp/generalSendMessage.json new file mode 100644 index 00000000..6da08838 --- /dev/null +++ b/schema/lsp/generalSendMessage.json @@ -0,0 +1,19 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/lsp/generalSendMessage.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "general/sendMessage", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/lsp/requestMessage.json"}], + "required": ["method", "params"], + "properties": { + "method": { + "type": "string", + "enum": ["general/sendMessage"] + }, + "params": { + "type": "array", + "items": { + "type": "string" + } + } + } +} \ No newline at end of file diff --git a/schema/lsp/range.json b/schema/lsp/range.json new file mode 100644 index 00000000..47f7a90a --- /dev/null +++ b/schema/lsp/range.json @@ -0,0 +1,29 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/lsp/range.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "range", + "type": "object", + "required": ["start", "end"], + "properties": { + "start": { + "$ref": "#/definitions/editorPosition.json" + }, + "end": { + "$ref": "#/definitions/editorPosition.json" + } + }, + "definitions": { + "editorPosition.json": { + "type": "object", + "required": ["line", "character"], + "properties": { + "line": { + "type": "integer" + }, + "character": { + "type": "integer" + } + } + } + } +} \ No newline at end of file diff --git a/schema/lsp/requestMessage.json b/schema/lsp/requestMessage.json index 1fa41a01..03924db3 100644 --- a/schema/lsp/requestMessage.json +++ b/schema/lsp/requestMessage.json @@ -3,7 +3,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "message", "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/lsp/message.json"}], - "required": ["id", "method"], + "required": ["method"], "properties": { "id": { "type": ["number", "string"] diff --git a/schema/lsp/textDocumentDocumentHighlight.json b/schema/lsp/textDocumentDocumentHighlight.json new file mode 100644 index 00000000..998e3fbe --- /dev/null +++ b/schema/lsp/textDocumentDocumentHighlight.json @@ -0,0 +1,29 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/lsp/textDocumentDocumentHighlight.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "textDocument/documentHighlight", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/lsp/requestMessage.json"}], + "required": ["method", "params"], + "properties": { + "method": { + "type": "string", + "enum": ["textDocument/documentHighlight"] + }, + "params": { + "type": "object", + "properties": { + "textDocument": { + "type":"object", + "properties": { + "uri": { + "type": "string" + } + } + }, + "position": { + "$ref": "/kieler/klighd-vscode/tree/main/schema/lsp/position.json" + } + } + } + } +} \ No newline at end of file diff --git a/schema/sprotty/actions/action.json b/schema/sprotty/actions/action.json index 067295b0..2cb2fa92 100644 --- a/schema/sprotty/actions/action.json +++ b/schema/sprotty/actions/action.json @@ -7,6 +7,9 @@ "properties": { "kind": { "type": "string" + }, + "requestId": { + "type": "string" } } } \ No newline at end of file diff --git a/schema/sprotty/actions/allSelected.json b/schema/sprotty/actions/allSelected.json new file mode 100644 index 00000000..1214c45a --- /dev/null +++ b/schema/sprotty/actions/allSelected.json @@ -0,0 +1,17 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/sprotty/actions/allSelected.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "allSelected", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/actions/action.json"}], + "required": ["kind", "select"], + "properties": { + "kind": { + "type": "string", + "enum": ["allSelected"] + }, + "select": { + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schema/sprotty/actions/elementSelected.json b/schema/sprotty/actions/elementSelected.json new file mode 100644 index 00000000..f19c3619 --- /dev/null +++ b/schema/sprotty/actions/elementSelected.json @@ -0,0 +1,29 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/sprotty/actions/elementSelected.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "elementSelected", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/actions/action.json"}], + "required": ["kind", "selectedElementsIDs", "deselectedElementsIDs", "preventOpenSelection"], + "properties": { + "kind": { + "type": "string", + "enum": ["elementSelected"] + }, + "selectedElementsIDs": { + "type": "array", + "items": { + "type": "string" + } + }, + "deselectedElementsIDs": { + "type": "array", + "items": { + "type": "string" + } + }, + "preventOpenSelection": { + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schema/sprotty/actions/fit.json b/schema/sprotty/actions/fit.json new file mode 100644 index 00000000..9a82a5cf --- /dev/null +++ b/schema/sprotty/actions/fit.json @@ -0,0 +1,26 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/sprotty/actions/fit.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "fit", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/actions/action.json"}], + "required": ["kind", "elementIds", "maxZoom", "animate"], + "properties": { + "kind": { + "type": "string", + "enum": ["fit"] + }, + "elementIds": { + "type": "array", + "items": { + "type": "string" + } + }, + "maxZoom": { + "type": "number" + }, + "animate": { + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schema/sprotty/actions/setModel.json b/schema/sprotty/actions/setModel.json new file mode 100644 index 00000000..ff8d309d --- /dev/null +++ b/schema/sprotty/actions/setModel.json @@ -0,0 +1,17 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/sprotty/actions/setModel.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "setModel", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/actions/action.json"}], + "required": ["kind", "newRoot"], + "properties": { + "kind": { + "type": "string", + "enum": ["setModel"] + }, + "newRoot": { + "$ref": "/kieler/klighd-vscode/tree/main/schema/klighd/SKGraphSchema#/definitions/SKGraph" + } + } +} \ No newline at end of file diff --git a/schema/sprotty/actions/updateModel.json b/schema/sprotty/actions/updateModel.json new file mode 100644 index 00000000..a6c1a1b8 --- /dev/null +++ b/schema/sprotty/actions/updateModel.json @@ -0,0 +1,17 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/sprotty/actions/updateModel.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "updateModel", + "type": "object", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/actions/action.json"}], + "required": ["kind", "newRoot"], + "properties": { + "kind": { + "type": "string", + "enum": ["updateModel"] + }, + "newRoot": { + "$ref": "/kieler/klighd-vscode/tree/main/schema/klighd/SKGraphSchema#/definitions/SKGraph" + } + } +} \ No newline at end of file diff --git a/schema/sprotty/diagramOpenInTextEditor.json b/schema/sprotty/diagramOpenInTextEditor.json new file mode 100644 index 00000000..0be1cbd9 --- /dev/null +++ b/schema/sprotty/diagramOpenInTextEditor.json @@ -0,0 +1,39 @@ +{ + "$id": "https://github.com/kieler/klighd-vscode/tree/main/schema/sprotty/messages/diagramOpenInTextEditor.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "diagram/openInTextEditor", + "allOf": [{"$ref": "/kieler/klighd-vscode/tree/main/schema/sprotty/requestMessage.json"}], + "required": ["method", "params"], + "properties": { + "method": { + "type": "string", + "enum": ["diagram/openInTextEditor"] + }, + "params": { + "type": "object", + "required": ["location", "forceOpen"], + "properties": { + "location": { + "$ref": "#/definitions/location" + }, + "forceOpen": { + "type": "boolean" + } + } + } + }, + "definitions": { + "location": { + "type": "object", + "required": ["uri", "range"], + "properties": { + "uri": { + "type": "string" + }, + "range": { + "$ref": "/kieler/klighd-vscode/tree/main/schema/lsp/range.json" + } + } + } + } +} \ No newline at end of file