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

Pug language plugin transparent installation method #2036

Closed
CamilleDrapier opened this issue Oct 18, 2022 · 3 comments
Closed

Pug language plugin transparent installation method #2036

CamilleDrapier opened this issue Oct 18, 2022 · 3 comments
Labels
question Further information is requested

Comments

@CamilleDrapier
Copy link

Thank you for providing this very nice plugin!

Since version 1.0, in order to use volar with the "pug" language, we have to install the @volar/vue-language-plugin-pug dev dependency and configure TypeScript to use the additional vueCompilerOptions.

This has been done in order to separate the support for a feature that not everybody uses, which is a legitimate concern and works out well when following the upgrade instructions.


I have a minor concern, though, regarding the method of installing the support for pug support/capability, as it requires adding configuration related to the IDE I'm using to the repository, which I would prefer not to do. For example, If I chose to use Sublime Text, Jetbrains products, or VsCode; I would usually not have to commit configuration files for those editors to my repo. That way, people contributing to the repo can choose whatever IDE works best for them as long as they follow the lining/prettier/TS rules. But by adding some configuration explicitly referencing Volar, I would now imply that the expected editor for the repo is VsCode+Volar.

Thus, while I understand this would most likely be seen as a low-priority matter, I would like to ask If there would be an alternative way to use Volar + its pug plugin that would rely for example on installing the plugin globally, or if there are some changes planned in the future that would allow not to change the dependency/TS configuration in order to use it? Or maybe this was already considered and there was no acceptable solution found to do this so far?

@johnsoncodehk
Copy link
Member

Hi @CamilleDrapier, @volar/vue-language-plugin-pug and vueCompilerOptions is not related to IDE, it's about how @volar/vue-language-core resolve SFC file, and it will affect to @volar/vue-language-server, vue-tsc, coc-volar... and all downstream modules. (Just for clearer, if you don't have @volar/vue-language-plugin-pug, vue-tsc can't type check for pug template)

So don't worry you have not pushing VSCode specific stuff to the repo. :) (And I did take this into consideration when designing the architecture.)

@johnsoncodehk
Copy link
Member

I guess you see the problem is @volar/vue-language-plugin-pug current depend with some modules that related to LSP (@volar/pug-language-service...), this a implement problem of @volar/vue-language-plugin-pug, we will abstract pug parsing logic from @volar/pug-language-service to a basic module to avoid this problem.

@CamilleDrapier
Copy link
Author

@johnsoncodehk Thanks for your prompt reply and detailed explanations!

Sorry, I was not using vue-tsc so far, so I incorrectly thought the @volar/vue-language-plugin-pug and vueCompilerOptions was only meant to be used by the volar extension, but indeed after installing vue-tsc I can check the errors in CI and such by running vue-tsc --noEmit. This is incredibly useful as I was looking for a way to better validate templates automatically (having it in the editor is nice, but having it checked by CI is even better!)

As for the second problem you rose, I wasn't really aware of it, but if you want to use this issue to track it, then please do.

@johnsoncodehk johnsoncodehk added the question Further information is requested label Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants