-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
support contributes.jsonValidation VSCode API. #7560
Conversation
I guess i need smaller case |
|
||
registerJsonValidation(jsonValidationEntry: JsonSchemaConfiguration): Disposable { | ||
this.registry.push(jsonValidationEntry); | ||
return Disposable.NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disposable.NULL
is bogus, please use JsonSchemaStore.registerSchema
instead. it has a proper logic to unregster configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bd82 It was not addressed, this should remove entry from this.registry
and json language server should be notified about it as well
@@ -11,6 +11,7 @@ | |||
"@theia/editor": "^1.0.0", | |||
"@theia/file-search": "^1.0.0", | |||
"@theia/filesystem": "^1.0.0", | |||
"@theia/json": "^1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need this dependency, we only need to register configuration in core json schema storage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@azatsarynnyy Do you know whether introducing such dependency will cause issues in Che? i.e. do you use json vscode built-in extensions already?
I'm not sure about this PR. The issue is that we should drop But we can accept is as a temporary solution? cc @eclipse-theia/ecd-theia-committers @bd82 please remove after closing of #3983 from the commit and PR descriptions. It does not resolve it without switching to the built-in. |
Switching to the built-in extension will automatically resolves the issue: https://github.com/theia-ide/vscode/blob/d24b5f70c69b3e75cd10c6b5247a071265ccdd38/extensions/json-language-features/client/src/jsonMain.ts#L327-L360 |
@akosyakov are there any estimated timelines for switching out |
@bd82 I hope within next 2 months. We are planning to work on removing I think we can accept this PR for time being, but there are still 2 issues:
|
I will fix the "wrong shapes" in the next few days/
Hmm, probably best if we can merge this PR as a temp solution (once review passes). |
Signed-off-by: I060847 <shachar.soel@sap.com>
Hi @akosyakov I've fixed the wrong shape and another relevant CR comment. |
O.k. I've tested manually for both scenarios of fileMatch as a single string and as an array of strings. works well. |
@@ -14,6 +16,7 @@ Use `PluginManager.configStorage` property instead. [#7265](https://github.com/e | |||
|
|||
## v1.0.0 | |||
|
|||
- [core] `CommandRegistry#getAllHandlers` returns with the reversed order of handlers, so if a command has multiple handlers, any handler is considered to be more specific than the other subsequent handlers in the array. In other words, if `@theia/core` contributes a handler for a particular command and your extension also contributes a handler for the same command, the handler from your extension will have `0` index, and the handler from `@theia/core` will have `1` index when calling `getAllHandlers`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be here. How did you get it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oy probably via a rebase to update my local branch
allConfigs.push(...config); | ||
} | ||
const schemaStoreConfigs = this.jsonSchemaStore.getJsonSchemaConfigurations(); | ||
const pluginContributionConfigs = this.jsonValidationContributionsRegistry.getJsonValidations(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
such configs can be registered dynamically, i.e. a user install or uninstall new extension. registry should fire an event and contribution should trigger updateSchemas
then
@bd82 please see comments |
I think that's OK. I seem to remember the debug package requires json anyway to correctly show the UI for configuring debug configs. |
I will try to find time to get back to this PR next week. |
Hello @akosyakov. I am having difficulty finding the time to complete this...
Is there any update /time estimates on said switch? Thanks. |
We've already started looking into it. The latest is mid of next month. |
Thanks for the update @akosyakov |
I think this PR is now redundant so I'm closing it. |
What it does
Support VSCode contributes.jsonValidation API.
Note that jsonValidation contribution have a higher priority than SchemaStore schemas, and a lower priority than registered schemas from the preferences
(In case of identical
fileMatch
strings).How to test
contributes.jsonValidation
section pointing to some schema from the schema store with an appropriatefileMatch
property`.plugins
folder.Review checklist
Reminder for reviewers