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

An argument is not getting passed to the VS Code extension host VS Code process #206

Closed
TomasHubelbauer opened this issue May 7, 2020 · 2 comments
Assignees

Comments

@TomasHubelbauer
Copy link
Contributor

  • VSCode Version: 1.45.0
  • OS Version: Windows 10

Steps to Reproduce:

  1. Generate a new VS Code extension
  2. Go to .vscode/launch.json and add --inspect to the list of arguments to pass
  3. Execute npm test to run the extension tests
  4. Observe --inspect lacking in the command output

This makes sense, because the test script invokes /node_modules/vscode/bin/test and completely bypasses the VS Code debugger configuration and the test script does not seem to read it or pass its own command line arguments along onto the VS Code instance it starts:

    var args = [
        testsWorkspace,
        '--extensionDevelopmentPath=' + extensionsFolder,
        '--extensionTestsPath=' + testsFolder,
        '--locale=' + locale,
    ];

Is there another mechanism by which the control host could be started given extra command line arguments? Bonus points for something that works both with F5 to run and debug extensions test and npm test.

Does this issue occur when all extensions are disabled?: Does not apply

@TomasHubelbauer
Copy link
Contributor Author

FWIW I am currently using this as a workaround:

https://github.com/TomasHubelbauer/code-extension-screencast/blob/master/src/test/extension.test.ts#L75

This is specifically what I am looking to replace by a more native mechanism, but I think the broader problem of passing command line arguments to the VS Code extension host is more useful to discuss as if there was one such it would solve my specific issue, too.

@Tyriar Tyriar transferred this issue from microsoft/vscode May 8, 2020
@aeschli
Copy link
Contributor

aeschli commented Jun 5, 2020

Not sure exactly why this ended up in the vscode-generator-code project.

Since a while,/node_modules/vscode/bin/test got extracted to a separate node module vscode-test (https://github.com/microsoft/vscode-test) and got more customizable. It lets you pass in args and if I'm not mistaken that should work for --inspect as well.

Can you check if that solves your problem? If not I suggest to file a enhancement request to microsoft/vscode-test. (or I move the issue there)

Using launch configurations also from outside VSCode is currently not possible. microsoft/vscode#10979 is the issue for that.

@aeschli aeschli closed this as completed Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants