-
Notifications
You must be signed in to change notification settings - Fork 263
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
Conversation
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) { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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?
@@ -52,10 +52,17 @@ DafnyOptions options | |||
|
|||
cancellationToken.ThrowIfCancellationRequested(); | |||
|
|||
if (engine.Options.PrintFile != null) { | |||
var moduleCount = Translator.VerifiableModules(program).Count(); | |||
foreach (var t in translated) { |
There was a problem hiding this comment.
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
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.