Open EranGrin opened 3 years ago
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!
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.
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
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
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
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'spaths
logic) by extending/creating tsconfig.json aliases automatically. We can change this internally as we have full control of TypeScript server via pluginIt 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
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, π