Skip to content
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

I would like Pug support, and also Stylus #106

Open
BatsShadow opened this issue May 22, 2020 · 6 comments
Open

I would like Pug support, and also Stylus #106

BatsShadow opened this issue May 22, 2020 · 6 comments
Labels
feature request New feature or request wontfix This will not be worked on

Comments

@BatsShadow
Copy link

My current tech stack is Angular + Pug + Stylus. I would like to explore moving to Svelte, but it would be infeasible for me to move off of Pug. Stylus is a nice bonus too.

I believe I was able to get the preprocessor to do what I needed, but the lack of decent VSCode support was a deal breaker. I'm super glad this project is taking off!

In summary: please add some sort of pug and stylus support to the language processor and vscode. Thanks!

@dummdidumm
Copy link
Member

Both are supported through https://github.com/sveltejs/svelte-preprocess. You need to setup a svelte.config.js for that - see the docs of Svelte plugin beta for more info. Or is there something more advanced you desire support for?

@dummdidumm
Copy link
Member

Revising my comment a little: Both are supported through svelte-preprocess, but the intellisense support of Svelte Beta (the plugin, not the build config) is not very good. Stylus preprocessor support is there, but it may be that you don't get the syntax highlighting that you desire. template preprocessor support is missing completely at the moment, so no pug.

So what definetely should be done is to add that some basic template preprocessor support. But on how far to go with the intellisense, I'm not sure at this point, it might just get too many things at once to support, especially if there are not ready-to-use language servers around.

@dummdidumm dummdidumm added the feature request New feature or request label May 26, 2020
@vaaski
Copy link

vaaski commented Jul 17, 2020

I'm having a similar issue, my compilation with stylus works fine, but formatting in vscode doesn't work.
It seems to be trying to use prettier to format the code, but afaik prettier doesn't have support for stylus.

Coming from Vuejs, it worked fine with the Vetur extension.

I initially thought that the svelte extension treats the stylus style block as normal css, but that doesn't seem to be the case.
image
Compared to not including lang="stylus"
image

But upon trying to format, it prints Using Prettier v2.0.5 from *path* followed by some json and Error: unknown node type: Style into the Svelte output console.

{
    "type": "Style",
    "start": 69,
    "end": 152,
    "attributes": [
        {
            "start": 76,
            "end": 89,
            "type": "Attribute",
            "name": "lang",
            "value": [
                {
                    "start": 82,
                    "end": 88,
                    "type": "Text",
                    "raw": "stylus",
                    "data": "stylus"
                }
            ]
        }
    ],
    "children": [],
    "content": {
        "start": 144,
        "end": 144,
        "styles": "",
        "type": "StyleProgram"
    }
}

It behaves the same regardless of using a svelte.config.js like this or a modified version of this

I also just now realized that this could be related to sveltejs/prettier-plugin-svelte#55

dummdidumm pushed a commit to dummdidumm/language-tools that referenced this issue Jul 27, 2020
This provides syntax highlighting, but does not fix any diagnostic errors
sveltejs#106
dummdidumm added a commit that referenced this issue Jul 27, 2020
This provides syntax highlighting, but does not fix any diagnostic errors
#106
dummdidumm pushed a commit that referenced this issue Oct 30, 2020
Adds improved syntax highlighting when using Pug with Svelte. Uses injected grammars - this way the original Pug grammar is kept as it is, and does not have to be cloned.
#295, #106
@Enteleform
Copy link

Is it possible to provide IntelliSense for components and their attributes in Pug?

It seems that IntelliSense is working for interpolated values (see: Hello {name}) in Pug syntax, but components/attributes are not detected unless using HTML syntax. The following example is functional & renders as expected, but demonstrates the lack of IntelliSense.

SvelteDemo

@theoephraim
Copy link

👍 Would also love to see pug + typescript / intellisense support.

Any pointers on how things are working currently and how/where to pitch in to help make this happen?

@trylks
Copy link

trylks commented Mar 27, 2023

I have seen that Vue volar has support for Stylus syntax highlighting. I could not understand how to integrate their magic to make a pull request (just importing the highlighting from somewhere else). I hope this helps:
https://github.com/vuejs/language-tools/search?q=stylus

@jasonlyu123 jasonlyu123 added the wontfix This will not be worked on label May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

7 participants