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

textDocument/codeAction failed #5541

Closed
keyboardDrummer opened this issue Jun 7, 2024 · 0 comments · Fixed by #5543
Closed

textDocument/codeAction failed #5541

keyboardDrummer opened this issue Jun 7, 2024 · 0 comments · Fixed by #5543
Assignees
Labels
during 1: program development Bad error message or documentation; IDE bug; crash compiling invalid program part: language server Support for LSP in Dafny (server part; client is in ide-vscode repo)

Comments

@keyboardDrummer
Copy link
Member

Exception occurs when typing the last d in the file

// predicate P()
// lemma X() requires 1 == 1 ensures P()

// method Foo() {
//   assert P() by {
//     X();
//   }
//   assert 3 == 3;
//   assert P();
//   assert 2 == 2;
//   if (*) {
//     assert 4 == 4;
//   } else {
//     assert 5 == 5;
//   }
//  assert 7 == 7;
// }

// function F(x: int): int {
//   x + 2
// }

// method Bar() {
//   assert F(2) == 4;
// }

opaque function Pred(x: int): int {
  2 + x
}

method Foo() {
  reveal Pred();
  assert Pred(2) == 4;
}

method
@keyboardDrummer keyboardDrummer added part: language server Support for LSP in Dafny (server part; client is in ide-vscode repo) during 1: program development Bad error message or documentation; IDE bug; crash compiling invalid program labels Jun 7, 2024
@keyboardDrummer keyboardDrummer self-assigned this Jun 7, 2024
keyboardDrummer added a commit that referenced this issue Jun 7, 2024
Fixes #5541

### Description
- Prevent LSP server from crashing on code actions

### How has this been tested?
- Added an LSP test

<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
during 1: program development Bad error message or documentation; IDE bug; crash compiling invalid program 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