-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Enable F12 navigation in vscode #72
Enable F12 navigation in vscode #72
Conversation
As specified in this doc https://code.visualstudio.com/docs/languages/jsconfig#_using-webpack-aliases In order for vscode to understand webpack aliases, it needs a little help. In order to keep the DRY (don't repeat yourself), I "moved" the aliases definition in the static json file.
This is a huge deal for VSCode, because auto completion, refactoring, Intellisense and all vscode incoming features wouldn't work without this. I would add these lines to the
This |
to src/ and tests/
I agree, I just don't know if @chrisvfritz wants to keep the boilerplate editor agnostic. |
And I just found this issue, vetur is not a friend of jsconfig I will try a bit harder. |
By default, vscode does not navigate to `.vue` files. Once again, let us help it a little and add navigation using a vscode plugin: https://marketplace.visualstudio.com/items?itemName=dariofuzinato.vue-peek
I've been using |
I agree this is a great improvement! I just tried to implement this in a way that still allows programmatic generation of aliases with @elevatebart @frandiox @saintplay What do you think of this commit? |
Closing for now, since this has now been implemented, but this thread is still open to discussion. 🙂 |
Hey @chrisvfritz, you found a great way to keep backward compatibility. I love it. I do not enjoy having both generated and versionned code in It is way to complicated for something that virtually never changes. Thank you. |
@elevatebart You give me too much credit. 😅 What I implemented would actually overwrite anyone's existing jsconfig, based on what's in So right now, any static config for What do you think? |
My ideal solution is not ideal. The core idea goes as follows: Since |
@chrisvfritz, I updated the branch with the last of my reflexions. I as well updated the documentation. I can't wait to read your feedback |
@elevatebart I definitely do want to keep the I updated what I had to use a template as you suggested. What do you think now? |
@chrisvfritz I like it a lot. I still have a question:
I see that it's not generated in I have another solution to suggest that would keep the I have illustrated this last solution in this branch. What do you think? |
Agreed! I'll add that. 🙂
That's a nice compromise, but it would still be difficult to lose the JS file. I've run into rare cases where some aliases should point to different paths depending on the environment. We could possibly do this work in the Ultimately, since I and others are using this for a large variety of projects, I think I have to value adaptable patterns over perhaps more elegant ones. Does that make sense? |
Makes perfect sense. Especially the consistency part. Glad I could be of help a little ;-) |
As specified in this doc, in order for vscode to understand webpack aliases, it needs a little help.
In order to keep the code as DRY (don't repeat yourself) as possible,
I moved the aliases definition in the static
jsconfig.json
file.