Dart-code: Reduce reliance on variables passed to debug adapters

Created on 10 Sep 2020  ·  3Comments  ·  Source: Dart-Code/Dart-Code

There are many variables passed into the launchRequest like dartVersion and flutterVersion that are only supplied by VS Code. In order to make the Debug Adapter more reusable, these things should be computed inside the debug adapter. All variables should also have sensible defaults.

in debugger is enhancement

All 3 comments

@ericdallo FYI - as part of this work, I'm removing dartPath, flutterPath, pubSnapshotPath, dartVersion, flutterVersion from the launch arguments for the debug adapter, and replacing them with just dartSdkPath and flutterSdkPath. You're currently setting some of these here.

When most of these were added, VS Code was the only consumer so it was convenient to just pass them in. However, it's made using the debug adapter more complicated when many of the values could be computed by the debug adapter. This should simplify things a little (I'm also reviewing the defaults and making sure most of the values are entirely optional).

(Note: Use of this debug adapter by non-VS Code clients isn't "officially" supported, though I would like to ensure it works and is not too burdensome! 🙂).

Thank you very much @DanTup, I totally agree!
I''ll update lsp-dart and remove the unnecessary variables :)

Sorry for the delay @DanTup , I just bumped lsp-dart to use Dart-Code debugger extension 3.17.0 removing the unused variables replaced by dartSdkPath and flutterSdkPath, thank you!
https://github.com/emacs-lsp/lsp-dart/commit/a2c30213326cbac11d805e94c770eec76d0e3624

Was this page helpful?
0 / 5 - 0 ratings