diff --git a/package.json b/package.json index 493124b7e5..15ce40c8b7 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,10 @@ }, "args": [ "/debugAdapter", - "/logLevel:Verbose" + "/logLevel:Verbose", + "/hostName:\"Visual Studio Code Host\"", + "/hostProfileId:Microsoft.VSCode", + "/hostVersion:0.5.0" ], "configurationAttributes": { "launch": { @@ -179,7 +182,11 @@ "program": "bin/Microsoft.PowerShell.EditorServices.Host.x86.exe" }, "args": [ - "/debugAdapter" + "/debugAdapter", + "/logLevel:Verbose", + "/hostName:\"Visual Studio Code Host\"", + "/hostProfileId:Microsoft.VSCode", + "/hostVersion:0.5.0" ], "configurationAttributes": { "launch": { @@ -228,6 +235,11 @@ "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." }, + "powershell.enableProfileLoading": { + "type": "boolean", + "default": false, + "description": "If true, causes user and system wide profiles (profile.ps1 and Microsoft.VSCode_profile.ps1) to be loaded into the PowerShell session. This affects IntelliSense and interactive script execution. The debugger is not affected by this setting." + }, "powershell.scriptAnalysis.enable": { "type": "boolean", "default": true, diff --git a/src/main.ts b/src/main.ts index 4e699ffc9e..90cf80c0e1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -63,7 +63,20 @@ export function activate(context: vscode.ExtensionContext): void { // The language server is only available on Windows if (os.platform() == "win32") { - let args = []; + // Get the current version of this extension + var hostVersion = + vscode + .extensions + .getExtension("ms-vscode.PowerShell") + .packageJSON + .version; + + let args = [ + "/hostName:\"Visual Studio Code Host\"", + "/hostProfileId:\"Microsoft.VSCode\"", + "/hostVersion:" + hostVersion + ]; + if (settings.developer.editorServicesWaitForDebugger) { args.push('/waitForDebugger'); } diff --git a/src/settings.ts b/src/settings.ts index 610fd426ae..47bfd8f292 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -18,6 +18,7 @@ export interface IDeveloperSettings { export interface ISettings { useX86Host?: boolean, + enableProfileLoading?: boolean, scriptAnalysis?: IScriptAnalysisSettings, developer?: IDeveloperSettings, } @@ -37,6 +38,7 @@ export function load(myPluginId: string): ISettings { return { useX86Host: configuration.get("useX86Host", false), + enableProfileLoading: configuration.get("enableProfileLoading", false), scriptAnalysis: configuration.get("scriptAnalysis", defaultScriptAnalysisSettings), developer: configuration.get("developer", defaultDeveloperSettings) }