Feat: add incremental reparsing, incremental relinting, and file watching #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds incremental relinting, incremental reparsing, and file watching.
Incremental reparsing is calculating what changes occurred in the file and only parsing the least amount of text we need. This is achieved through two methods:
I am not certain of its stability yet and i am sure there are some weird cases in which it fails or parses incorrectly which needs to be sorted out. The reparser needs some tests too.
To test this simply clone the branch and then use
cargo run -- ./glob/pattern -w
which will watch the already linted files for changes and try to lint them again with incremental reparsing.I would also like to add an
#[incremental_safe]
macro which marks if a rule relies on a single node and only has to be run on the specific nodes that have been changed, this is not the case for most rules however.