-
Notifications
You must be signed in to change notification settings - Fork 257
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
Dafny language server resolves program character by character (even with option onsave
)
#1448
Comments
@camrein do you know if the LSP server will queue a parsing+resolution task for each I know there is some batching of changes on the client side. I vaguely recall it sends out a didChange if there's no more edits for 200 ms, but since a parse+resolution task may take more than 200 ms, it's still possible that these tasks could get queued on the server. The behavior that I think might be nice is: User does:
Server does:
|
This issue is closely related to dafny-lang/ide-vscode#31.
All document related events (for example change/save/open/close) are synchronous/serial. See for example DidChangeTextDocumentParams. I have the feeling that we have to implement this behavior ourselves. But there are a few challenges we have to keep in mind:
Maybe we could combine it with a debouncing of the automatic verification in a later iteration. |
I'm guessing that if you process the request in a fresh thread then the block is lifted. For example by adding the request data to a thread-safe queue and then letting a worker thread manage it.
One option is to merge consecutive Another option might be to cancel any currently running analysis, including computing diagnostics, as soon as a didChange comes in, so we never do processing on an out of date document state. |
When adding a precondition, say
requires foo.bar(x)
the language server resolves the file for the following versions of that line:f
fo
foo
foo.b
each of which takes a while (maybe about a second each), until finally the program with the full line can be resolved and verification is performed.
This is with the option
onsave
of the VSCode extension.DafnyLS: 3.2.0.30713
VSCode extension: 1.8.0
The text was updated successfully, but these errors were encountered: