From 31d587c2fb54ad2afc81cf64fd43649db3d54900 Mon Sep 17 00:00:00 2001 From: Siddharth Sharma Date: Tue, 23 Apr 2024 20:09:22 +0200 Subject: [PATCH 1/2] Allow extension yang.settings JSON Schema extensibility This addresses TypeFox/yang-lsp#242 Signed-off-by: Siddharth Sharma --- .editorconfig | 4 ++++ .vscode/extensions.json | 13 +++++++++++++ docs/Extensions.md | 4 ++-- schema/yang-lsp-settings-schema.json | 11 +++++------ 4 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 .vscode/extensions.json diff --git a/.editorconfig b/.editorconfig index 8e776c5..2903397 100644 --- a/.editorconfig +++ b/.editorconfig @@ -32,3 +32,7 @@ indent_size = 2 [{*.xtext,*.xtend,*.java}] indent_style = tab indent_size = 4 + +[JenkinsFile] +indent_style = space +indent_size = 4 diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..fe0a693 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,13 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "editorconfig.editorconfig", + "grammarcraft.xtend-lang", + "grammarcraft.xtext-lang", + "bierner.github-markdown-preview" + ], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [] +} diff --git a/docs/Extensions.md b/docs/Extensions.md index 0fbd22f..db573f1 100644 --- a/docs/Extensions.md +++ b/docs/Extensions.md @@ -91,8 +91,8 @@ configuration: ```json "extension" : { "classpath" : "extension.jar", - "validators" : "my.pack.MyExampleValidator", - "commands" : "my.pack.MyCommand" + "validators" : "my.pack.MyExampleValidator:my.pack.MyYetAnotherExampleValidator", + "commands" : "my.pack.MyCommand:my.pack.MyOtherCommand" } ``` diff --git a/schema/yang-lsp-settings-schema.json b/schema/yang-lsp-settings-schema.json index 3716238..4180d20 100644 --- a/schema/yang-lsp-settings-schema.json +++ b/schema/yang-lsp-settings-schema.json @@ -39,13 +39,13 @@ "pattern": "\\.jar$" }, "validators": { - "description": "IValidatorExtension implementor class e.g., 'my.pack.MyExampleValidator'", - "markdownDescription": "`IValidatorExtension` implementor class e.g., `my.pack.MyExampleValidator`", + "description": "IValidatorExtension implementor classes e.g., 'my.pack.MyExampleValidator'.\nYou can specify multiple elements separated with a colon ':'", + "markdownDescription": "`IValidatorExtension` implementor classes e.g., `my.pack.MyExampleValidator`.\nYou can specify multiple elements separated with a colon ':'", "type": "string" }, "commands": { - "description": "ICommandExtension implementor class e.g., 'my.pack.MyExampleCommand'", - "markdownDescription": "`ICommandExtension` implementor class e.g., `my.pack.MyExampleCommand`", + "description": "ICommandExtension implementor classes e.g., 'my.pack.MyExampleCommand'.\nYou can specify multiple elements separated with a colon ':'", + "markdownDescription": "`ICommandExtension` implementor class e.g., `my.pack.MyExampleCommand`.\nYou can specify multiple elements separated with a colon ':'", "type": "string" } }, @@ -255,8 +255,7 @@ "$ref": "#/properties/diagnostic/$defs/severity", "default": "ignore" } - }, - "additionalProperties": false + } } }, "additionalProperties": false From 85a51bdb2a383112989c5cb059e3ed4f8f6bee1f Mon Sep 17 00:00:00 2001 From: Siddharth Sharma Date: Tue, 23 Apr 2024 20:46:52 +0200 Subject: [PATCH 2/2] Document multiple extension classpaths Signed-off-by: Siddharth Sharma --- docs/Extensions.md | 5 +++-- schema/yang-lsp-settings-schema.json | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/Extensions.md b/docs/Extensions.md index db573f1..7e38f66 100644 --- a/docs/Extensions.md +++ b/docs/Extensions.md @@ -86,11 +86,12 @@ project's root directory. ## Add the plugin Create (or open) the `yang.settings` file and add the plugin using the following -configuration: +configuration. Other classpaths, validator and commands classes can be provided +as well. ```json "extension" : { - "classpath" : "extension.jar", + "classpath" : "extension.jar:./second-extension.jar:./local-classdir/.", "validators" : "my.pack.MyExampleValidator:my.pack.MyYetAnotherExampleValidator", "commands" : "my.pack.MyCommand:my.pack.MyOtherCommand" } diff --git a/schema/yang-lsp-settings-schema.json b/schema/yang-lsp-settings-schema.json index 4180d20..8c7b73e 100644 --- a/schema/yang-lsp-settings-schema.json +++ b/schema/yang-lsp-settings-schema.json @@ -34,9 +34,8 @@ "type": "object", "properties": { "classpath": { - "description": "Location of extension jar relative to the project's root directory", - "type": "string", - "pattern": "\\.jar$" + "description": "Location of extension jar relative to the project's root directory.\nIt may also be a path to a directory.\nYou can specify multiple elements separated with a colon ':'", + "type": "string" }, "validators": { "description": "IValidatorExtension implementor classes e.g., 'my.pack.MyExampleValidator'.\nYou can specify multiple elements separated with a colon ':'",