neoclide / coc-css Goto Github PK
View Code? Open in Web Editor NEWCss language server extension for coc.nvim
Css language server extension for coc.nvim
Everything is working as expected, I only added this to my init.vim
:
autocmd FileType scss setl iskeyword+=@-@
But now, I don't get autocompletion for the imported variables and mixins by using @use
of sass in both .scss
and .sass
files.
Not even VSCode has support for PostCSS in the main CSS plugin (nor they intend to add, looks like, even though they later did something and refined it, but only for @-rules).
But there are available plugins that would support PostCSS (like PostCSS Language Support), so is it possible to wrap also them?
In particular, I would like to have support for sass-like parent selector.
If it is too complicate to wrap another plugin, would it be too complicated to add support for this rule?
I've been trying to install for the last 30 minutes, dont know if is a problem with NPM but I'm getting 401 Unauthorized on running the install script.
From sass
doc, @import
usage is discouraged in favor of @use
https://sass-lang.com/documentation/at-rules/import.
However, @use
doesn't seems to be recognized using coc-css
on vim but works on VS Code.
Any ideas?
For example, in this css:
color: red;
The color background for the word red
is red. I'd like to disable the color highlight. I tried to set
"coc.preferences.colorSupport": false,
on my coc-settings.json
but if I go to insert mode and back to normal mode, the colors are highlighted again
Is this right? This doesn't seem like correct behavior.
When trying to use coc-rename
on a SCSS mixin, it gets confused and thinks hyphens are not part of the name.
Autocomplete does work, if I type @include nav-
it will suggest @include nav-item-accessible-styles
and pre-fill the param placeholders and everything — works perfect. But when I try to coc-rename
the mixin, I get the behavior shown in the screenshot.
I've tried setting "coc.preferences.hyphenAsKeyword": true
and that didn't change anything.
Any ideas?
the CSS extensions seems to be working for only CSS and SCSS but not SASS.
Would love the support as I hate semicolons and unnecessary braces. XD
Please include a CSS formatter in this one. Prettier is not always available.
Hi, I am running this on a Raspberry Pi. The linting is working, but I get this error when I open a CSS file.
Am I missing a dependency? Does it matter?
[coc.nvim] Error on activate extension coc-css: V.services.registerLanguageClient is
not a function
I can't get any semicolon after auto completing css properties. Trying both <Enter>
and <Tab>
after selecting completion suggestion. I have tried both an empty coc-config and one where I explicitly defined css.completion.completePropertyWithSemicolon
with same non working result.
vim version: NVIM v0.4.4
node version: v12.18.1
coc.nvim version: 0.0.79-b1288b0de4
coc.nvim directory: /Users/jesper/.vim/plugged/coc.nvim
term: iTerm.app
platform: darwin
Any ideas? And how would I even begin to debug something like this?
I've tried with CocInstall coc-css
but I get the following:
[coc.nvim] Error on install coc-css: Error: write EPROTO 140370308294464:error:1408F10B:SSL routines:ssl3_get_record:wrong version num
ber:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
Any hints? Thank you.
The first time to writing in .sass
file, but I don't get prediction or autocompeletion.
The readme mentions the setting css.filetypes
but when I use it in coc-settings.json
like "css.filetypes": ["css", "sass", "scss"]
the settings linter says it is not allowed.
vim version: NVIM v0.5.0-397-g96059d72e
node version: v12.13.1
coc.nvim version: 0.0.75-0b7b4043c8
term: undefined
platform: win32
...
When installing with a plugin manager, the completion not working, but when install with CocInstall, working normally 💃
Installed via a plugin manager (vim-plug for example) is oficial supported?
Hi is there any configuration to enable css lsp on html files? Thanks
Doesn't matter how this is installed, nothing works. I've tried using CocInstall coc-css
and putting it in the init.vim
and each time auto formatting or completion refuses to work.
I explored in the project and ran yarn install
and got the following output:
sethen@zeus in ~/.config/coc/extensions/node_modules/coc-css
↪ yarn install
yarn install v1.22.4
warning ../../package.json: No license field
info No lockfile found.
[1/5] Validating package.json...
warning [email protected]: The engine "coc" appears to be invalid.
[2/5] Resolving packages...
warning webpack > watchpack > watchpack-chokidar2 > [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning webpack > watchpack > watchpack-chokidar2 > chokidar > [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning webpack > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
warning webpack > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
[3/5] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > @chemzqm/[email protected]" has incorrect peer dependency "tslint@^5.8.0".
warning "@chemzqm/tslint-config > [email protected]" has incorrect peer dependency "tslint@^5.1.0".
[5/5] Building fresh packages...
success Saved lockfile.
$ npx npm-run-all clean build
npx: installed 58 in 2.967s
yarn run v1.22.4
warning ../../package.json: No license field
warning [email protected]: The engine "coc" appears to be invalid.
$ rimraf lib
Done in 0.43s.
yarn run v1.22.4
warning ../../package.json: No license field
warning [email protected]: The engine "coc" appears to be invalid.
$ webpack
Insufficient number of arguments or no entry found.
Alternatively, run 'webpack(-cli) --help' for usage info.
Hash: 4692319df93a97b98914
Version: webpack 4.44.1
Time: 35ms
Built at: 08/17/2020 7:55:43 PM
ERROR in Entry module not found: Error: Can't resolve './server/node/cssServerMain.ts' in '/home/sethen/.config/coc/extensions/node_modules/coc-css'
ERROR in Entry module not found: Error: Can't resolve './src/index.ts' in '/home/sethen/.config/coc/extensions/node_modules/coc-css'
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build" exited with 2.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Looks like something is broken. You can't resolve it yourself by running yarn install
. There isn't a node_modules
directory when it first gets installed -- nothing in the lib
directory either. Not sure how this is supposed to work but the directory structure is just this when installed:
sethen@zeus in ~/.config/coc/extensions/node_modules/coc-css
↪ llf
total 204
drwx------ 4 sethen sethen 4096 Aug 17 19:55 .
drwxrwxr-x 16 sethen sethen 4096 Aug 17 19:51 ..
drwxrwxr-x 2 sethen sethen 4096 Aug 17 19:55 lib
-rw-r--r-- 1 sethen sethen 25515 Oct 26 1985 package.json
-rw-r--r-- 1 sethen sethen 12671 Oct 26 1985 Readme.md
-rw-r--r-- 1 sethen sethen 729 Oct 26 1985 webpack.config.js
Compare this to the directory structure in the coc-html
module:
sethen@zeus in ~/.config/coc/extensions/node_modules/coc-html
↪ llf
total 352
drwx------ 5 sethen sethen 4096 Aug 17 20:02 .
drwxrwxr-x 6 sethen sethen 4096 Aug 17 20:02 ..
-rw-r--r-- 1 sethen sethen 151937 Oct 26 1985 jquery.d.ts
drwxrwxr-x 2 sethen sethen 4096 Aug 17 20:01 lib
drwxrwxr-x 4 sethen sethen 4096 Aug 17 20:02 node_modules
-rw-r--r-- 1 sethen sethen 6466 Oct 26 1985 package.json
-rw-rw-r-- 1 sethen sethen 170559 Aug 17 20:02 package-lock.json
-rw-r--r-- 1 sethen sethen 1004 Oct 26 1985 Readme.md
drwxrwxr-x 2 sethen sethen 4096 Aug 17 20:01 .vim
This issue has been already raised on VSCode repository #28459
and on its own CSS language server #156.
Since then, there was no progress in this case. So, I thought I would try asking if your extension can be better than them.
Is there any chance that your extension can support this feature?
It could provide features such as:
I'm using PostCSS with custom plugin like postcss-nested and coc is telling me I have syntax error. How do I disable this or configure it to allow custom postcss syntax?
Thank you.
Hello, this link opens a issue, instead of the coc-css main page!!!
https://github.com/neoclide/coc.nvim/wiki/Language-servers#csslesssass
For whatever reason if you define a variable say:
$primary-color: #fff
you then try to use it in the same file (or more usefully) in another file
p {
color: $pri <--- no completion for variable
}
Can someone please point me in the right direction?
When using coc-css and coc-tailwind while editing a scss
file, coc-css reports some errors.
This does not occur in css
files.
coc-tailwind completion works as usual in scss
files.
Thanks for the great work!
Edit:
Related question on VSCode: https://stackoverflow.com/questions/47607602/how-to-add-a-tailwind-css-rule-to-css-checker
There is a css.lint.unknownAtRules
option, but it's missing for scss
.
Edit 2:
Setting scss.validate
to false
hides the errors, but completion stops working.
So I just found out that css now supports nesting. I tried it in vscode, but with this plugin, I keep getting syntax errors. Do we need to update this package's CSS language service to get nesting to work?
The plugin is working great for almost everything, but does not seem to support new SASS Modules. Is there anything specific I need to do to enable support?
how to use this extensions on sass file type ?
--sorry if my english to bad
I was surprised to find that comment auto completion wasn't already a feature.
When /*
is typed, I suggest it auto completes to /* */
with the cursor in the center.
I try to use variables in the root _vars.scss then import it into the scss file I am trying to use the variables in. If I do not open _vars.scss first; I don't get any completion, however If I open _vars.scss in another tab I get completion in all tabs.
How do I set it up to complete without opening the original file just like I get for typescript?
Many css-in-js libraries support writing css inside template strings. For instance, in Emotion you can do:
import { css, } from 'emotion';
const style = css`
margin-bottom: 2rem;
color: red;
`
It would be great if there was a way to enable coc-css when editing these template literals
I always need change filetype to css , :Format
and back to wxss ...
I tried writing
$color-white: #fff;
and then $col it only suggest $color instead of the whole variable $color-white.
The filetype I have is .scss
Any way to make it work better?
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.