-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Red knot: Add file watching and cancellation #11127
Conversation
CC: @BurntSushi for the case I do anything horrible inside of |
|
Okay, I think what I want to do tomorrow is:
Edit: I think I should also be able to move the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! Sorry I didn't see this / review it sooner so you could have landed it today.
I didn't carefully follow every detail in main.rs
; hoping that as you mentioned some of that will get broken up and be a little easier to follow.
b8d42b7
to
9f29299
Compare
All good. I'm not in a rush. Having the review next morning is still a perfectly quick review and I should have tagged you as reviewer! Thank you |
Summary
Okay, I must admit this PR does more than what the title says.
The changes not covered by the title are:
lint_syntax
method that performs two checks. It mainly serves to see if file changes are correctly picked up. The implemented checks are:Source
to useSourceKind
instead of always anArc<str>
. This is necessary to support IPython notebooks. There's absolutely no good reason why this is part of this PR and I'm happy to split it out if people find that useful. I think it doesn't matter much.The main change of the PR is that red-knot now accepts an "entry path" and runs the analysis in watch mode. This is interesting because it tackles a few challenges:
program
after all scheduled analysis have been completedI'm undecided if the ultimate goal should be that this code is isolated and reused across the LSP, CLI watch mode and regular CLI. It would certainly be nice, but I could also see this be part of the "Host" specific code, and each host should have as much flexibility as possible to implement the most efficient scheduling for its needs.
Future Improvements:
Test plan
I ran the CLI locally, then made changes to the test file by adding a new single quoted string and I then verified that the console showed the new diagnostic.