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

Go to is not working if variable is not access directly (JavaScript) #44

Open
Alexsey opened this issue Sep 10, 2019 · 3 comments
Open

Comments

@Alexsey
Copy link

Alexsey commented Sep 10, 2019

  1. Create a .env file
USER = 'Aaron'
  1. Create index.js file
const user = process.env.USER

Move caret to USER and press Ctrl + B (Declaration or Usages) - the .env would be opened, just as expected

  1. Now change code to
const env = process.env
const user = env.USER

Move caret to USER and press Ctrl + B (Declaration or Usages) - the caret would be moved to process.env. But it should move to .env file, just like in point 2, because the code is actually the same

  1. Now change code to
const {env} = process
const user = env.USER

The USER is unresolved, Ctrl + B is not working at all. But it should be resolved, and Ctrl + B should work the same as in point 2, because the code is actually the same

@adelf
Copy link
Collaborator

adelf commented Sep 10, 2019

Hi, @Alexsey
That's true. Current implementation of completion and Go to declaration in JavaScript is very simple. It just tries to autocomplete all process.env.* calls. I'll do some research, maybe I could make it more smart.

@Alexsey
Copy link
Author

Alexsey commented Sep 10, 2019

Thank you, that would be really cool!

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
@adelf @Alexsey and others