Closed jfcherng closed 4 years ago
Using latest LSP version, it looks like it has problems getting configuration:
:: <-- lsp-css workspace/configuration(0): {'items': [{'section': 'scss', 'scopeUri': 'file://me/project/app.scss'}]}
:: >>> lsp-css 0: [None]
lsp-css: Unhandled exception: Cannot read property 'validProperties' of null
TypeError: Cannot read property 'validProperties' of null
at LintConfigurationSettings.getSetting (/Users/me/Library/Application Support/Sublime Text 3/Cache/LSP-css/vscode-css/node_modules/vscode-css-languageservice/lib/umd/services/lintRules.js:81:29)
at new LintVisitor (/Users/me/Library/Application Support/Sublime Text 3/Cache/LSP-css/vscode-css/node_modules/vscode-css-languageservice/lib/umd/services/lint.js:48:39)
at Function.LintVisitor.entries (/Users/me/Library/Application Support/Sublime Text 3/Cache/LSP-css/vscode-css/node_modules/vscode-css-languageservice/lib/umd/services/lint.js:61:27)
at CSSValidation.doValidation (/Users/me/Library/Application Support/Sublime Text 3/Cache/LSP-css/vscode-css/node_modules/vscode-css-languageservice/lib/umd/services/cssValidation.js:33:60)
at settingsPromise.then.settings (/Users/me/Library/Application Support/Sublime Text 3/Cache/LSP-css/vscode-css/out/cssServerMain.js:194:62)
Possibly due to recent changes to workspace/configuration
handling.
Added this to default settings:
"settings": {
"css": {
"validate": true,
},
"less": {
"validate": true,
},
"scss": {
"validate": true,
},
}
And it got rid of the error. Haven't investigated what other options are there and could be set though.
EDIT: Actually: https://github.com/microsoft/vscode-css-languageservice/blob/460bab34b4ef23985ee734ebf3fc4f3250285b1f/src/cssLanguageTypes.ts#L19-L23
BTW. Here is configuration that vscode sends:
Also, is it strange that it doesn't include sass
?
Also, is it strange that it doesn't include
sass
?
I just tested. It seems supporting Sass (indent style) :thinking: But since I am not a Sass user so I am not quite sure.
I also want to flatten configuration a bit and remove duplication in settings, like I did for https://github.com/sublimelsp/LSP-json/pull/8 but that can be done separately. Figured I'd mention since you are doing some refactoring there.
I also want to flatten configuration a bit and remove duplication in settings, like I did for sublimelsp/LSP-json#8 but that can be done separately. Figured I'd mention since you are doing some refactoring there.
I just feel that the configuration now is too long to write it along with logic codes together. :smile:
BTW. Here is configuration that vscode sends:
VSCode configuration ...
Also, is it strange that it doesn't include
sass
?
Nice. I guess we can just copy it to have the same default behavior with VSC?
For both PRs also please:
.no-sublime-package
For both PRs also please:
- add dependencies.json
- delete
.no-sublime-package
I assume utils/
can be deleted as well?
I assume
utils/
can be deleted as well?
At least when lsp_utils
is released. For now you probably want to keep it for testing while developing. Although if you have installed lsp_utils manually locally then feel free to remove already.
Doing the same thing with https://github.com/sublimelsp/LSP-html/pull/3 but for the css server. There seems to be no formatting functionality available.
We have to compile it from the source by ourselves.
Now, it supports Only
Code Actions
is available before this PR.