antonk52 / cssmodules-language-server Goto Github PK
View Code? Open in Web Editor NEWautocompletion and go-to-defintion for cssmodules
License: MIT License
autocompletion and go-to-defintion for cssmodules
License: MIT License
Tried to build this, but I'm getting this error when trying to trigger a definition jump:
Package subpath './lib/stringifier' is not defined by "exports" in /nix/store/22p2iznzn925vfrn8s91ljwag635s7s4-cssmodules-language-server-1.3.1/lib/node_modules/cssmodules-language-server/node_modules/postcss/package.json
It looks like that it's a postcss problem, but I'm not sure why it's happening.
It seems that named export is not detected, which is embarrassing because it's an ES6 feature that everyone loves :(
cc @antonk52
Hello! Thanks for the package.
It's not working when I use an alias:
{
"baseUrl": "./",
"paths": {
"~/*": ["./*"]
}
}
.
Is there any way this could support PascalCase
class names? The codebase at my company has a lot of CSS modules that contain class names that match the components they style, i.e. <Task className={styles.Task}>...</Task>
.
Currently, the lsp returns the class in camelCase which resolves to undefined and causes the element to have no className
attribute.
Choosing the classOne
option results in <p>Should be red</p>
being rendered
Hi there! I'm packaging this for the AUR. The package appears to be MIT-licensed per the npm manifest, so a license file included in the repo is customary. Cheers!
Ability to rename the CSS classes would make refactoring so much easier. Of course, it should also take the casing rules into account when performing the rename.
On my one machine with Neovim, I am getting lsp error and not sure what caused this.
[ERROR][2022-01-24 16:54:36] .../vim/lsp/rpc.lua:420 "rpc" "cssmodules-language-server" "stderr" "internal/modules/cjs/loader.js:892\n throw err;\n ^\n\nError: Cannot find module './utils/resolveAliasedImport'\nRequire stack:\n- /Users/John.Costanzo/.local/share/nvim/lsp_servers/cssmodules_ls/node_modules/cssmodules-language-server/lib/utils.js\n- /Users/John.Costanzo/.local/share/nvim/lsp_servers/cssmodules_ls/node_modules/cssmodules-language-server/lib/CompletionProvider.js\n- /Users/John.Costanzo/.local/share/nvim/lsp_servers/cssmodules_ls/node_modules/cssmodules-language-server/lib/connection.js\n- /Users/John.Costanzo/.local/share/nvim/lsp_servers/cssmodules_ls/node_modules/cssmodules-language-server/lib/cli.js\n at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)\n at Function.Module._load (internal/modules/cjs/loader.js:745:27)\n at Module.require (internal/modules/cjs/loader.js:961:19)\n at require (internal/modules/cjs/helpers.js:92:18)\n at Object. (/Users/John.Costanzo/.local/share/nvim/lsp_servers/cssmodules_ls/node_modules/cssmodules-language-server/lib/utils.js:22:32)\n at Module._compile (internal/modules/cjs/loader.js:1072:14)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)\n at Module.load (internal/modules/cjs/loader.js:937:32)\n at Function.Module._load (internal/modules/cjs/loader.js:778:12)\n at Module.require (internal/modules/cjs/loader.js:961:19) {\n code: 'MODULE_NOT_FOUND',\n requireStack: [\n '/Users/John.Costanzo/.local/share/nvim/lsp_servers/cssmodules_ls/node_modules/cssmodules-language-server/lib/utils.js',\n '/Users/John.Costanzo/.local/share/nvim/lsp_servers/cssmodules_ls/node_modules/cssmodules-language-server/lib/CompletionProvider.js',\n '/Users/John.Costanzo/.local/share/nvim/lsp_servers/cssmodules_ls/node_modules/cssmodules-language-server/lib/connection.js',\n '/Users/John.Costanzo/.local/share/nvim/lsp_servers/cssmodules_ls/node_modules/cssmodules-language-server/lib/cli.js'\n ]\n}\n"
after installing this LSP it loaded correctly, but the reference is wrong.
i have file
-Login.tsx
-Login.module.css
i use
import LoginStyle from './Login.module.css'
but when i go to definition the error is
no such file or Directory, open 'D:\D:\Projects\myproject\src\Login.module.css'
notice the drive alias is double
the root directory is correct at my project
D:\Projects\myproject
Hi there! Wanted to create a pull request to change the README but seems like I can't.
There have been changes in neovim 8 see: neovim/nvim-lspconfig#1891 (comment)
And part of this snippet is deprecated:
require'lspconfig'.cssmodules_ls.setup {
on_attach = function (client)
-- avoid accepting `go-to-definition` responses from this LSP
client.resolved_capabilities.goto_definition = false
custom_on_attach(client)
end,
}
resolved_capabilities
is now server_capabilities
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.