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

On parse failure, keep the old AST #66

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

julienduchesne
Copy link
Member

Also, add a new linesChangedSinceAST attribute to the cache. This new attribute contains all lines of a document which have changed since the AST was last parsed
This allows us to still use the AST when the file is changed (a WIP is a common use-case)
In order to reduce the amount of bad definitions in that case, go-to-definition is only active if the currently targeted line hasn't changed. Otherwise, it's all messed up

While this feature is slightly useful for go-to-definition, it'll be absolutely necessary for the completion feature I'm working on

Also, add a new `linesChangedSinceAST` attribute to the cache. This new attribute contains all lines of a document which have changed since the AST was last parsed
This allows us to still use the AST when the file is changed (a WIP is a common use-case)
In order to reduce the amount of bad definitions in that case, go-to-definition is only active if the currently targeted line hasn't changed. Otherwise, it's all messed up

While this feature is slightly useful for go-to-definition, it'll be absolutely necessary for the completion feature I'm working on
@julienduchesne julienduchesne merged commit c8432b0 into main Sep 6, 2022
@julienduchesne julienduchesne deleted the julienduchesne/keep-old-ast branch September 6, 2022 17:44
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

Successfully merging this pull request may close these issues.

1 participant