postcss-language icon indicating copy to clipboard operation
postcss-language copied to clipboard

Intellisense/autocompletion

Open mdmoreau opened this issue 6 years ago • 12 comments

Are there plans to add any form of intellisense or autocompletion for this extension? I've been using https://marketplace.visualstudio.com/items?itemName=mhmadhamster.postcss-language for a while now as it's the only thing I could find with proper support for those, but it hasn't been updated in a couple of years.

The highlighting and everything else looks great, so figured I'd ask about any planned support. Thanks for all the work!

mdmoreau avatar Dec 03 '19 00:12 mdmoreau

Shouldn't this extension support everything that the built-in CSS extension supports? Ie. it extends the CSS functionality of VS Code?

joelmoss avatar Dec 13 '19 09:12 joelmoss

Might be worth checking out the custom data format (https://code.visualstudio.com/blogs/2020/02/24/custom-data-format) for this.

mdmoreau avatar Feb 25 '20 16:02 mdmoreau

Deal-breaker for this plugin

marcofugaro avatar Jul 15 '20 15:07 marcofugaro

Current behaviour Expected behaviour
Screenshot 2020-07-15 at 17 28 39 Screenshot 2020-07-15 at 17 28 19

Only the first is an emmet abbreviation (enabled in postcss as documented in the README).

marcofugaro avatar Jul 15 '20 15:07 marcofugaro

Shouldn't this extension support everything that the built-in CSS extension supports? Ie. it extends the CSS functionality of VS Code?

Yes, @joelmoss. You are correct. My understanding is that I need to write my own Intellisense integration. I intend to, as there are some guides. It does not necessarily appear to be easy or straight forward. If it were easy to do so, I would have probably seen this in the form of a PR. However, this is ultimately my responsibility. I was unaware of this need when I first wrote this language extension. I’m sorry about that.

Deal-breaker for this plugin

I totally understand, @marcofugaro. I wrote this language extension because I could not find another one that correctly handled the syntax liberality of https://www.w3.org/TR/css-syntax-3/. However, I failed to see how the Intellisense integration was not a separate process.

Only the first is an emmet abbreviation (enabled in postcss as documented in the README).

I do not know the cause of this, but is it safe to say that it’s a result of the missing Intellisense integration?

jonathantneal avatar Jul 17 '20 14:07 jonathantneal

I do not know the cause of this, but is it safe to say that it’s a result of the missing Intellisense integration?

I think it is. As far as I understand, emmet and the other properties of the intellisense are a different thing, the emmet ones are provided by the emmet plugin.

marcofugaro avatar Jul 17 '20 14:07 marcofugaro

First, very glad there is a maintained postcss for VSCode around. The others seem to have stopped.

I have been using postcss-sugarss-language, and it has been working pretty well, some gotcha on mixins, but other than that IntelliSense works, which is the air-conditioning of CSS.

The problem with postcss-sugarss-language is that it now gets some Buffer().... security warnings and the plugin is not maintained, so, won't probably be fixed.

This one looks promising, but coding CSS without IntelliSense is like driving through death valley without air conditioning.

I wished I could help, but I not well versed with VSCode IntelliSense, language server, and syntax highlighting ...

Perhaps something from postcss-sugarss-language can be borrowed.

EDIT: 2020-10-06

Btw, I found a workaround with VSCode, can't believe it was that easy. , but no plugin and get full auto-complete. But in settings.json add

"files.associations": {
    "*.pcss": "scss",
    ...

Anyway, I am sure this approach has some gotchas, but for now since we use css var, we use pcss mostly for autoprefix, import, and nested, which is the same in sass.

jeremychone avatar Oct 06 '20 17:10 jeremychone

@jonathantneal I wonder if this is what you need: https://code.visualstudio.com/api/references/vscode-api#languages.registerCompletionItemProvider. This looks like you could tell your plugin to use the css code intel built into vs code. Sorry for just throwing a link at you, I'm under a bit of a time crunch and I wouldn't know where to begin to make a PR for this.

th3coop avatar Feb 20 '21 20:02 th3coop

IntelliSense is very important. The emmet hint is great, but it's not autocompletion.

demo Recorded css build-in autocomplete IntelliSense.

Is it possible to tell vs code to use the autocomplete like it's css? Since this is annoying I think I remove this extension.

I would increase the priority of this issue. Initially reported on 3 Dec 2019, almost 20 months / 2 years.

Hint: In scss the css IntelliSense (autocomplete) works like expected. Maybe we can find there the solution how it works.

y0nd0 avatar Jul 10 '21 14:07 y0nd0

I would also like to use postcss in vscode but yeah like others says autocomplete not working is bit annoying. So actually I would just go back to vanilla css.

KirdesMF avatar Dec 27 '21 14:12 KirdesMF

Same here, great plugin but unfortunately autocomplete has more value.

petervukovic avatar Jan 14 '22 13:01 petervukovic

I faced the same problem, and replacing postcss-language with this plugin solved it perfectly!

xiaohk avatar Aug 19 '23 19:08 xiaohk