From 3697fbd7fa51071e104a06273152433af6036dfe Mon Sep 17 00:00:00 2001 From: Siddharth Sharma Date: Tue, 18 Jun 2024 08:52:01 +0200 Subject: [PATCH] Allow extension yang.settings JSON Schema extensibility (#243) * Allow extension yang.settings JSON Schema extensibility This addresses TypeFox/yang-lsp#242 Signed-off-by: Siddharth Sharma * Document multiple extension classpaths Signed-off-by: Siddharth Sharma --------- Signed-off-by: Siddharth Sharma --- .editorconfig | 4 ++++ .vscode/extensions.json | 13 +++++++++++++ docs/Extensions.md | 9 +++++---- schema/yang-lsp-settings-schema.json | 16 +++++++--------- 4 files changed, 29 insertions(+), 13 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..7e38f66 100644 --- a/docs/Extensions.md +++ b/docs/Extensions.md @@ -86,13 +86,14 @@ 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", - "validators" : "my.pack.MyExampleValidator", - "commands" : "my.pack.MyCommand" + "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 3716238..8c7b73e 100644 --- a/schema/yang-lsp-settings-schema.json +++ b/schema/yang-lsp-settings-schema.json @@ -34,18 +34,17 @@ "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 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 +254,7 @@ "$ref": "#/properties/diagnostic/$defs/severity", "default": "ignore" } - }, - "additionalProperties": false + } } }, "additionalProperties": false