sublimelsp / LSP-vue

Vue support for Sublime's LSP plugin
MIT License
29 stars 3 forks source link

Cant disable vetur.colorDecorators #82

Closed faaizajaz closed 4 years ago

faaizajaz commented 4 years ago

I am trying to figure out how to change the setting that adds color phantoms to hex colors (in CSS for example). See the picture below:

Screenshot from 2020-10-24 11-04-53

According to this PR, this is controlled by the vetur.colorDecorators.enable setting, however adding "vetur.colorDecorators.enable": false to the LSP-vue settings does not work as expeted.

predragnikolic commented 4 years ago

At the time of that PR, the vetur.colorDecorators.enable setting was added: https://github.com/vuejs/vetur/pull/396/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R128

But I presume at some time in later it was removed as I no longer see vetur.colorDecorators.enable in the package.json file: https://github.com/vuejs/vetur/blob/master/package.json#L183


Instead what you can do is in LSP.sublime-settings set disabled_capabilities:

{
   // ...other lsp settings
   "disabled_capabilities": ["colorProvider"],
}
predragnikolic commented 4 years ago

Note: You can install LSP-json from package control as it will give you intelligent completions instide LSP.sublime-settings and other Sublime Text plugins that have a sublime-package.json

predragnikolic commented 4 years ago

Feel free to reopen it if you still have problems. :)

rchl commented 4 years ago

vetur uses https://github.com/vscode-langservers/vscode-css-languageserver behind the scenes and I can't see it supporting any configuration setting for that. So disabling the capability globally seems like the only way currently.

faaizajaz commented 4 years ago

Instead what you can do is in LSP.sublime-settings set disabled_capabilities

@predragnikolic disabling colorProvider did the trick. Learned some useful stuff in the process, thanks.

rwols commented 4 years ago

Note that that disables all colorProviders. In particular your css language servers.

rchl commented 4 years ago

But if you don't like to have it in vue files then likely you don't want it anywhere. :)

But it would probably be a good idea to support disabling capabilities per-server (configuration).

faaizajaz commented 4 years ago

I use the ColorHighlighter package so disabling all colorProviders works for me in this case, but I agree on per-server config being useful.