Skip to content

Commit

Permalink
Allow extension yang.settings JSON Schema extensibility (#243)
Browse files Browse the repository at this point in the history
* Allow extension yang.settings JSON Schema extensibility

This addresses #242

Signed-off-by: Siddharth Sharma <[email protected]>

* Document multiple extension classpaths

Signed-off-by: Siddharth Sharma <[email protected]>

---------

Signed-off-by: Siddharth Sharma <[email protected]>
  • Loading branch information
esmasth authored Jun 18, 2024
1 parent 5d25b3f commit 3697fbd
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ indent_size = 2
[{*.xtext,*.xtend,*.java}]
indent_style = tab
indent_size = 4

[JenkinsFile]
indent_style = space
indent_size = 4
13 changes: 13 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -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": []
}
9 changes: 5 additions & 4 deletions docs/Extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
```

Expand Down
16 changes: 7 additions & 9 deletions schema/yang-lsp-settings-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
Expand Down Expand Up @@ -255,8 +254,7 @@
"$ref": "#/properties/diagnostic/$defs/severity",
"default": "ignore"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
Expand Down

0 comments on commit 3697fbd

Please sign in to comment.