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

Keep go-to-def responsive even if there's no AST yet (use heuristics in that case) #506

Open
HighCommander4 opened this issue Aug 25, 2020 · 0 comments

Comments

@HighCommander4
Copy link

If go-to-definition is invoked on a file that doesn't have an AST built yet, we currently block on building the AST before sending the response.

As building the AST (preamble) can take multiple seconds (or worse) for large files, this leads to a not-very-responsive experience if you're trying to use go-to-def shortly after opening a file.

Rather than blocking, it might be better to give a heuristic response immediately. We have an existing textual fallback for go-to-def (locateSymbolTextually) which uses index lookup of the word under the cursor. We can create a variant of this that doesn't require an AST at all, and use it.

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

1 participant