Commit 2df2f9d
fix: use DI for vscode API in nodeLauncher instead of direct import (#2369)
* fix: use DI for vscode API in nodeLauncher instead of direct import
nodeLauncher.ts was directly importing 'vscode', which causes both a
build error (esbuild can't resolve it) and a runtime error (module
doesn't exist outside VS Code) for standalone server bundles like
vsDebugServerBundle.
Switch to the established pattern used elsewhere in the codebase
(e.g. defaultBrowserProvider.ts, nodeBinaryProvider.ts):
- Use 'import type' so no require() is emitted at runtime
- Inject the vscode API via @optional() @Inject(VSCodeApi)
- Guard usage with an undefined check for non-VS Code contexts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update src/targets/node/nodeLauncher.ts
Co-authored-by: Connor Peet <connor@peet.io>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Connor Peet <connor@peet.io>1 parent 031a60a commit 2df2f9d
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
313 | 315 | | |
314 | 316 | | |
315 | 317 | | |
316 | | - | |
| 318 | + | |
317 | 319 | | |
318 | 320 | | |
319 | 321 | | |
| |||
0 commit comments