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

Ghost diagnostics not correctly updated #4693

Closed
MikaelMayer opened this issue Oct 20, 2023 · 0 comments · Fixed by #4748
Closed

Ghost diagnostics not correctly updated #4693

MikaelMayer opened this issue Oct 20, 2023 · 0 comments · Fixed by #4748
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label makes-mikael-grateful This issue, is fixed, would make Mikael Mayer grateful part: language server Support for LSP in Dafny (server part; client is in ide-vscode repo)

Comments

@MikaelMayer
Copy link
Member

Dafny version

4.3.0

Code to produce this issue

class A {
}


method Test(a: object) {
  if a is A {
  }
}

Command to run and resulting output

Paste the code above in VS Code.
The lines `if a is A {}` are highlighted in ghost correctly.
Now, inside the braces, write
`print "hello";`
Now delete lines 3-5, and press enter 6 times to reproduce the animated screenshot below.

What happened?

9c1b49e0-0a1d-4f3b-8c93-24c8cb11fbc7

What's going on

  • There is no more ghost code in the code, and the language server does not send a notification to the client. Hence, the client does not know that there is no more ghost code and continues to highlight the region of previous ghost code as ghost.
  • You can verify this hypothesis by writing another method that contains ghost code, immediately the ghost code is updated.

What type of operating system are you experiencing the problem on?

Windows

@MikaelMayer MikaelMayer added kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: language server Support for LSP in Dafny (server part; client is in ide-vscode repo) makes-mikael-grateful This issue, is fixed, would make Mikael Mayer grateful labels Oct 20, 2023
keyboardDrummer pushed a commit that referenced this issue Nov 8, 2023
Fixes #4693
I added a test that was previously failing.

<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label makes-mikael-grateful This issue, is fixed, would make Mikael Mayer grateful part: language server Support for LSP in Dafny (server part; client is in ide-vscode repo)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant