This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Given a file structure like this:
├── main.js
└── util
└── stuff.js
And with files something like this:
// stuff.js
export function add(a, b) {
return a b;
}
// main.js
import * as maths from './util/stuff.js'
maths.add(1, 2)
With the .js file extension, the language server is able to pick up on function signature and any types via JSDoc for type checking and completion, but when using Go To Definition on the add
call in main, it loads forever. Switching files to .ts makes Go To Definition work as expected.
Is there some difference in the way the VSCode language server handles these cases that causes it to not work correctly. It is at most able to "Go To Definition" of the maths object that is imported. I tried this with a LSP plugin in Sublime Text and it is able to properly go to the definition.
Post Details
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/vscode/comm...