Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow extension yang.settings JSON Schema extensibility #243

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading