"dart language-server" prints text that interferes with LSP if --enable-experiment includes enabled-by-default experiments #51820
Labels
area-dart-cli
Use area-dart-cli for issues related to the 'dart' command like tool.
@CoderDake hit this earlier. In VS Code he had configured
dart.analyzerAdditionalArgs
to include--enable-experiment=records
. After upgrading to a new SDK, all language functionality stopped working but there was no obvious reason why (and no visible error message).In the VS Code developer tools console, this error was printed:
This is coming from VS Code's LSP client. It's detecting invalid protocol traffic, but unfortunately the error is not visible without knowing to go looking for it. Enabling logging showed that this output had been sent:
This comes from here:
sdk/pkg/dartdev/lib/src/experiments.dart
Lines 70 to 71 in 5d6e499
This is a helpful message if the command is being run by a user, but it would be better suppressed when running something like LSP where the output to
stdout
needs to confirm to a protocol, because it's not certain that the tool consuming this (in this case VS Code, but with LSP it could be one of many LSP clients for different editors) will expose the message to the user.The same probably applies to
dart debug-adapter
.Some thoughts:
@bkonyi @bwilkerson any thoughts? This
print
ing isn't new/recent and I suspect not may people will hit it - but without knowing what to look for it could be frustrating to try to track down.The text was updated successfully, but these errors were encountered: