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

Launch: first argument for workspace path no longer reaches extension window #14611

Closed
bpasero opened this issue Oct 27, 2016 · 9 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues important Issue identified as high-priority verified Verification succeeded
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Oct 27, 2016

I am no longer able to launch an extension on a specific workspace. To reproduce:

  • generate an extension
  • open launch.json
  • add a folder to open as first argument

=> the folder is not opened in the window that opens the extension

  • add the folder again so that it shows up as the first two entries in the arguments

=> now the folder is opened

@weinand @isidorn any ideas?

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority debug Debug viewlet, configurations, breakpoints, adapter issues labels Oct 27, 2016
@bpasero bpasero added this to the October 2016 milestone Oct 27, 2016
@bpasero
Copy link
Member Author

bpasero commented Oct 27, 2016

@bpasero
Copy link
Member Author

bpasero commented Oct 27, 2016

I commented out that code and it still reproduces so it must be something else...

@bpasero bpasero assigned joaomoreno and bpasero and unassigned bpasero, weinand and isidorn Oct 27, 2016
@bpasero
Copy link
Member Author

bpasero commented Oct 27, 2016

@joaomoreno this might be a regression from using the shared IEnvironmentService also for the main process. A much easier repro is this:

  • go into the folder of the Electron executable
  • run ./Electron --nolazy someFolder
  • notice that Code refuses to open that folder

Debug adds --nolazy to our startup and somehow as soon as you pass an argument to an app that uses minimist for parsing that is not registered as known argument, things go wrong.

If I add nolazy to our list in https://github.com/Microsoft/vscode/blob/master/src/vs/platform/environment/node/argv.ts#L38 this issue is gone.

Any clue?

@bpasero bpasero changed the title Launch: first argument no longer reaches extension window Launch: first argument for workspace path no longer reaches extension window Oct 27, 2016
@joaomoreno
Copy link
Member

as soon as you pass an argument to an app that uses minimist for parsing that is not registered as known argument

Probably minimist is parsing --nolazy as an option that takes a string instead of as a boolean flag. So, try adding nolazy as a boolean option in here.

@joaomoreno
Copy link
Member

Awesome. Good catch.

@bpasero
Copy link
Member Author

bpasero commented Oct 27, 2016

@joaomoreno yup, added it. Just sucks that we need to be aware of this in the future. I think it would be better if debug adds their arguments maybe as last thing to the list and not first.

@joaomoreno
Copy link
Member

nolazy is a node flag, not a debug flag.

On second thought, the real fix here is to not let Node and Electron arguments reach our system at all. But this is a good quick fix.

@weinand
Copy link
Contributor

weinand commented Oct 27, 2016

I've introduced this issue through this fix #13434
It does not make sense to pass the --nolazy flag here because VS Code controls how the extension host is launched.
@bpasero should I revert this?

@weinand
Copy link
Contributor

weinand commented Oct 27, 2016

I'm no longer adding the --nolazy flag for EH debugging.

@aeschli aeschli added the verified Verification succeeded label Oct 28, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues important Issue identified as high-priority verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants