GithubHelp home page GithubHelp logo

antonk52 / cssmodules-language-server Goto Github PK

View Code? Open in Web Editor NEW
48.0 48.0 8.0 606 KB

autocompletion and go-to-defintion for cssmodules

License: MIT License

JavaScript 0.60% TypeScript 84.78% CSS 2.70% Less 3.89% Sass 3.17% SCSS 4.25% Stylus 0.61%

cssmodules-language-server's People

Contributors

antonk52 avatar kecerud avatar khudhurmd avatar pineappletooth avatar quentin-fox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cssmodules-language-server's Issues

`Package subpath './lib/stringifier' is not defined by "exports" `

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.

Not working with tsconfig aliases

Hello! Thanks for the package.

It's not working when I use an alias:

{
   "baseUrl": "./",
    "paths": {
      "~/*": ["./*"]
    }
}
cssmodules-ts-aliases.mp4

.

Support for PascalCase class names

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.

For example:
image

Choosing the classOne option results in <p>Should be red</p> being rendered

Add license

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!

Rename support

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.

Cannot Find Module

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"

Duplicate Drive path

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

Neovim 8 changes

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.