HTML-CSS-Class-Completion icon indicating copy to clipboard operation
HTML-CSS-Class-Completion copied to clipboard

Please add Pug language support

Open ooloth opened this issue 8 years ago • 7 comments

Hi there,

Happy to see this extension! I write HTML using Pug, though, so it would be great if Pug were supported.

Thanks.

ooloth avatar Jun 01 '17 18:06 ooloth

Hi,

I'm very new to VSCODE, Web Dev and not yet trained to javascript... but by playing with source file of the extension it seem's to add partial support for PUG by adding these lines in extension.js :

in "enableEmmetSupport" function (simply add "jade"):

const languageModes = ["html", "razor", "php", "blade", "vue", "twig", "markdown", "erb", "handlebars", "ejs", "typescriptreact", "javascript", "javascriptreact", "jade"];

in "activate" function : // JADE/PUG based extensions ["jade"].forEach((extension) => { context.subscriptions.push(provideCompletionItemsGenerator(extension, /class=["|']([\w- ]*$)/, "."); });

Now in .PUG file css class completion work with the long syntax 😄 a(class="") image

but with the "dot syntax" it didn't work : a.class instead of CSS class, others suggestions are made in VSCODE : image

I tryed by add a new subscription with a new regexp, like that, but it didn't work : context.subscriptions.push(provideCompletionItemsGenerator(extension, /\.$/));

Can any experienced dev give me some advice to try to go further ?

Thanks !

xxDukeMCxx avatar Apr 25 '18 15:04 xxDukeMCxx

So i go further thanksfull to this post explaining how to setup a dev environnement to debug : https://github.com/zignd/HTML-CSS-Class-Completion/issues/62#issuecomment-323576610

I have now something that work in "long syntax" and "dot syntax", except at this time it didn't detect "Plain Text block in a tag" https://pugjs.org/language/plain-text.html#block-in-a-tag so completion sometime "contaminated" when typing script or plain text with a "dot".

However, it well detect "Plain Text Inline in a Tag", "Literal HTML" and "Piped Text" so in thoses cases the "dot" caracter isn't contaminated by useless completion...

xxDukeMCxx avatar Apr 27 '18 04:04 xxDukeMCxx

I really need this

pipe01 avatar Jun 30 '19 23:06 pipe01

I might found another useful extension which supports pug. https://marketplace.visualstudio.com/items?itemName=ecmel.vscode-html-css

hjmtql avatar Feb 01 '20 15:02 hjmtql

So when it will work?

ParadiseFallen avatar Jan 09 '21 15:01 ParadiseFallen

still nothing?

j2443070 avatar Apr 21 '22 13:04 j2443070

@zignd is this project even maintained anymore? this feature would be such a huge benefit IMO

Enubia avatar Nov 29 '22 07:11 Enubia