Skip to content

Add host bitness selection from VSCode UI. #55

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

Closed
daviwil opened this issue Dec 24, 2015 · 11 comments
Closed

Add host bitness selection from VSCode UI. #55

daviwil opened this issue Dec 24, 2015 · 11 comments
Assignees
Labels
Issue-Enhancement A feature request (enhancement).
Milestone

Comments

@daviwil
Copy link
Contributor

daviwil commented Dec 24, 2015

As of the following pull request, PowerShell Editor Services now has both x86 and x64 hosts:

PowerShell/PowerShellEditorServices#92

We should add a setting in the VS Code extension so that the user can select their desired host bitness.

@daviwil daviwil added the Issue-Enhancement A feature request (enhancement). label Dec 24, 2015
@daviwil daviwil added this to the 0.4.0 milestone Dec 24, 2015
@rkeithhill
Copy link
Contributor

While the actual support for 64bit and 32bit debug hosts will be in 0.4.0, we will require VSCode changes to support the "selection" of host via the VSCode UI. That support won't be in the upcoming 0.10.7 drop of VSCode. So the package.json update to support this will have to wait until the 0.5.0 drop (presumably by then VSCode will have UI support for this selection).

But we should still do this for 0.4.0:

We should add a setting in the VS Code extension so that the user can select their desired host bitness.

@rkeithhill rkeithhill modified the milestones: 0.5.0, 0.4.0 Feb 3, 2016
@rkeithhill rkeithhill changed the title Add host bitness option Add host bitness selection from VSCode UI. Feb 3, 2016
@daviwil
Copy link
Contributor Author

daviwil commented Feb 3, 2016

👍

@rkeithhill rkeithhill self-assigned this Feb 3, 2016
rkeithhill added a commit to rkeithhill/vscode-powershell that referenced this issue Feb 4, 2016
…bitness.

This change adds a new debugger configuration to the package.json file.  The user can simply change the debug type from 'PowerShell' to 'PowerShell x86' in their launch.json file to do 32-bit debugging.  Also, when they open a folder that doesn't have a .vscode\launch.json file, when they go to create that file, they can pick between 'PowerShell' and 'PowerShell x86'.  Of course on 32-bit OSs the 'PowerShell x86' selection is redundant with 'PowerShell'.  Oh well.
daviwil added a commit that referenced this issue Feb 4, 2016
…4-debugger

Addresses issue #55 for 0.4.0 release to select debug host bitness.
@daviwil
Copy link
Contributor Author

daviwil commented Mar 8, 2016

I guess the only thing left to do here is have a setting for the language service so that it can launch the x86 host if that's what the user wants?

@rkeithhill
Copy link
Contributor

One way to do this (and it is something I experimented with) is to modify the package.json initial configuration like so:

                "initialConfigurations": [
                    {
                        "name": "PowerShell",
                        "type": "PowerShell",
                        "request": "launch",
                        "program": "${file}",
                        "args": [],
                        "cwd": "${file}"
                    },
                    {
                        "name": "PowerShell x86",
                        "type": "PowerShell x86",
                        "request": "launch",
                        "program": "${file}",
                        "args": [],
                        "cwd": "${file}"
                    }
                ]

This has to be done for both debugger configurations. This will give you a choice of which debugger in the Debug viewlet's dropdown.

The problem I ran into is that when you initially select a debugger - either PowerShell or PowerShell x86 - the initially selected debugger in the dropdown didn't seem to be deterministic and not always the right one. We could go this route, as the mitigation is simple - just select the right debugger from the drop down. Thoughts?

@daviwil
Copy link
Contributor Author

daviwil commented Mar 9, 2016

Yeah having the additional x86 configuration included in the 64-bit initialConfigurations list might be nice to simplify things for the user. For the x86 default configuration I think we'd still want the single configuration.

My question in this case is more about having a setting for the language service to be run with the x86 if necessary. I think this may be necessary for the editing experience in the cases where some module or configuration is only available in x86 mode.

@rkeithhill
Copy link
Contributor

So the language service can cause modules to get imported to support completion text? If so, then yeah, users would need to specify which language service host to use (32-bit or 64-bit).

@daviwil
Copy link
Contributor Author

daviwil commented Mar 9, 2016

Not sure if they get imported, but if a module exports commands they'll show up in completion lists. On my machine I have the Azure Service Fabric SDK installed which comes with a binary PowerShell module that's only available for 64-bit PowerShell. If I launch the x86 PowerShell console I don't get tab completion for their cmdlets but in the 64-bit console they get completed.

@daviwil
Copy link
Contributor Author

daviwil commented Mar 9, 2016

I'm about to add the following setting:

                "powershell.developer.editorServicesHostArch": {
                    "type": "string",
                    "default": "Any",
                    "description": "Specifies the architecture to use for the PowerShell Editor Services host.  Possible values are 'Any' (use the OS's architecture) or 'x86' (force x86 architecture on 64-bit OS)."
                },

That seems like possibly the wrong way to do it, though. Would it be better to have this instead?

                "powershell.use32BitHost": {
                    "type": "boolean",
                    "default": "false",
                    "description": "If true, causes the 32-bit language service to be used on 64-bit Windows.  On 32-bit Windows this setting has no effect.  This setting does not affect the debugger which has its own architecture configuration."
                },

@rkeithhill
Copy link
Contributor

I like the second better but perhaps it should be useX86Host instead? Right now the debuggers are referred to as PowerShell and PowerShell x86. Should we try to make the names somewhat consistent or no? The thing I note about PowerShell is that the 32-bit version is referred to as Windows PowerShell (x86) in the start menu.

@daviwil
Copy link
Contributor Author

daviwil commented Mar 9, 2016

Sounds good, I'll go with that.

daviwil added a commit that referenced this issue Mar 10, 2016
This change adds a new 'useX86Host' setting for the language service which
causes the 32-bit host to be launched in 64-bit Windows.

Part of the solution for #55.
daviwil added a commit that referenced this issue Mar 10, 2016
This change adds a new 'useX86Host' setting for the language service which
causes the 32-bit host to be launched in 64-bit Windows.

Part of the solution for #55.
@daviwil
Copy link
Contributor Author

daviwil commented Mar 10, 2016

Pretty sure this one is done now.

@daviwil daviwil closed this as completed Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

2 participants