Skip to content

Please add Pug language support #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ooloth opened this issue Jun 1, 2017 · 7 comments
Open

Please add Pug language support #55

ooloth opened this issue Jun 1, 2017 · 7 comments

Comments

@ooloth
Copy link

ooloth commented Jun 1, 2017

Hi there,

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

Thanks.

@xxDukeMCxx
Copy link
Contributor

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
Copy link
Contributor

xxDukeMCxx commented Apr 27, 2018

So i go further thanksfull to this post explaining how to setup a dev environnement to debug :
#62 (comment)

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...

@pipe01
Copy link

pipe01 commented Jun 30, 2019

I really need this

@hjmtql
Copy link

hjmtql commented Feb 1, 2020

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

@ParadiseFallen
Copy link

So when it will work?

@j2443070
Copy link

still nothing?

@Enubia
Copy link

Enubia commented Nov 29, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants