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

Vue file extension support #26

Open
EranGrin opened this issue Feb 22, 2021 · 6 comments
Open

Vue file extension support #26

EranGrin opened this issue Feb 22, 2021 · 6 comments

Comments

@EranGrin
Copy link

Great work!

I had a similar idea to create an extension to resolve the webpack alias (same as PhpStorm)
but luckily, I did a quick check for an existing extension and stumbled upon yours.

The only thing I'm missing is support for vue files *.vue.
Would be great if you could add this support but otherwise if you don’t have time I could also start debugging the issue and add a PR.
Thanks, 🙏

@MarioCadenas
Copy link
Owner

Hi @EranGrin Thank you for opening, I have a few things that I want to do to this extension but I don't have a lot of time lately. If you think you can open a PR to contribute, is more than welcome. Luckily I might be able to look into it this weekend. Could you please give me a bit more of a detailed explanation of the use case you are looking for? Just being able to make this work on *.vue. files?

Thanks!

@EranGrin
Copy link
Author

EranGrin commented Feb 24, 2021

Hi @MarioCadenas, thanks for the prompt response.
I did open the code and run it in the vsCode debugger, but I couldn't find the issue at first glance or any property that define the file type to be only js, I assume it is related to the fact that vsCode nativity doesn't support *.vue files.
The use case(for me) is only to add support for *.vue files.
But.... if you're already taking this millstone I guess it might be nice to make this Great Plugin also support other frameworks: Angular, React etc..

If you do have time to check it that would be brilliant, otherwise I would have to slowly dive in to it and make a PR
Thanks again.

@zardoy
Copy link

zardoy commented Sep 12, 2022

How it can be implemented: https://github.com/zardoy/vscode-extension-patches/blob/e5110259bf2634a322b488ea7cf4c1d4b5b19254/extended-extensions/extensions/volar/all-features.patch#L1540-L1700 (I understand it might be hard to read) in my case it works just ideally

You can use it today with this extension in takeover mode in any projects. I can make pr to backport this native solution.

@MarioCadenas if you still care of this extension I think it should be converted into TypeScript plugin, so it would think these aliases are declared in tsconfig.json.

Earlier I've used this command to generate jsconfig aliases from webpack config: https://github.com/zardoy/vetur-extended/blob/main/src/commands/generateJsconfigAliases.ts

@MarioCadenas
Copy link
Owner

How it can be implemented: https://github.com/zardoy/vscode-extension-patches/blob/e5110259bf2634a322b488ea7cf4c1d4b5b19254/extended-extensions/extensions/volar/all-features.patch#L1540-L1700 (I understand it might be hard to read) in my case it works just ideally

You can use it today with this extension in takeover mode in any projects. I can make pr to backport this native solution.

@MarioCadenas if you still care of this extension I think it should be converted into TypeScript plugin, so it would think these aliases are declared in tsconfig.json.

Earlier I've used this command to generate jsconfig aliases from webpack config: https://github.com/zardoy/vetur-extended/blob/main/src/commands/generateJsconfigAliases.ts

Hi @zardoy thanks for the interest, if you want to open a PR you are more than welcome 😄

Regarding the migration to typescript, I don't think I'll do it because I wouldn't really need that to use the tsconfig.json file, which also I'll add support for it

@zardoy
Copy link

zardoy commented Sep 12, 2022

Regarding the migration to typescript, I don't think I'll do it because I wouldn't really need that to use the tsconfig.json file

Absolutely didn't get that. Readme says VSCode has a way to do this by defining a jsconfig.json file, so I want this extension to not provide its own declaration/completion provide, but instead reuse this tsconfig.json's logic (TypeScript's paths logic) by extending/creating tsconfig.json aliases automatically. We can change this internally as we have full control of TypeScript server via plugin

It means it would work the same way, as if it was defined in tsconfig.json manually

@MarioCadenas
Copy link
Owner

Regarding the migration to typescript, I don't think I'll do it because I wouldn't really need that to use the tsconfig.json file

Absolutely didn't get that. Readme says VSCode has a way to do this by defining a jsconfig.json file, so I want this extension to not provide its own declaration/completion provide, but instead reuse this tsconfig.json's logic (TypeScript's paths logic) by extending/creating tsconfig.json aliases automatically. We can change this internally as we have full control of TypeScript server via plugin

It means it would work the same way, as if it was defined in tsconfig.json manually

I see, but if you already have the aliases defined in the tsconfig.json file, you don't need this extension 😅 , VSCode will use the tsconfig to resolve those aliases 😄

The idea of this extension is to automatically get the aliases defined on webpack, or other files with a similar shape, and resolve them without having to define anything else, like the jsconfig file.

I would also like to extend it to other bundles like rollup, vite, etc

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

No branches or pull requests

3 participants