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

Feat: Support for --bprint in language server. #4206

Merged
merged 13 commits into from
Jul 10, 2023

Conversation

MikaelMayer
Copy link
Member

I add this as a way to simplify boogie debugging, especially in cases when VSCode is not consistent with the command-line like in #4205

I did not add any test for that as it's meant for Dafny development only, but I tested it manually. I borrowed the code from the driver.
Should I still list it as a feature?

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

I add this as a way to simplify boogie debugging, especially in cases when VSCode is not consistent with the command-line like in #4205

I did not add any test for that as it's meant for Dafny development only, but I tested it manually. I borrowed the code from the driver.
@@ -55,6 +56,12 @@ DafnyOptions options
return translated.SelectMany(t => {
var (_, boogieProgram) = t;
var results = engine.GetImplementationTasks(boogieProgram);
if (engine.Options.PrintFile != null) {
Copy link
Member

Choose a reason for hiding this comment

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

I would put this in a separate traversal outside of the SelectMany.

if (engine.Options.PrintFile) {
  var nmodules = Translator.VerifiableModules(program).Count();
  foreach(var boogieProgram in translated) {
    ..
  }
}

@@ -42,6 +42,7 @@ DafnyOptions options
CancellationToken cancellationToken) {
var program = document.Program;
var errorReporter = (DiagnosticErrorReporter)program.Reporter;
var nmodules = Translator.VerifiableModules(program).Count();
Copy link
Member

Choose a reason for hiding this comment

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

Can you give the introduced variables fuller names?

@MikaelMayer MikaelMayer self-assigned this Jun 27, 2023
@@ -52,10 +52,17 @@ DafnyOptions options

cancellationToken.ThrowIfCancellationRequested();

if (engine.Options.PrintFile != null) {
var moduleCount = Translator.VerifiableModules(program).Count();
foreach (var t in translated) {
Copy link
Member

Choose a reason for hiding this comment

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

You can immediately deconstruct the tuple here, so you can better names than t and Item1 and Item2

keyboardDrummer
keyboardDrummer previously approved these changes Jul 3, 2023
@keyboardDrummer keyboardDrummer enabled auto-merge (squash) July 3, 2023 10:38
@keyboardDrummer keyboardDrummer merged commit f4b7ccd into master Jul 10, 2023
@keyboardDrummer keyboardDrummer deleted the feat-bprint-language-server branch July 10, 2023 09:07
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