-
Notifications
You must be signed in to change notification settings - Fork 11
Update server and make it run from cache directory #8
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
Conversation
|
|
|
Since I just saw this https://github.com/sublimelsp/LSP-json/pull/6/files#diff-0f49ebf0103c2d85a2b61d6712cad9c3 , I guess we should better support |
predragnikolic
left a comment
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.
I will merge this as soon as the lsp_utils is merged to package control
|
|
|
But then the latest VSCode doesn't report trailing commas in its configuration files. Should probably investigate why is that. |
|
|
Thanks for that. I've looked further from here and came up with this:
Not sure how we could do something similar for Sublime since URL of the schema should ideally be resolvable from a local machine rather than the Internet. If we make it resolve from the Internet then it would be easier (all schemas already included in LSP-json are resolved from the Internet already). EDIT: Actually we can just copy those schemas to cache directory like we do with the server itself and pass |
|
And as far as I can see in the code, the trick with the schema will work regardless if |
|
Actually readme of the server describes this pretty well - https://github.com/vscode-langservers/vscode-json-languageserver What protocols server fetches itself can be configured with a |
|
|
Went all-in and added schemes for SublimeText-specific files. All with the exception of |
predragnikolic
left a comment
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.
I left some comments, but this PR is really great. :)
| @@ -0,0 +1,6 @@ | |||
| { | |||
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.
Also what is the purpose of this file? (tried googling it, but found nothing on the first glance) :)
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's just to enable comments and trailing commas in project-wide vscode configuration files. Not that relevant for Sublime but I'm working on projects where developers split between vscode and sublime so those are common for me at least.
| }, | ||
| { | ||
| "fileMatch": ["tsconfig.json", "tsconfig.*.json", "tsconfig-*.json"], | ||
| "url": "sublime://schemas/tsconfig" |
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.
I think that you don't need "sublime://schemas/tsconfig" and "sublime://schemas/jsconfig" because they are already defined in schemas.json file :)
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.
The ones that are in schemas.json are official specs that abide schema drafts while those here are additional augmentations for those official ones that contain non-standard properties (vscode extensions). To allow comments, trailing commas and a couple other things you have to use those non-standard properties.
It's ok to provide more than one schema for same file pattern - language server merges those together.
The tsconfig is a file I use a lot in my projects so I'd like it to work well. I'm open to adding more that others find important (for example there are various properties that can be added to package.json since many npm packages allow storing their settings there). :)
| @@ -0,0 +1,25 @@ | |||
| #!/usr/bin/env python3 | |||
|
|
|||
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.
What do you think of creating a TextCommand that could be triggered from the command palette. Example LSP-json: Update schemas and that command would run this code bellow?
This can be an improvement for later, if you want to.
But am happy that you took the time to create a script :)
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.
I don't think they change often enough for it to be worth it. Also, since the package is compressed, we would have to save to cache folder. And also we would need to add dependency on requests package. But my main argument is that I think it's not worth it.
|
Got this when editing a Some other ST files may suffer as well. |
- update `vscode-json-languageserver` to version 1.2.3 - update schemas.py with latest updates from http://schemastore.org/api/json/catalog.json - add palette command for opening LSP-json settings - run server from cache directory
81fa2ad to
cc1a6b3
Compare
…aded - add a script for updating default schemas - save schemas into json file, removing all unused properties - load schemas using ResourcePath instead of import py file
Those will be read from default configuration file.
1dc0640 to
91b46dd
Compare


vscode-json-languageserverto version 1.2.3Of course will wait with integrating until
lsp_utilsis released.