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

Report errors that occur in the project file, in the IDE as well #4539

Merged

Conversation

keyboardDrummer
Copy link
Member

@keyboardDrummer keyboardDrummer commented Sep 12, 2023

Changes

  • Report errors that occur in the project file, in the IDE as well
  • Show a hint in the project file that shows which files the project references

Testing

  • Added two unit tests

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Copy link
Member

@MikaelMayer MikaelMayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds great to have. Can you please add a docs/dev/news entry if appropriate?

Source/DafnyDriver/Commands/CommandRegistry.cs Outdated Show resolved Hide resolved
Source/DafnyCore/Options/DafnyProject.cs Outdated Show resolved Hide resolved
MikaelMayer
MikaelMayer previously approved these changes Sep 13, 2023
Copy link
Member

@MikaelMayer MikaelMayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One non-blocking comment. It's great that we can now debug the project file from the IDE. If I change the project file, I assumed it's picked up again as soon as I modify the file, correct?

}
}

var verificationDocumentItem = CreateTestDocument("class X {does not parse", $"AssertNoDiagnosticsAreComing{fileIndex++}.dfy");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this non-parsing file :-)

});
var hideReport = await diagnosticsReceiver.AwaitNextNotificationAsync(cancellationToken.Value);
AssertM.Equal(verificationDocumentItem.Uri, hideReport.Uri,
"2) Unexpected diagnostics were received whereas none were expected:\n" +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is 2) there?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea. This line is copy+pasted.

@keyboardDrummer
Copy link
Member Author

One non-blocking comment. It's great that we can now debug the project file from the IDE. If I change the project file, I assumed it's picked up again as soon as I modify the file, correct?

That requires a change in the VSCode extension, because currently the extension only sends .dfy file didOpen and didChange event to the server, so for the dfyconfig.toml only the on-disk state is used by the server.

I plan to make that change but it is independent from this one.

Copy link
Member

@MikaelMayer MikaelMayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@@ -78,7 +78,7 @@ ILogger<ITextDocumentLoader> logger
var projectDirectory = Path.GetDirectoryName(projectPath)!;
var filesMessage = string.Join("\n", compilation.RootUris.Select(uri => Path.GetRelativePath(projectDirectory, uri.LocalPath)));
if (filesMessage.Any()) {
program.Reporter.Info(MessageSource.Parser, compilation.Project.StartingToken, "Files referenced by project are:\n" + filesMessage);
program.Reporter.Info(MessageSource.Parser, compilation.Project.StartingToken, "Files referenced by project are:" + Environment.NewLine + filesMessage);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah thanks for making sure Windows tests don't break!

@keyboardDrummer keyboardDrummer merged commit b575043 into dafny-lang:master Sep 15, 2023
@keyboardDrummer keyboardDrummer deleted the reportProjectFileErrorsInIde branch September 15, 2023 11:43
TaBo2410 added a commit that referenced this pull request Sep 20, 2023
…iment-trsplitexpr

* commit '86840e6b14386c1e88480854dd8ce64ad17cb2ff':
  Map eq range (#4567)
  Fix: Declarations with {:only} ensure that other declarations aren't displayed as verified in the gutter icons (#4433)
  Fix caching of export declarations (#4556)
  Do not return exceptions when doing hover in a program with parse errors (#4557)
  Proof dependency warnings (#4542)
  [Test Generation] Reduce memory footprint by reusing the same Boogie program for multiple test generation queries (#4530)
  Fix a variety of bugs in Rust backend based on ESDK testing (#4538)
  Checker for .Values and .Items on maps (#4551)
  feat: Allow more assumptions in library backend (#4545)
  feat: Attributes on reads clauses (#4554)
  Fix gutter icons fields (#4549)
  Report errors that occur in the project file, in the IDE as well (#4539)
  Switch to ubuntu-20.04 for the refman build (#4555)
keyboardDrummer added a commit that referenced this pull request Sep 26, 2023
### Changes
Report errors that occur in the project file, in the IDE as well

### Testing
Added a unit 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants