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

Remove VS Code dependency from debug adapter #2246

Closed
LinArcX opened this issue Feb 2, 2020 · 4 comments
Closed

Remove VS Code dependency from debug adapter #2246

LinArcX opened this issue Feb 2, 2020 · 4 comments
Labels
in debugger Relates to the debug adapter or process of launching a debug session is non-functional
Milestone

Comments

@LinArcX
Copy link

LinArcX commented Feb 2, 2020

Hi. I'm a neovim user and currently we have an awesome project that brings DAP in vim/neovim universe called: vimspector.

Anyway, tonight i tried to check it out if it possible to debug dart applications with vimspector or not. But me and ben found out that it's impossible due to hard dependency of Dart-Code to vscode:
puremourning/vimspector#4 (comment)

@DanTup DanTup changed the title Make Dart-Code independent of vscode Remove VS Code dependency from debug adapter Feb 3, 2020
@DanTup DanTup added this to the v3.9.0 milestone Feb 3, 2020
@DanTup DanTup added in debugger Relates to the debug adapter or process of launching a debug session is non-functional labels Feb 3, 2020
@DanTup
Copy link
Member

DanTup commented Feb 3, 2020

Thanks - this is definitely a bug! The debug adapters were brought in-process a while back to work around some limitations in VS Code (and ended up with many accidental dependencies on extension code). The plan is to move them back out-of-process (#1876) and those dependencies will need to be removed (there should be lints to enforce this but I think they're on an unmerged branch).

That said, FWIW the debug adapters that live here are written specifically for use in the VS Code extension and make use of custom messages not defined in the DAP protocol so I don't know how compatible they'll be with another DAP client out of the box. If there are minor changes we can make (or accept PRs for) to improve this without interfering with the VS Code functionality, I think that would be reasonable (@jonas-jonas might also be interested in that).

Long-term, it'd be nice to have a standalone DAP (probably written in Dart so it can use the vm service libraries). There's an issue related to this (that you opened 😄) at dart-lang/sdk#35717, though I think initially it could be built as a standaone Dart package.

DanTup added a commit that referenced this issue Feb 3, 2020
@DanTup
Copy link
Member

DanTup commented Feb 3, 2020

I had a quick look and removed a few dependencies but there are two remaining:

  • getLogHeader
  • safeSpawn

These are both currently used directly from the extension as they use some shared global state (safeSpawn reads an environment object to allow overriding env vars, and getLogHeader is a string built to prefix into any log files that has some useful info). All this data should be serialisable so I think should be possible to also move into the args (so the functions can be moved into shared files) but they're less straight-forward than the others.

@DanTup DanTup closed this as completed in a91f139 Mar 24, 2020
@DanTup
Copy link
Member

DanTup commented Mar 24, 2020

I believe I've removed the last of these dependencies. Please let me know if you still hit this issue and feel free to open new issues if you hit other problems. Running this debug adapter outside VS Code is not strictly supported, but if there are minor issues preventing it I'm happy to take a look. Thanks!

@DanTup
Copy link
Member

DanTup commented Mar 24, 2020

Scratch that - I still see some issues... Working on them though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session is non-functional
Projects
None yet
Development

No branches or pull requests

2 participants