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

Add css-variables-language-server #3042

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

roginfarrer
Copy link
Contributor

Add configuration for the css-variables-language-server.

Currently blocked by vunguyentuan/vscode-css-variables#83

The CSS language server does not support CSS variables declared in other files. This augments that language server to provide autocompletion and go-to-definition support for CSS variables.

@roginfarrer roginfarrer requested a review from glepnir as a code owner March 2, 2024 17:59
@roginfarrer roginfarrer force-pushed the css-variables-language-server branch from 383ceff to e2b8ded Compare March 2, 2024 18:03
@glepnir glepnir merged commit 6a62bc1 into neovim:master Mar 3, 2024
9 checks passed
@gegoune
Copy link
Contributor

gegoune commented Mar 3, 2024

It probably should have gone into lua/lspconfig/server_configurations/css_variables.lua rather than lua/lspconfig/server_configurations/css-variables.lua (- vs _) which follows all other LSPs configured in lspconfig so users don't have to use ["css-variables"] and can just use css_variables.

@glepnir Should I open PR renaming that file or was is done as such purposefully?
@roginfarrer Thanks for that, didn't know that thing existed and it looks like pretty useful LSP! Unfortunately I am unable to test it as server fails for me with

[WARN] ...lsp/handlers.lua:134     "The language server css-variables triggers a registerCapability handler for workspace/didChangeConfiguration despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[WARN] ...lsp/handlers.lua:134     "The language server css-variables triggers a registerCapability handler for workspace/didChangeWorkspaceFolders despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[ERROR] .../vim/lsp/rpc.lua:784    "rpc"   "/Users/gegoune/.local/bin/css-variables-language-server" "stderr"        "/Users/gegoune/.pnpm-global/5/.pnpm/[email protected]/node_modules/css-variables-language-server/dist/index.js:250\n        await (0, import_fast_glob.default)(settings.lookupFiles, {\n                                                     ^\n\nTypeError: Cannot read properties of null (reading 'lookupFiles')\n    at CSSVariableManager.parseAndSyncVariables (/Users/gegoune/.pnpm-global/5/.pnpm/[email protected]/node_modules/css-variables-language-server/dist/index.js:250:54)\n    at /Users/gegoune/.pnpm-global/5/.pnpm/[email protected]/node_modules/css-variables-language-server/dist/index.js:328:22\n\nNode.js v21.6.2\n"
[WARN] ...m/lsp/client.lua:1000    "server_request: no handler found for"  "workspace/diagnostic/refresh"
[ERROR] ...lsp/handlers.lua:575    "Unhandled exception: MethodNotFound\nError: MethodNotFound\n    at handleResponse (/Users/gegoune/.pnpm-global/5/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/connection.js:565:48)\n    at handleMessage (/Users/gegoune/.pnpm-global/5/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/connection.js:345:13)\n    at processMessageQueue (/Users/gegoune/.pnpm-global/5/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/connection.js:362:17)\n    at Immediate.<anonymous> (/Users/gegoune/.pnpm-global/5/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/connection.js:334:13)\n    at process.processImmediate (node:internal/timers:478:21)"

Any clues why it might be?

@glepnir
Copy link
Member

glepnir commented Mar 3, 2024

oh it's should be _ not - i ignored file name good catch :)

@roginfarrer
Copy link
Contributor Author

@gegoune I'm not sure what the ideal fix is, but hardcoding the LSP's default settings does the trick for me #3046

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants