From 0ad7a0686341582bcbc7d0babb71727b332800a0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2019 11:15:21 -0700 Subject: [PATCH 001/166] Bump mocha-junit-reporter from 1.23.0 to 1.23.1 (#2095) Bumps [mocha-junit-reporter](https://github.com/michaelleeallen/mocha-junit-reporter) from 1.23.0 to 1.23.1. - [Release notes](https://github.com/michaelleeallen/mocha-junit-reporter/releases) - [Commits](https://github.com/michaelleeallen/mocha-junit-reporter/compare/v1.23.0...v1.23.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7343638e42..1f95a6be07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1345,9 +1345,9 @@ } }, "mocha-junit-reporter": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-1.23.0.tgz", - "integrity": "sha512-pmpnEO4iDTmLfrT2RKqPsc5relG4crnDSGmXPuGogdda27A7kLujDNJV4EbTbXlVBCZXggN9rQYPEWMkOv4AAA==", + "version": "1.23.1", + "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-1.23.1.tgz", + "integrity": "sha512-qeDvKlZyAH2YJE1vhryvjUQ06t2hcnwwu4k5Ddwn0GQINhgEYFhlGM0DwYCVUHq5cuo32qAW6HDsTHt7zz99Ng==", "dev": true, "requires": { "debug": "^2.2.0", diff --git a/package.json b/package.json index b2fca99db9..98d0b37466 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@types/node": "~10.11.0", "@types/rewire": "^2.5.28", "mocha": "~5.2.0", - "mocha-junit-reporter": "~1.23.0", + "mocha-junit-reporter": "~1.23.1", "mocha-multi-reporters": "~1.1.7", "rewire": "~4.0.1", "tslint": "~5.18.0", From 1acdee9ebb1f66d267538153b6b7f4e23e1c836a Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Sun, 28 Jul 2019 11:24:10 -0600 Subject: [PATCH 002/166] Implement #1611 - provide dynamic debug config (#2084) * Address PR comments, change to single promptClean up debug configuration snippet names & descriptions. Remove Launch Pester Tests debug config snippet. The Launch Scriptsnippet gives an example of invoking Pester plus we have code lens to debug Pester tests. * Remove w/Args prompt debug config snippet * Switch to int id check in provideDebugConfig * Address PR feedback, remove path module as it wasn't being used --- package.json | 119 +++++------------------------------ src/features/DebugSession.ts | 91 +++++++++++++++++++++++++-- 2 files changed, 104 insertions(+), 106 deletions(-) diff --git a/package.json b/package.json index 98d0b37466..b90f36e348 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ }, "main": "./out/src/main", "activationEvents": [ + "onDebugInitialConfigurations", "onDebugResolve:powershell", "onLanguage:powershell", "onCommand:PowerShell.NewProjectFromTemplate", @@ -66,6 +67,11 @@ "test": "node ./node_modules/vscode/bin/test" }, "contributes": { + "breakpoints": [ + { + "language": "powershell" + } + ], "viewsContainers": { "activitybar": [ { @@ -311,11 +317,6 @@ { "type": "PowerShell", "label": "PowerShell", - "enableBreakpointsFor": { - "languageIds": [ - "powershell" - ] - }, "program": "./out/src/debugAdapter.js", "runtime": "node", "variables": { @@ -329,70 +330,39 @@ "configurationSnippets": [ { "label": "PowerShell: Launch Current File", - "description": "Launch current file (in active editor window) under debugger", + "description": "Launch and debug the file in the currently active editor window", "body": { "name": "PowerShell Launch Current File", "type": "PowerShell", "request": "launch", "script": "^\"\\${file}\"", - "args": [], - "cwd": "^\"\\${file}\"" - } - }, - { - "label": "PowerShell: Launch Current File in Temporary Console", - "description": "Launch current file (in active editor window) under debugger in a temporary Integrated Console.", - "body": { - "name": "PowerShell Launch Current File in Temporary Console", - "type": "PowerShell", - "request": "launch", - "script": "^\"\\${file}\"", - "args": [], - "cwd": "^\"\\${file}\"", - "createTemporaryIntegratedConsole": true - } - }, - { - "label": "PowerShell: Launch Current File w/Args Prompt", - "description": "Launch current file (in active editor window) under debugger, prompting first for script arguments", - "body": { - "name": "PowerShell Launch Current File w/Args Prompt", - "type": "PowerShell", - "request": "launch", - "script": "^\"\\${file}\"", - "args": [ - "^\"\\${command:SpecifyScriptArgs}\"" - ], "cwd": "^\"\\${file}\"" } }, { "label": "PowerShell: Launch Script", - "description": "Launch specified script or path to script under debugger", + "description": "Launch and debug the specified file or command", "body": { - "name": "PowerShell Launch ${Script}", + "name": "PowerShell Launch Script", "type": "PowerShell", "request": "launch", - "script": "^\"\\${workspaceFolder}/${Script}\"", - "args": [], + "script": "^\"enter path or command to execute e.g.: \\${workspaceFolder}/src/foo.ps1 or Invoke-Pester\"", "cwd": "^\"\\${workspaceFolder}\"" } }, { - "label": "PowerShell: Pester Tests", - "description": "Invokes Pester tests under debugger", + "label": "PowerShell: Interactive Session", + "description": "Debug commands executed from the Integrated Console", "body": { - "name": "PowerShell Pester Tests", + "name": "PowerShell Interactive Session", "type": "PowerShell", "request": "launch", - "script": "Invoke-Pester", - "args": [], - "cwd": "^\"\\${workspaceFolder}\"" + "cwd": "" } }, { "label": "PowerShell: Attach to PowerShell Host Process", - "description": "Open host process picker to select process to attach debugger to", + "description": "Attach the debugger to a running PowerShell Host Process", "body": { "name": "PowerShell Attach to Host Process", "type": "PowerShell", @@ -400,16 +370,6 @@ "runspaceId": 1 } }, - { - "label": "PowerShell: Interactive Session", - "description": "Start interactive session (Debug Console) under debugger", - "body": { - "name": "PowerShell Interactive Session", - "type": "PowerShell", - "request": "launch", - "cwd": "" - } - }, { "label": "PowerShell: Attach Interactive Session Runspace", "description": "Open runspace picker to select runspace to attach debugger to", @@ -430,7 +390,7 @@ }, "args": { "type": "array", - "description": "Command line arguments to pass to the PowerShell script.", + "description": "Command line arguments to pass to the PowerShell script. Specify \"${command:SpecifyScriptArgs}\" if you want to be prompted for the args.", "items": { "type": "string" }, @@ -480,52 +440,7 @@ } } }, - "initialConfigurations": [ - { - "name": "PowerShell Launch Current File", - "type": "PowerShell", - "request": "launch", - "script": "${file}", - "args": [], - "cwd": "${file}" - }, - { - "name": "PowerShell Launch Current File in Temporary Console", - "type": "PowerShell", - "request": "launch", - "script": "${file}", - "args": [], - "cwd": "${file}", - "createTemporaryIntegratedConsole": true - }, - { - "name": "PowerShell Launch Current File w/Args Prompt", - "type": "PowerShell", - "request": "launch", - "script": "${file}", - "args": [ - "${command:SpecifyScriptArgs}" - ], - "cwd": "${file}" - }, - { - "name": "PowerShell Attach to Host Process", - "type": "PowerShell", - "request": "attach" - }, - { - "name": "PowerShell Interactive Session", - "type": "PowerShell", - "request": "launch", - "cwd": "" - }, - { - "name": "PowerShell Attach Interactive Session Runspace", - "type": "PowerShell", - "request": "attach", - "processId": "current" - } - ] + "initialConfigurations": [] } ], "configuration": { diff --git a/src/features/DebugSession.ts b/src/features/DebugSession.ts index 64826ca90e..4c092f2f6e 100644 --- a/src/features/DebugSession.ts +++ b/src/features/DebugSession.ts @@ -4,7 +4,7 @@ import vscode = require("vscode"); import { CancellationToken, DebugConfiguration, DebugConfigurationProvider, - ExtensionContext, ProviderResult, WorkspaceFolder } from "vscode"; + ExtensionContext, WorkspaceFolder } from "vscode"; import { LanguageClient, NotificationType, RequestType } from "vscode-languageclient"; import { IFeature } from "../feature"; import { getPlatformDetails, OperatingSystem } from "../platform"; @@ -42,6 +42,89 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider })); } + public async provideDebugConfigurations( + folder: WorkspaceFolder | undefined, + token?: CancellationToken): Promise { + + const launchCurrentFileId = 0; + const launchScriptId = 1; + const interactiveSessionId = 2; + const attachHostProcessId = 3; + + const debugConfigPickItems = [ + { + id: launchCurrentFileId, + label: "Launch Current File", + description: "Launch and debug the file in the currently active editor window", + }, + { + id: launchScriptId, + label: "Launch Script", + description: "Launch and debug the specified file or command", + }, + { + id: interactiveSessionId, + label: "Interactive Session", + description: "Debug commands executed from the Integrated Console", + }, + { + id: attachHostProcessId, + label: "Attach", + description: "Attach the debugger to a running PowerShell Host Process", + }, + ]; + + const launchSelection = + await vscode.window.showQuickPick( + debugConfigPickItems, + { placeHolder: "Select a PowerShell debug configuration" }); + + if (launchSelection.id === launchCurrentFileId) { + return [ + { + name: "PowerShell: Launch Current File", + type: "PowerShell", + request: "launch", + script: "${file}", + cwd: "${file}", + }, + ]; + } + + if (launchSelection.id === launchScriptId) { + return [ + { + name: "PowerShell: Launch Script", + type: "PowerShell", + request: "launch", + script: "enter path or command to execute e.g.: ${workspaceFolder}/src/foo.ps1 or Invoke-Pester", + cwd: "${workspaceFolder}", + }, + ]; + } + + if (launchSelection.id === interactiveSessionId) { + return [ + { + name: "PowerShell: Interactive Session", + type: "PowerShell", + request: "launch", + cwd: "", + }, + ]; + } + + // Last remaining possibility is attach to host process + return [ + { + name: "PowerShell: Attach to PowerShell Host Process", + type: "PowerShell", + request: "attach", + runspaceId: 1, + }, + ]; + } + // DebugConfigurationProvider method public async resolveDebugConfiguration( folder: WorkspaceFolder | undefined, @@ -161,13 +244,13 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider } if ((currentDocument.languageId !== "powershell") || !isValidExtension) { - let path = currentDocument.fileName; + let docPath = currentDocument.fileName; const workspaceRootPath = vscode.workspace.rootPath; if (currentDocument.fileName.startsWith(workspaceRootPath)) { - path = currentDocument.fileName.substring(vscode.workspace.rootPath.length + 1); + docPath = currentDocument.fileName.substring(vscode.workspace.rootPath.length + 1); } - const msg = "PowerShell does not support debugging this file type: '" + path + "'."; + const msg = "PowerShell does not support debugging this file type: '" + docPath + "'."; vscode.window.showErrorMessage(msg); return; } From e410effa5edd3e4081806dcefdbdab8f4ebd4677 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2019 09:13:59 -0700 Subject: [PATCH 003/166] Bump vsce from 1.65.0 to 1.66.0 (#2107) Bumps [vsce](https://github.com/Microsoft/vsce) from 1.65.0 to 1.66.0. - [Release notes](https://github.com/Microsoft/vsce/releases) - [Commits](https://github.com/Microsoft/vsce/compare/v1.65.0...v1.66.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1f95a6be07..f1279ddbbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2077,9 +2077,9 @@ } }, "vsce": { - "version": "1.65.0", - "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.65.0.tgz", - "integrity": "sha512-1bGyeoaxjhNVz9fVAqUzGWc1e5CxsxZFpVSnS/anRVyZju0y4DJCPi685WkBsRYU/lfp3AI1smpatuSfb2Lllg==", + "version": "1.66.0", + "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.66.0.tgz", + "integrity": "sha512-Zf4+WD4PhEcOr7jkU08SI9lwFqDhmhk73YOCGQ/tNLaBy+PnnX4eSdqj9LdzDLuI2dsyomJLXzDSNgxuaInxCQ==", "dev": true, "requires": { "azure-devops-node-api": "^7.2.0", diff --git a/package.json b/package.json index b90f36e348..82755c2979 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "rewire": "~4.0.1", "tslint": "~5.18.0", "typescript": "~3.5.2", - "vsce": "~1.65.0", + "vsce": "~1.66.0", "vscode": "~1.1.35" }, "extensionDependencies": [ From d18bc49fac071c071af92eefa2b3c8d60514aed7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2019 14:29:50 -0700 Subject: [PATCH 004/166] Bump typescript from 3.5.2 to 3.5.3 (#2090) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.5.2 to 3.5.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v3.5.2...v3.5.3) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index f1279ddbbc..e384dd163d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2011,9 +2011,9 @@ "dev": true }, "typescript": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.2.tgz", - "integrity": "sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", + "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", "dev": true }, "uc.micro": { diff --git a/package.json b/package.json index 82755c2979..d331ce5f67 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "mocha-multi-reporters": "~1.1.7", "rewire": "~4.0.1", "tslint": "~5.18.0", - "typescript": "~3.5.2", + "typescript": "~3.5.3", "vsce": "~1.66.0", "vscode": "~1.1.35" }, From 2335806b2358c60c8bbdb16a2f23fe756144ed97 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2019 19:33:26 -0700 Subject: [PATCH 005/166] Bump vscode from 1.1.35 to 1.1.36 (#2123) Bumps [vscode](https://github.com/Microsoft/vscode-extension-vscode) from 1.1.35 to 1.1.36. - [Release notes](https://github.com/Microsoft/vscode-extension-vscode/releases) - [Commits](https://github.com/Microsoft/vscode-extension-vscode/compare/v1.1.35...v1.1.36) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 32 ++++++++++++++++---------------- package.json | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index e384dd163d..92efbc65e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -932,9 +932,9 @@ }, "dependencies": { "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -1035,12 +1035,12 @@ } }, "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", + "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", "dev": true, "requires": { - "agent-base": "^4.1.0", + "agent-base": "^4.3.0", "debug": "^3.1.0" } }, @@ -1556,9 +1556,9 @@ "dev": true }, "psl": { - "version": "1.1.33", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.33.tgz", - "integrity": "sha512-LTDP2uSrsc7XCb5lO7A8BI1qYxRe/8EqlRvMeEl6rsnYAqDOl8xHR+8lSAIVfrNaSAlTPTNOCgNjWcoUL3AZsw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz", + "integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==", "dev": true }, "punycode": { @@ -1795,9 +1795,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -2116,9 +2116,9 @@ } }, "vscode": { - "version": "1.1.35", - "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.35.tgz", - "integrity": "sha512-xPnxzQU40LOS2yPyzWW+WKpTV6qA3z16TcgpZ9O38UWLA157Zz4GxUx5H7Gd07pxzw0GqvusbF4D+5GBgNxvEQ==", + "version": "1.1.36", + "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.36.tgz", + "integrity": "sha512-cGFh9jmGLcTapCpPCKvn8aG/j9zVQ+0x5hzYJq5h5YyUXVGa1iamOaB2M2PZXoumQPES4qeAP1FwkI0b6tL4bQ==", "dev": true, "requires": { "glob": "^7.1.2", diff --git a/package.json b/package.json index d331ce5f67..d4c2bb0770 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "tslint": "~5.18.0", "typescript": "~3.5.3", "vsce": "~1.66.0", - "vscode": "~1.1.35" + "vscode": "~1.1.36" }, "extensionDependencies": [ "vscode.powershell" From a11e27c0be916c349d4a00aeb37547dab9687cac Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2019 09:15:18 -0700 Subject: [PATCH 006/166] Bump tslint from 5.18.0 to 5.19.0 (#2156) Bumps [tslint](https://github.com/palantir/tslint) from 5.18.0 to 5.19.0. - [Release notes](https://github.com/palantir/tslint/releases) - [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/palantir/tslint/compare/5.18.0...5.19.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 92efbc65e6..924d98cadc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,18 +5,18 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", "dev": true, "requires": { "@babel/highlight": "^7.0.0" } }, "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", "dev": true, "requires": { "chalk": "^2.0.0", @@ -1654,9 +1654,9 @@ "dev": true }, "resolve": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", - "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", + "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -1935,9 +1935,9 @@ "dev": true }, "tslint": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", - "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", + "version": "5.19.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.19.0.tgz", + "integrity": "sha512-1LwwtBxfRJZnUvoS9c0uj8XQtAnyhWr9KlNvDIdB+oXyT+VpsOAaEhEgKi1HrZ8rq0ki/AAnbGSv4KM6/AfVZw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", diff --git a/package.json b/package.json index d4c2bb0770..d535188a92 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "mocha-junit-reporter": "~1.23.1", "mocha-multi-reporters": "~1.1.7", "rewire": "~4.0.1", - "tslint": "~5.18.0", + "tslint": "~5.19.0", "typescript": "~3.5.3", "vsce": "~1.66.0", "vscode": "~1.1.36" From 447a29536b87be338d4d7b63e85ff6fa11b0193a Mon Sep 17 00:00:00 2001 From: cesco Date: Thu, 5 Sep 2019 02:30:25 +0200 Subject: [PATCH 007/166] Added functionality to install the User variant of Stable Edition (#2160) Added functionality to install the User variant of Stable Edition --- scripts/Install-VSCode.ps1 | 58 ++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/scripts/Install-VSCode.ps1 b/scripts/Install-VSCode.ps1 index 8dd3ab88ca..46c3ca8049 100644 --- a/scripts/Install-VSCode.ps1 +++ b/scripts/Install-VSCode.ps1 @@ -1,6 +1,6 @@ <#PSScriptInfo -.VERSION 1.3 +.VERSION 1.4 .GUID 539e5585-7a02-4dd6-b9a6-5dd288d0a5d0 @@ -25,6 +25,8 @@ .EXTERNALSCRIPTDEPENDENCIES .RELEASENOTES + 30/08/2019 - added functionality to install the "User Install" variant of Stable Edition. + -- 07/11/2018 - added support for PowerShell Core and macOS/Linux platforms. -- 15/08/2018 - added functionality to install the new "User Install" variant of Insiders Edition. @@ -128,12 +130,12 @@ [CmdletBinding(SupportsShouldProcess=$true)] param( [parameter()] - [ValidateSet(, "64-bit", "32-bit")] - [string]$Architecture = "64-bit", + [ValidateSet('64-bit', '32-bit')] + [string]$Architecture = '64-bit', [parameter()] - [ValidateSet("Stable", "Insider-System", "Insider-User")] - [string]$BuildEdition = "Stable", + [ValidateSet('Stable-System', 'Stable-User', 'Insider-System', 'Insider-User')] + [string]$BuildEdition = "Stable-System", [Parameter()] [ValidateNotNull()] @@ -166,7 +168,7 @@ gpgkey=https://packages.microsoft.com/keys/microsoft.asc function Test-IsOsArchX64 { if ($PSVersionTable.PSVersion.Major -lt 6) { - return (Get-CimInstance -ClassName Win32_OperatingSystem).OSArchitecture -eq "64-bit" + return (Get-CimInstance -ClassName Win32_OperatingSystem).OSArchitecture -eq '64-bit' } return [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture -eq [System.Runtime.InteropServices.Architecture]::X64 @@ -199,7 +201,7 @@ function Get-CodePlatformInformation { $Bitness, [Parameter(Mandatory=$true)] - [ValidateSet('Stable', 'Insider-System', 'Insider-User')] + [ValidateSet('Stable-System', 'Stable-User', 'Insider-System', 'Insider-User')] [string] $BuildEdition ) @@ -226,11 +228,16 @@ function Get-CodePlatformInformation { } switch ($BuildEdition) { - 'Stable' { + 'Stable-System' { $appName = "Visual Studio Code ($Bitness)" break } + 'Stable-User' { + $appName = "Visual Studio Code ($($Architecture) - User)" + break + } + 'Insider-System' { $appName = "Visual Studio Code - Insiders Edition ($Bitness)" break @@ -318,10 +325,14 @@ function Get-CodePlatformInformation { } switch ($BuildEdition) { - 'Stable' { + 'Stable-System' { $exePath = "$installBase\Microsoft VS Code\bin\code.cmd" } + 'Stable-User' { + $exePath = "${env:LocalAppData}\Programs\Microsoft VS Code\bin\code.cmd" + } + 'Insider-System' { $exePath = "$installBase\Microsoft VS Code Insiders\bin\code-insiders.cmd" } @@ -334,11 +345,17 @@ function Get-CodePlatformInformation { } switch ($BuildEdition) { - 'Stable' { + 'Stable-System' { $channel = 'stable' break } + 'Stable-User' { + $channel = 'stable' + $platform += '-user' + break + } + 'Insider-System' { $channel = 'insider' break @@ -388,19 +405,19 @@ function Save-WithBitsTransfer { $bitsDl = Start-BitsTransfer $FileUri -Destination $Destination -Asynchronous - while (($bitsDL.JobState -eq "Transferring") -or ($bitsDL.JobState -eq "Connecting")) { + while (($bitsDL.JobState -eq 'Transferring') -or ($bitsDL.JobState -eq 'Connecting')) { Write-Progress -Activity "Downloading: $AppName" -Status "$([math]::round($bitsDl.BytesTransferred / 1mb))mb / $([math]::round($bitsDl.BytesTotal / 1mb))mb" -PercentComplete ($($bitsDl.BytesTransferred) / $($bitsDl.BytesTotal) * 100 ) } switch ($bitsDl.JobState) { - "Transferred" { + 'Transferred' { Complete-BitsTransfer -BitsJob $bitsDl break } - "Error" { - throw "Error downloading installation media." + 'Error' { + throw 'Error downloading installation media.' } } } @@ -417,7 +434,7 @@ function Install-VSCodeFromTar { ) $tarDir = Join-Path ([System.IO.Path]::GetTempPath()) 'VSCodeTar' - $destDir = "/opt/VSCode-linux-x64" + $destDir = '/opt/VSCode-linux-x64' New-Item -ItemType Directory -Force -Path $tarDir try { @@ -439,7 +456,12 @@ function Install-VSCodeFromTar { # We need to be running as elevated on *nix if (($IsLinux -or $IsMacOS) -and (id -u) -ne 0) { - throw "Must be running as root to install VSCode.`nInvoke this script with (for example):`n`tsudo pwsh -f Install-VSCode.ps1 -BuildEdition Stable" + throw "Must be running as root to install VSCode.`nInvoke this script with (for example):`n`tsudo pwsh -f Install-VSCode.ps1 -BuildEdition Stable-System" +} + +# User builds can only be installed on Windows systems +if ($BuildEdition.EndsWith('User') -and -not ($IsWindows -or $PSVersionTable.PSVersion.Major -lt 5)) { + throw 'User builds are not available for non-Windows systems' } try { @@ -506,7 +528,7 @@ try { } switch ($BuildEdition) { - 'Stable' { + 'Stable-System' { & $pacMan install -y code } @@ -550,7 +572,7 @@ try { break } - Install-VSCodeFromTar -TarPath $installerPath -Insiders:($BuildEdition -ne 'Stable') + Install-VSCodeFromTar -TarPath $installerPath -Insiders:($BuildEdition -ne 'Stable-System') break } From c15f9dc6716f36f194cb84663177963c638b52e5 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Tue, 10 Sep 2019 04:08:06 +0100 Subject: [PATCH 008/166] Add powershell.codeFormatting.autoCorrectAliases setting to add support for optionally correcting aliases as well (added in PSSA 1.18.2). Disabled by default. (#2165) Requires the following PSES PR to be merged first: https://github.com/PowerShell/PowerShellEditorServices/pull/1021 --- package.json | 5 +++++ src/settings.ts | 2 ++ 2 files changed, 7 insertions(+) diff --git a/package.json b/package.json index d535188a92..2b0d781f80 100644 --- a/package.json +++ b/package.json @@ -540,6 +540,11 @@ "default": true, "description": "Shows the last line of a folded section similar to the default VSCode folding style. When disabled, the entire folded region is hidden." }, + "powershell.codeFormatting.autoCorrectAliases": { + "type": "boolean", + "default": false, + "description": "Replaces aliases with their aliased name." + }, "powershell.codeFormatting.preset": { "type": "string", "enum": [ diff --git a/src/settings.ts b/src/settings.ts index c537b3a98d..86660e143f 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -41,6 +41,7 @@ export interface ICodeFoldingSettings { } export interface ICodeFormattingSettings { + autoCorrectAliases: boolean; preset: CodeFormattingPreset; openBraceOnSameLine: boolean; newLineAfterOpenBrace: boolean; @@ -137,6 +138,7 @@ export function load(): ISettings { }; const defaultCodeFormattingSettings: ICodeFormattingSettings = { + autoCorrectAliases: false, preset: CodeFormattingPreset.Custom, openBraceOnSameLine: true, newLineAfterOpenBrace: true, From 66a39de11087fe3ecc60cf04ed4b587fd8b4c317 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 16 Sep 2019 12:21:02 -0700 Subject: [PATCH 009/166] Prompt to update PowerShell version (#2105) * prompt to update PowerShell version * address all feedback * say homebrew is used * Feedback Co-Authored-By: Christoph Bergmeister [MVP] * Feedback Co-Authored-By: Christoph Bergmeister [MVP] * PR feedback * use correct url from github api --- package-lock.json | 92 +++++++++++++++- package.json | 9 ++ src/features/UpdatePowerShell.ts | 146 +++++++++++++++++++++++++ src/session.ts | 31 +++++- src/settings.ts | 3 + test/features/UpdatePowerShell.test.ts | 22 ++++ 6 files changed, 296 insertions(+), 7 deletions(-) create mode 100644 src/features/UpdatePowerShell.ts create mode 100644 test/features/UpdatePowerShell.test.ts diff --git a/package-lock.json b/package-lock.json index 924d98cadc..db4cc18de0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,12 +44,27 @@ "integrity": "sha512-yOxFfkN9xUFLyvWaeYj90mlqTJ41CsQzWKS3gXdOMOyPVacUsymejKxJ4/pMW7exouubuEeZLJawGgcNGYlTeg==", "dev": true }, + "@types/node-fetch": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.0.tgz", + "integrity": "sha512-TLFRywthBgL68auWj+ziWu+vnmmcHCDFC/sqCOQf1xTz4hRq8cu79z8CtHU9lncExGBsB8fXA4TiLDLt6xvMzw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/rewire": { "version": "2.5.28", "resolved": "https://registry.npmjs.org/@types/rewire/-/rewire-2.5.28.tgz", "integrity": "sha512-uD0j/AQOa5le7afuK+u+woi8jNKF1vf3DN0H7LCJhft/lNNibUr7VcAesdgtWfEKveZol3ZG1CJqwx2Bhrnl8w==", "dev": true }, + "@types/semver": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.0.1.tgz", + "integrity": "sha512-ffCdcrEE5h8DqVxinQjo+2d1q+FV5z7iNtPofw3JsrltSoSVlOGaW0rY8XxtO9XukdTn8TaCGWmk2VFGhI70mg==", + "dev": true + }, "acorn": { "version": "5.7.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", @@ -168,6 +183,13 @@ "requires": { "semver": "^5.3.0", "shimmer": "^1.1.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + } } }, "asynckit": { @@ -400,6 +422,13 @@ "async-hook-jl": "^1.7.6", "emitter-listener": "^1.0.1", "semver": "^5.4.1" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + } } }, "co": { @@ -548,6 +577,13 @@ "integrity": "sha1-zJmvlhLCP7H/8TYSxy8sv6qNWhc=", "requires": { "semver": "^5.3.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + } } }, "diagnostic-channel-publishers": { @@ -700,6 +736,14 @@ "strip-json-comments": "~2.0.1", "table": "4.0.2", "text-table": "~0.2.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } } }, "eslint-scope": { @@ -1396,6 +1440,11 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "node-fetch": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + }, "nth-check": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", @@ -1484,6 +1533,14 @@ "dev": true, "requires": { "semver": "^5.1.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } } }, "parse5": { @@ -1749,9 +1806,9 @@ "dev": true }, "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, "shebang-command": { "version": "1.2.0", @@ -1953,6 +2010,14 @@ "semver": "^5.3.0", "tslib": "^1.8.0", "tsutils": "^2.29.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } } }, "tsutils": { @@ -2104,6 +2169,12 @@ "yazl": "^2.2.2" }, "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, "tmp": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz", @@ -2128,6 +2199,14 @@ "source-map-support": "^0.5.0", "url-parse": "^1.4.4", "vscode-test": "^0.4.1" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } } }, "vscode-extension-telemetry": { @@ -2150,6 +2229,13 @@ "requires": { "semver": "^5.5.0", "vscode-languageserver-protocol": "3.14.1" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + } } }, "vscode-languageserver-protocol": { diff --git a/package.json b/package.json index 2b0d781f80..1d1f176057 100644 --- a/package.json +++ b/package.json @@ -41,13 +41,17 @@ "onView:PowerShellCommands" ], "dependencies": { + "node-fetch": "^2.6.0", + "semver": "^6.3.0", "vscode-extension-telemetry": "~0.1.2", "vscode-languageclient": "~5.2.1" }, "devDependencies": { "@types/mocha": "~5.2.7", "@types/node": "~10.11.0", + "@types/node-fetch": "^2.5.0", "@types/rewire": "^2.5.28", + "@types/semver": "^6.0.1", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.1", "mocha-multi-reporters": "~1.1.7", @@ -490,6 +494,11 @@ "type": "string", "description": "Specifies the PowerShell version name, as displayed by the 'PowerShell: Show Session Menu' command, used when the extension loads e.g \"Windows PowerShell (x86)\" or \"PowerShell Core 6 (x64)\"." }, + "powershell.promptToUpdatePowerShell": { + "type": "boolean", + "description": "Specifies whether you should be prompted to update your version of PowerShell.", + "default": true + }, "powershell.startAutomatically": { "type": "boolean", "default": true, diff --git a/src/features/UpdatePowerShell.ts b/src/features/UpdatePowerShell.ts new file mode 100644 index 0000000000..ab7caf5a40 --- /dev/null +++ b/src/features/UpdatePowerShell.ts @@ -0,0 +1,146 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ + +import fetch from "node-fetch"; +import * as semver from "semver"; +import { MessageItem, window } from "vscode"; +import { LanguageClient } from "vscode-languageclient"; +import * as Settings from "../settings"; +import { EvaluateRequestType } from "./Console"; + +const PowerShellGitHubReleasesUrl = + "https://api.github.com/repos/PowerShell/PowerShell/releases/latest"; +const PowerShellGitHubPrereleasesUrl = + "https://api.github.com/repos/PowerShell/PowerShell/releases"; + +export class GitHubReleaseInformation { + public static async FetchLatestRelease(preview: boolean): Promise { + // Fetch the latest PowerShell releases from GitHub. + let releaseJson: any; + if (preview) { + // This gets all releases and the first one is the latest prerelease if + // there is a prerelease version. + releaseJson = (await fetch(PowerShellGitHubPrereleasesUrl) + .then((res) => res.json())).find((release: any) => release.prerelease); + } else { + releaseJson = await fetch(PowerShellGitHubReleasesUrl) + .then((res) => res.json()); + } + + return new GitHubReleaseInformation( + releaseJson.tag_name, releaseJson.assets); + } + + public version: semver.SemVer; + public isPreview: boolean = false; + public assets: any[]; + + public constructor(version: string | semver.SemVer, assets: any[] = []) { + this.version = semver.parse(version); + + if (semver.prerelease(this.version)) { + this.isPreview = true; + } + + this.assets = assets; + } +} + +interface IUpdateMessageItem extends MessageItem { + id: number; +} + +export async function InvokePowerShellUpdateCheck( + languageServerClient: LanguageClient, + localVersion: semver.SemVer, + arch: string, + release: GitHubReleaseInformation) { + const options: IUpdateMessageItem[] = [ + { + id: 0, + title: "Yes", + }, + { + id: 1, + title: "Not now", + }, + { + id: 2, + title: "Do not show this notification again", + }, + ]; + + // If our local version is up-to-date, we can return early. + if (semver.compare(localVersion, release.version) >= 0) { + return; + } + + const commonText: string = `You have an old version of PowerShell (${ + localVersion.raw + }). The current latest release is ${ + release.version.raw + }.`; + + if (process.platform === "linux") { + await window.showInformationMessage( + `${commonText} We recommend updating to the latest version.`); + return; + } + + const isMacOS: boolean = process.platform === "darwin"; + const result = await window.showInformationMessage( + `${commonText} Would you like to update the version? ${ + isMacOS ? "(Homebrew is required on macOS)" : "" + }`, ...options); + + // If the user cancels the notification. + if (!result) { return; } + + // Yes choice. + switch (result.id) { + // Yes choice. + case 0: + let script: string; + if (process.platform === "win32") { + const msiMatcher = arch === "x86" ? + "win-x86.msi" : "win-x64.msi"; + + const assetUrl = release.assets.filter((asset: any) => + asset.name.indexOf(msiMatcher) >= 0)[0].browser_download_url; + + // Grab MSI and run it. + // tslint:disable-next-line: max-line-length + script = ` +$randomFileName = [System.IO.Path]::GetRandomFileName() +$tmpMsiPath = Microsoft.PowerShell.Management\\Join-Path ([System.IO.Path]::GetTempPath()) "$randomFileName.msi" +Microsoft.PowerShell.Utility\\Invoke-RestMethod -Uri ${assetUrl} -OutFile $tmpMsiPath +try +{ + Microsoft.PowerShell.Management\\Start-Process -Wait -Path $tmpMsiPath +} +finally +{ + Microsoft.PowerShell.Management\\Remove-Item $tmpMsiPath +}`; + + } else if (isMacOS) { + script = "brew cask upgrade powershell"; + if (release.isPreview) { + script = "brew cask upgrade powershell-preview"; + } + } + + await languageServerClient.sendRequest(EvaluateRequestType, { + expression: script, + }); + break; + + // Never choice. + case 2: + await Settings.change("promptToUpdatePowerShell", false, true); + break; + default: + break; + } +} diff --git a/src/session.ts b/src/session.ts index a5eb85ace0..5a0598f287 100644 --- a/src/session.ts +++ b/src/session.ts @@ -3,12 +3,11 @@ *--------------------------------------------------------*/ import cp = require("child_process"); -import crypto = require("crypto"); import fs = require("fs"); import net = require("net"); import os = require("os"); import path = require("path"); -import { StringDecoder } from "string_decoder"; +import * as semver from "semver"; import vscode = require("vscode"); import TelemetryReporter from "vscode-extension-telemetry"; import { Message } from "vscode-jsonrpc"; @@ -23,6 +22,7 @@ import { Middleware, NotificationType, RequestType, RequestType0, ResolveCodeLensSignature, RevealOutputChannelOn, StreamInfo } from "vscode-languageclient"; +import { GitHubReleaseInformation, InvokePowerShellUpdateCheck } from "./features/UpdatePowerShell"; import { fixWindowsPowerShellPath, getAvailablePowerShellExes, getDefaultPowerShellPath, getPlatformDetails, IPlatformDetails, OperatingSystem } from "./platform"; @@ -38,7 +38,6 @@ export enum SessionStatus { export class SessionManager implements Middleware { public HostVersion: string; - private ShowSessionMenuCommandName = "PowerShell.ShowSessionMenu"; private editorServicesArgs: string; private powerShellExePath: string = ""; @@ -558,7 +557,7 @@ export class SessionManager implements Middleware { this.languageServerClient .sendRequest(PowerShellVersionRequestType) .then( - (versionDetails) => { + async (versionDetails) => { this.versionDetails = versionDetails; if (!this.inDevelopmentMode) { @@ -571,6 +570,30 @@ export class SessionManager implements Middleware { ? `${this.versionDetails.displayVersion} (${this.versionDetails.architecture})` : this.versionDetails.displayVersion, SessionStatus.Running); + + // If the user opted to not check for updates, then don't. + if (!this.sessionSettings.promptToUpdatePowerShell) { return; } + + try { + const localVersion = semver.parse(this.versionDetails.version); + if (semver.lt(localVersion, "6.0.0")) { + // Skip prompting when using Windows PowerShell for now. + return; + } + + // Fetch the latest PowerShell releases from GitHub. + const isPreRelease = !!semver.prerelease(localVersion); + const release: GitHubReleaseInformation = + await GitHubReleaseInformation.FetchLatestRelease(isPreRelease); + + await InvokePowerShellUpdateCheck( + this.languageServerClient, + localVersion, + this.versionDetails.architecture, + release); + } catch { + // best effort. This probably failed to fetch the data from GitHub. + } }); // Send the new LanguageClient to extension features diff --git a/src/settings.ts b/src/settings.ts index 86660e143f..8a4e3ac9b7 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -80,6 +80,7 @@ export interface ISettings { powerShellAdditionalExePaths?: IPowerShellAdditionalExePathSettings[]; powerShellDefaultVersion?: string; powerShellExePath?: string; + promptToUpdatePowerShell?: boolean; bundledModulesPath?: string; startAutomatically?: boolean; useX86Host?: boolean; @@ -169,6 +170,8 @@ export function load(): ISettings { configuration.get("powerShellDefaultVersion", undefined), powerShellExePath: configuration.get("powerShellExePath", undefined), + promptToUpdatePowerShell: + configuration.get("promptToUpdatePowerShell", true), bundledModulesPath: "../../modules", useX86Host: diff --git a/test/features/UpdatePowerShell.test.ts b/test/features/UpdatePowerShell.test.ts new file mode 100644 index 0000000000..20b02b501f --- /dev/null +++ b/test/features/UpdatePowerShell.test.ts @@ -0,0 +1,22 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ + +import * as assert from "assert"; +import { GitHubReleaseInformation } from "../../src/features/UpdatePowerShell"; + +suite("UpdatePowerShell tests", () => { + test("Can get the latest version", async () => { + const release: GitHubReleaseInformation = await GitHubReleaseInformation.FetchLatestRelease(false); + assert.strictEqual(release.isPreview, false, "expected to not be preview."); + assert.strictEqual(release.version.prerelease.length === 0, true, "expected to not have preview in version."); + assert.strictEqual(release.assets.length > 0, true, "expected to have assets."); + }); + + test("Can get the latest preview version", async () => { + const release: GitHubReleaseInformation = await GitHubReleaseInformation.FetchLatestRelease(true); + assert.strictEqual(release.isPreview, true, "expected to be preview."); + assert.strictEqual(release.version.prerelease.length > 0, true, "expected to have preview in version."); + assert.strictEqual(release.assets.length > 0, true, "expected to have assets."); + }); +}); From e2e322fdf4b3d1049a0308f45159ca026a754748 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 16 Sep 2019 12:45:43 -0700 Subject: [PATCH 010/166] null check on activeTerminal to workaround vscode behavior (#2141) * null check on activeTerminal * newline for linting --- src/features/Console.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/features/Console.ts b/src/features/Console.ts index cedeb37769..cd06a4e9ea 100644 --- a/src/features/Console.ts +++ b/src/features/Console.ts @@ -211,7 +211,8 @@ export class ConsoleFeature implements IFeature { return; } - if (vscode.window.activeTerminal.name !== "PowerShell Integrated Console") { + if (vscode.window.activeTerminal && + vscode.window.activeTerminal.name !== "PowerShell Integrated Console") { this.log.write("PSIC is not active terminal. Running in active terminal using 'runSelectedText'"); await vscode.commands.executeCommand("workbench.action.terminal.runSelectedText"); From fa72d503d9a8f3b7cb41ed764f4ba7c6d66df6f6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2019 11:29:25 -0700 Subject: [PATCH 011/166] Bump tslint from 5.19.0 to 5.20.0 (#2180) Bumps [tslint](https://github.com/palantir/tslint) from 5.19.0 to 5.20.0. - [Release notes](https://github.com/palantir/tslint/releases) - [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/palantir/tslint/compare/5.19.0...5.20.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 20 +++++++++++++------- package.json | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index db4cc18de0..920a36845a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1992,16 +1992,16 @@ "dev": true }, "tslint": { - "version": "5.19.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.19.0.tgz", - "integrity": "sha512-1LwwtBxfRJZnUvoS9c0uj8XQtAnyhWr9KlNvDIdB+oXyT+VpsOAaEhEgKi1HrZ8rq0ki/AAnbGSv4KM6/AfVZw==", + "version": "5.20.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.0.tgz", + "integrity": "sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", "chalk": "^2.3.0", "commander": "^2.12.1", - "diff": "^3.2.0", + "diff": "^4.0.1", "glob": "^7.1.1", "js-yaml": "^3.13.1", "minimatch": "^3.0.4", @@ -2012,10 +2012,16 @@ "tsutils": "^2.29.0" }, "dependencies": { + "diff": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", + "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "dev": true + }, "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true } } diff --git a/package.json b/package.json index 1d1f176057..762a5bce3d 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "mocha-junit-reporter": "~1.23.1", "mocha-multi-reporters": "~1.1.7", "rewire": "~4.0.1", - "tslint": "~5.19.0", + "tslint": "~5.20.0", "typescript": "~3.5.3", "vsce": "~1.66.0", "vscode": "~1.1.36" From 22dc162377c9ea055296256bab3d6a41443ecbc0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2019 11:30:06 -0700 Subject: [PATCH 012/166] Bump @types/semver from 6.0.1 to 6.0.2 (#2181) Bumps [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 920a36845a..f69a6b6007 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,9 +60,9 @@ "dev": true }, "@types/semver": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.0.1.tgz", - "integrity": "sha512-ffCdcrEE5h8DqVxinQjo+2d1q+FV5z7iNtPofw3JsrltSoSVlOGaW0rY8XxtO9XukdTn8TaCGWmk2VFGhI70mg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.0.2.tgz", + "integrity": "sha512-G1Ggy7/9Nsa1Jt2yiBR2riEuyK2DFNnqow6R7cromXPMNynackRY1vqFTLz/gwnef1LHokbXThcPhqMRjUbkpQ==", "dev": true }, "acorn": { diff --git a/package.json b/package.json index 762a5bce3d..47f6c22bba 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@types/node": "~10.11.0", "@types/node-fetch": "^2.5.0", "@types/rewire": "^2.5.28", - "@types/semver": "^6.0.1", + "@types/semver": "^6.0.2", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.1", "mocha-multi-reporters": "~1.1.7", From 02236bd625c57ca9e54a3d7f5dd61938575b08a3 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Tue, 17 Sep 2019 11:30:26 -0700 Subject: [PATCH 013/166] Changelog tools (#1961) * Add AzureDataStudio update script * Copyright headers * Fix ads updater, add vsix version updater script * Improve existing scripts, add PSES update script * Fix param name issue * Update tools/repoUpdateScripts/updatePsesVersions.ps1 Co-Authored-By: rjmholt * Simplify default parameters, move dir * Give proper names to functions * Rename functions, fix parameter problems * Add AzureDataStudio update script * Copyright headers * Fix ads updater, add vsix version updater script * Improve existing scripts, add PSES update script * Fix param name issue * Add GitHub release script * Generalize release script to work with PSES * Change segment function verb * Update GH module * Add requires back in * Add newlines back in * Simplify default parameters, move dir * Give proper names to functions * Rename functions, fix parameter problems * Change segment function verb * Add GH PR/issue fetching * Initial changelog generation * Add thanks * WIP * Progress * Add skeleton * Current * Update to open both changelogs * Fix label bug * Minor fixes -- but still there * Fix bad project name assignment * Fix documentation loss * Fix bugs * Add verbosity, fix whitespace bugs * Fix upstream issues * Add subject polishing, fix date format * Add auto release name * Add extension name to PR title * Fix release name bug * Update ReleaseName usage * Fix verbose parameter * Fix verbose * Fix branch usage * Updates * Fix silliness * Add changelog emoji * Update emoji * Address @TylerLeonhardt's feedback --- tools/ChangelogTools.psm1 | 401 ++++++++++++++ tools/GitHubTools.psm1 | 497 ++++++++++++++++-- tools/changelog/updateChangelog.ps1 | 350 ++++++++++++ tools/postReleaseScripts/publishGHRelease.ps1 | 3 - 4 files changed, 1217 insertions(+), 34 deletions(-) create mode 100644 tools/ChangelogTools.psm1 create mode 100644 tools/changelog/updateChangelog.ps1 diff --git a/tools/ChangelogTools.psm1 b/tools/ChangelogTools.psm1 new file mode 100644 index 0000000000..d6bcadab4f --- /dev/null +++ b/tools/ChangelogTools.psm1 @@ -0,0 +1,401 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +#requires -Version 6.0 + +using module .\GitHubTools.psm1 + +class IgnoreConfiguration +{ + [string[]]$User + [string[]]$IssueLabel + [string[]]$PRLabel + [string[]]$CommitLabel +} + +class ChangeInfo +{ + [GitHubCommitInfo]$Commit + [GitHubPR]$PR + [GitHubIssue[]]$ClosedIssues + [int]$IssueNumber = -1 + [int]$PRNumber = -1 + [string]$ContributingUser + [string]$BodyText + [string]$Subject +} + +class ChangelogEntry +{ + [uri]$IssueLink + [uri]$PRLink + [string]$Category + [string[]]$Tags + [string]$BodyText + [string]$Subject + [string]$Thanks + [string]$RepositoryName + [ChangeInfo]$Change +} + +class ChangeLog +{ + ChangeLog() + { + $this.Sections = [System.Collections.Generic.Dictionary[string, ChangelogEntry]]::new() + } + + [string]$ReleaseName + [datetime]$Date + [string]$Preamble + [System.Collections.Generic.Dictionary[string, ChangelogEntry]]$Sections +} + +function NormalizeSubject +{ + [OutputType([string])] + param( + [Parameter(Mandatory)] + [string] + $Subject + ) + + $Subject = $Subject.Trim() + if ([char]::IsLower($Subject[0])) { $Subject = [char]::ToUpper($Subject[0]) + $Subject.Substring(1) } + if ($Subject[$Subject.Length] -ne '.') { $Subject += '.' } + + return $Subject +} + +filter Get-ChangeInfoFromCommit +{ + [OutputType([ChangeInfo])] + param( + [Parameter(Mandatory, ValueFromPipeline, Position=0)] + [GitHubCommitInfo[]] + $Commit, + + [Parameter(Mandatory)] + [string] + $GitHubToken + ) + + foreach ($singleCommit in $Commit) + { + Write-Verbose "Getting change information for commit $($Commit.Hash)" + + $changelogItem = [ChangeInfo]@{ + Commit = $singleCommit + BodyText = $singleCommit.Body + Subject = $singleCommit.Subject + ContributingUser = $singleCommit.GitHubCommitData.author.login + } + + if ($Commit.PRNumber -ge 0) + { + $getPrParams = @{ + Organization = $singleCommit.Organization + Repository = $singleCommit.Repository + PullNumber = $singleCommit.PRNumber + GitHubToken = $GitHubToken + } + $pr = Get-GitHubPR @getPrParams + + $changelogItem.PR = $pr + $changelogItem.PRNumber = $pr.Number + + $closedIssueInfos = $pr.GetClosedIssueInfos() + if ($closedIssueInfos) + { + $changelogItem.ClosedIssues = $closedIssueInfos | Get-GitHubIssue + $changelogItem.IssueNumber = $closedIssueInfos[0].Number + } + } + + $changelogItem + } +} + +filter New-ChangelogEntry +{ + [OutputType([ChangelogEntry])] + param( + [Parameter(Mandatory, ValueFromPipeline)] + [ChangeInfo] + $Change, + + [Parameter(Mandatory)] + [System.Collections.Specialized.OrderedDictionary] + $EntryCategories, + + [Parameter(Mandatory)] + [string] + $DefaultCategory, + + [Parameter(Mandatory)] + [hashtable] + $TagLabels, + + [Parameter()] + [string[]] + $NoThanks = @() + ) + + [string[]]$tags = @() + :labelLoop foreach ($issueLabel in $Change.ClosedIssues.Labels) + { + if (-not $entryCategory) + { + foreach ($category in $EntryCategories.GetEnumerator()) + { + if ($issueLabel -in $category.Value.Issue) + { + $entryCategory = $category.Key + continue :labelLoop + } + } + } + + $tag = $TagLabels[$issueLabel] + if ($tag) + { + $tags += $tag + } + } + + if (-not $entryCategory) + { + $entryCategory = $DefaultCategory + } + + $organization = $Change.Commit.Organization + $repository = $Change.Commit.Repository + + $issueLink = if ($Change.IssueNumber -ge 0) { $Change.ClosedIssues[0].GetHtmlUri() } else { $null } + $prLink = if ($Change.PRNumber -ge 0) { "https://github.com/$organization/$repository/pull/$($Change.PRNumber)" } else { $null } + $thanks = if ($Change.ContributingUser -notin $NoThanks) { $Change.ContributingUser } else { $null } + + $subject = $Change.Subject + if ($subject -match '(.*)\(#\d+\)$') + { + $subject = $Matches[1] + } + + Write-Verbose "Assembled changelog entry for commit $($Change.Commit.Hash)" + + return [ChangelogEntry]@{ + IssueLink = $issueLink + PRLink = $prLink + Thanks = $thanks + Category = $entryCategory + Tags = $tags + Change = $Change + RepositoryName = "$organization/$repository" + BodyText = $Change.BodyText + Subject = $subject + } +} + +function New-ChangeLogSection +{ + [OutputType([string])] + param( + [Parameter(Mandatory, ValueFromPipeline)] + [ChangelogEntry[]] + $ChangelogEntry, + + [Parameter(Mandatory)] + [string] + $ReleaseName, + + [Parameter(Mandatory)] + [string[]] + $Categories, + + [Parameter(Mandatory)] + [string] + $DefaultCategory, + + [Parameter()] + [string] + $Preamble, + + [Parameter()] + [string] + $Postamble, + + [Parameter()] + [datetime] + $Date = [datetime]::Now, + + [Parameter()] + [ValidateNotNullOrEmpty()] + [string] + $DateFormat = 'dddd, dd MM yyyy', + + [Parameter()] + [string] + $Indent = ' ' + ) + + begin + { + $entries = [ordered]@{} + + foreach ($category in $Categories) + { + $entries[$category] = [System.Collections.Generic.List[ChangelogEntry]]::new() + } + } + + process + { + foreach ($entry in $ChangelogEntry) + { + $entries[$entry.Category].Add($entry) + } + } + + end + { + $dateStr = $Date.ToString($DateFormat) + $sb = [System.Text.StringBuilder]::new().AppendLine("## $ReleaseName").AppendLine("### $dateStr") + + if ($Preamble) + { + [void]$sb.AppendLine($Preamble) + } + + [void]$sb.AppendLine() + + foreach ($category in $entries.GetEnumerator()) + { + if (-not $category.Value) + { + continue + } + + if ($category.Key -ne $DefaultCategory) + { + [void]$sb.AppendLine("$($category.Key):") + } + + foreach ($item in $category.Value) + { + # Set up the pieces needed for a changelog entry + $link = if ($item.PRLink) { $item.PRLink } else { $org = $item.Change.Commit.Organization; "https://github.com/$org/$project" } + $thanks = $item.Thanks + + if ($item.Change.IssueNumber -ge 0) + { + $project = $item.Change.ClosedIssues[0].Repository + $issueNumber = $item.Change.IssueNumber + } + elseif ($item.Change.PRNumber -ge 0) + { + $project = $item.Change.PR.Repository + $issueNumber = $item.Change.PRNumber + } + + # Add the list bullet + [void]$sb.Append('- ') + + # Start with the tags + if ($item.Tags) + { + [void]$sb.Append(($item.Tags -join ' ')).Append(' ') + } + + # Create a header for the change if there is an issue number + if ($issueNumber) + { + [void]$sb.AppendLine("[$project #$issueNumber]($link) -").Append($Indent) + } + + [void]$sb.Append((NormalizeSubject -Subject $item.Subject)) + if ($thanks) + { + [void]$sb.Append(" (Thanks @$thanks!)") + } + [void]$sb.AppendLine() + } + } + + if ($Postamble) + { + [void]$sb.AppendLine().AppendLine($Postamble) + } + + [void]$sb.AppendLine() + + return $sb.ToString() + } +} + +filter Skip-IgnoredChange +{ + param( + [Parameter(Mandatory, ValueFromPipeline)] + [ChangeInfo[]] + $Change, + + [Parameter()] + [string] + $User, + + [Parameter()] + [string] + $CommitLabel, + + [Parameter()] + [string[]] + $IssueLabel, + + [Parameter()] + [string[]] + $PRLabel + ) + + :outer foreach ($chg in $Change) + { + $msg = $chg.Subject + if ($chg.ContributingUser -in $User) + { + $u = $chg.ContributingUser + Write-Verbose "Skipping change from user '$u': '$msg'" + continue + } + + foreach ($chgCommitLabel in $chg.Commit.CommitLabels) + { + if ($chgCommitLabel -in $CommitLabel) + { + Write-Verbose "Skipping change with commit label '$chgCommitLabel': '$msg'" + continue outer + } + } + + foreach ($chgIssueLabel in $chg.ClosedIssues.Labels) + { + if ($chgIssueLabel -in $IssueLabel) + { + Write-Verbose "Skipping change with issue label '$chgIssueLabel': '$msg'" + continue outer + } + } + + foreach ($chgPRLabel in $chg.PR.Labels) + { + if ($chgPRLabel -in $PRLabel) + { + Write-Verbose "Skipping change with PR label '$chgPRLabel': '$msg'" + continue outer + } + } + + # Yield the change + $chg + } +} + +Export-ModuleMember -Function Get-ChangeInfoFromCommit,New-ChangelogEntry,New-ChangelogSection,Skip-IgnoredChange diff --git a/tools/GitHubTools.psm1 b/tools/GitHubTools.psm1 index 7d348ea8bf..75db3e5110 100644 --- a/tools/GitHubTools.psm1 +++ b/tools/GitHubTools.psm1 @@ -1,23 +1,216 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -function GetHumanishRepositoryName +#requires -Version 6.0 + +class GitCommitInfo +{ + [string]$Hash + [string[]]$ParentHashes + [string]$Subject + [string]$Body + [string]$ContributorName + [string]$ContributorEmail + [string[]]$CommitLabels + [int]$PRNumber = -1 +} + +class GitHubCommitInfo : GitCommitInfo +{ + [string]$Organization + [string]$Repository + [pscustomobject]$GitHubCommitData +} + +class GitHubIssueInfo +{ + [int]$Number + [string]$Organization + [string]$Repository + + [uri]GetHtmlUri() + { + return [uri]"https://github.com/$($this.Organization)/$($this.Repository)/issues/$($this.Number)" + } + + [uri]GetApiUri() + { + return [uri]"https://api.github.com/repos/$($this.Organization)/$($this.Repository)/issues/$($this.Number)" + } +} + +class GitHubIssue : GitHubIssueInfo +{ + [pscustomobject]$RawResponse + [string]$Body + [string[]]$Labels +} + +class GitHubPR : GitHubIssue +{ + hidden [GitHubIssueInfo[]]$ClosedIssues = $null + + [GitHubIssueInfo[]]GetClosedIssueInfos() + { + if ($null -eq $this.ClosedIssues) + { + $this.ClosedIssues = $this.Body | + GetClosedIssueUrisInBodyText | + GetGitHubIssueFromUri + } + + return $this.ClosedIssues + } + + [uri]GetHtmlUri() + { + return [uri]"https://github.com/$($this.Organization)/$($this.Repository)/pull/$($this.Number)" + } + + [uri]GetApiUri() + { + return [uri]"https://api.github.com/repos/$($this.Organization)/$($this.Repository)/pulls/$($this.Number)" + } +} + +function GetGitHubHeaders +{ + param( + [Parameter()] + [string] + $GitHubToken, + + [Parameter()] + [string] + $Accept + ) + + $headers = @{} + + if ($GitHubToken) + { + $headers.Authorization = "token $GitHubToken" + } + + if ($Accept) + { + $headers.Accept = $Accept + } + + return $headers +} + +$script:CloseKeywords = @( + 'close' + 'closes' + 'closed' + 'fix' + 'fixes' + 'fixed' + 'resolve' + 'resolves' + 'resolved' +) +$script:EndNonCharRegex = [regex]::new('[^0-9]*$', 'compiled') +filter GetClosedIssueUrisInBodyText +{ + param( + [Parameter(ValueFromPipeline)] + [string] + $Text + ) + + $words = $Text.Split() + + $expectIssue = $false + for ($i = 0; $i -lt $words.Length; $i++) + { + $currWord = $words[$i] + + if ($script:CloseKeywords -contains $currWord) + { + $expectIssue = $true + continue + } + + if (-not $expectIssue) + { + continue + } + + $expectIssue = $false + + $trimmedWord = $script:EndNonCharRegex.Replace($currWord, '') + + if ([uri]::IsWellFormedUriString($trimmedWord, 'Absolute')) + { + # Yield + [uri]$trimmedWord + } + } +} + +filter GetGitHubIssueFromUri +{ + param( + [Parameter(ValueFromPipeline)] + [uri] + $IssueUri + ) + + if ($IssueUri.Authority -ne 'github.com') + { + return + } + + if ($IssueUri.Segments.Length -ne 5) + { + return + } + + if ($IssueUri.Segments[3] -ne 'issues/') + { + return + } + + $issueNum = -1 + if (-not [int]::TryParse($IssueUri.Segments[4], [ref]$issueNum)) + { + return + } + + return [GitHubIssueInfo]@{ + Organization = $IssueUri.Segments[1].TrimEnd('/') + Repository = $IssueUri.Segments[2].TrimEnd('/') + Number = $issueNum + } +} + +filter GetHumanishRepositoryDetails { param( [string] - $Repository + $RemoteUrl ) - if ($Repository.EndsWith('.git')) + if ($RemoteUrl.EndsWith('.git')) { - $Repository = $Repository.Substring(0, $Repository.Length - 4) + $RemoteUrl = $RemoteUrl.Substring(0, $RemoteUrl.Length - 4) } else { - $Repository = $Repository.Trim('/') + $RemoteUrl = $RemoteUrl.Trim('/') } - return $Repository.Substring($Repository.LastIndexOf('/') + 1) + $lastSlashIdx = $RemoteUrl.LastIndexOf('/') + $repository = $RemoteUrl.Substring($lastSlashIdx + 1) + $secondLastSlashIdx = $RemoteUrl.LastIndexOfAny(('/', ':'), $lastSlashIdx - 1) + $organization = $RemoteUrl.Substring($secondLastSlashIdx + 1, $lastSlashIdx - $secondLastSlashIdx - 1) + + return @{ + Organization = $organization + Repository = $repository + } } function Exec @@ -53,7 +246,7 @@ function Copy-GitRepository [Parameter()] [ValidateNotNullOrEmpty()] [string] - $Destination = (GetHumanishRepositoryName $OriginRemote), + $Destination = ((GetHumanishRepositoryDetails $OriginRemote).Repository), [Parameter()] [string] @@ -95,25 +288,35 @@ function Copy-GitRepository New-Item -Path $containingDir -ItemType Directory -ErrorAction Stop } - Exec { git clone --single-branch --branch $CloneBranch $OriginRemote $Destination } + Write-Verbose "Cloning git repository '$OriginRemote' to path '$Destination'" + + Exec { git clone $OriginRemote --branch $CloneBranch --single-branch $Destination } + + if ($CloneBranch) + { + Write-Verbose "Cloned branch: $CloneBranch" + } Push-Location $Destination try { Exec { git config core.autocrlf true } - foreach ($remote in $Remotes.get_Keys()) - { - Exec { git remote add $remote $Remotes[$remote] } - } - - if ($PullUpstream -and $remote['upstream']) + if ($Remotes) { - Exec { git pull upstream $CloneBranch } + foreach ($remote in $Remotes.get_Keys()) + { + Exec { git remote add $remote $Remotes[$remote] } + } - if ($UpdateOrigin) + if ($PullUpstream -and $Remotes['upstream']) { - Exec { git push origin "+$CloneBranch"} + Exec { git pull upstream $CloneBranch } + + if ($UpdateOrigin) + { + Exec { git push origin "+$CloneBranch"} + } } } @@ -139,9 +342,9 @@ function Submit-GitChanges [string] $Branch, - [Parameter(Mandatory)] + [Parameter()] [string] - $RepositoryLocation, + $RepositoryLocation = (Get-Location), [Parameter()] [string[]] @@ -173,6 +376,9 @@ function Submit-GitChanges { Exec { git add -A } } + + Write-Verbose "Commiting and pushing changes in '$RepositoryLocation' to '$Remote/$Branch'" + Exec { git commit -m $Message } Exec { git push $Remote $Branch } } @@ -182,6 +388,120 @@ function Submit-GitChanges } } +function Get-GitCommit +{ + [OutputType([GitHubCommitInfo])] + [CmdletBinding(DefaultParameterSetName='SinceRef')] + param( + [Parameter(Mandatory, ParameterSetName='SinceRef')] + [Alias('SinceBranch', 'SinceTag')] + [string] + $SinceRef, + + [Parameter(ParameterSetName='SinceRef')] + [Alias('UntilBranch', 'UntilTag')] + [string] + $UntilRef = 'HEAD', + + [Parameter()] + [string] + $Remote, + + [Parameter()] + [string] + $GitHubToken, + + [Parameter()] + [string] + $RepositoryPath + ) + + if ($RepositoryPath) + { + Push-Location $RepositoryPath + } + try + { + if (-not $Remote) + { + $Remote = 'upstream' + try + { + $null = Exec { git remote get-url $Remote } + } + catch + { + $Remote = 'origin' + } + } + + $originDetails = GetHumanishRepositoryDetails -RemoteUrl (Exec { git remote get-url $Remote }) + $organization = $originDetails.Organization + $repository = $originDetails.Repository + + Write-Verbose "Getting local git commit data" + + $null = Exec { git fetch --all } + + $lastCommonCommit = Exec { git merge-base $SinceRef $UntilRef } + + $format = '%H||%P||%aN||%aE||%s' + $commits = Exec { git --no-pager log "$lastCommonCommit..$UntilRef" --format=$format } + + $irmParams = if ($GitHubToken) + { + @{ Headers = GetGitHubHeaders -GitHubToken $GitHubToken -Accept 'application/vnd.github.v3+json' } + } + else + { + @{ Headers = GetGitHubHeaders -Accept 'application/vnd.github.v3+json' } + } + + return $commits | + ForEach-Object { + $hash,$parents,$name,$email,$subject = $_.Split('||') + $body = (Exec { git --no-pager show $hash -s --format=%b }) -join "`n" + $commitVal = [GitHubCommitInfo]@{ + Hash = $hash + ParentHashes = $parents + ContributorName = $name + ContributorEmail = $email + Subject = $subject + Body = $body + Organization = $organization + Repository = $repository + } + + # Query the GitHub API for more commit information + Write-Verbose "Querying GitHub api for data on commit $hash" + $commitVal.GitHubCommitData = Invoke-RestMethod -Method Get -Uri "https://api.github.com/repos/$organization/$repository/commits/$hash" @irmParams + + # Look for something like 'This is a commit message (#1224)' + $pr = [regex]::Match($subject, '\(#(\d+)\)$').Groups[1].Value + if ($pr) + { + $commitVal.PRNumber = $pr + } + + # Look for something like '[Ignore] [giraffe] Fix tests' + $commitLabels = [regex]::Matches($subject, '^(\[(.*?)\]\s*)*') + if ($commitLabels.Groups.Length -ge 3 -and $commitLabels.Groups[2].Captures.Value) + { + $commitVal.CommitLabels = $commitLabels.Groups[2].Captures.Value + } + + $commitVal + } + } + finally + { + if ($RepositoryPath) + { + Pop-Location + } + } +} + function New-GitHubPR { param( @@ -232,14 +552,121 @@ function New-GitHubPR maintainer_can_modify = $true } | ConvertTo-Json - $headers = @{ - Accept = 'application/vnd.github.v3+json' - Authorization = "token $GitHubToken" - } + $headers = GetGitHubHeaders -GitHubToken $GitHubToken -Accept 'application/vnd.github.v3+json' + Write-Verbose "Opening new GitHub pull request on '$Organization/$Repository' with title '$Title'" Invoke-RestMethod -Method Post -Uri $uri -Body $body -Headers $headers } +function Get-GitHubPR +{ + param( + [Parameter(Mandatory)] + [string] + $Organization, + + [Parameter(Mandatory)] + [string] + $Repository, + + [Parameter(Mandatory)] + [int[]] + $PullNumber, + + [Parameter()] + [ValidateNotNullOrEmpty()] + [string] + $GitHubToken + ) + + return $PullNumber | + ForEach-Object { + $params = @{ + Method = 'Get' + Uri = "https://api.github.com/repos/$Organization/$Repository/pulls/$_" + } + + if ($GitHubToken) + { + $params.Headers = GetGitHubHeaders -GitHubToken $GitHubToken + } + + Write-Verbose "Retrieving GitHub pull request #$_" + + $prResponse = Invoke-RestMethod @params + + [GitHubPR]@{ + RawResponse = $prResponse + Number = $prResponse.Number + Organization = $Organization + Repository = $Repository + Body = $prResponse.body + Labels = $prResponse.labels.name + } + } +} + +filter Get-GitHubIssue +{ + [CmdletBinding(DefaultParameterSetName='IssueInfo')] + param( + [Parameter(Mandatory, ValueFromPipeline, Position=0, ParameterSetName='IssueInfo')] + [GitHubIssueInfo[]] + $IssueInfo, + + [Parameter(Mandatory, ParameterSetName='Params')] + [string] + $Organization, + + [Parameter(Mandatory, ParameterSetName='Params')] + [string] + $Repository, + + [Parameter(Mandatory, ParameterSetName='Params')] + [int] + $Number, + + [Parameter()] + [ValidateNotNullOrEmpty()] + [string] + $GitHubToken + ) + + foreach ($issue in $IssueInfo) + { + if (-not $issue) + { + $issue = [GitHubIssueInfo]@{ + Organization = $Organization + Repository = $Repository + Number = $Number + } + } + + $irmParams = @{ + Method = 'Get' + Uri = $IssueInfo.GetApiUri() + } + + if ($GitHubToken) + { + $irmParams.Headers = GetGitHubHeaders -GitHubToken $GitHubToken + } + + Write-Verbose "Retrieving GitHub issue #$($issue.Number)" + $issueResponse = Invoke-RestMethod @irmParams + + return [GitHubIssue]@{ + Organization = $issue.Organization + Repository = $issue.Repository + Number = $issue.Number + RawResponse = $issueResponse + Body = $issueResponse.body + Labels = $issueResponse.labels.name + } + } +} + function Publish-GitHubRelease { param( @@ -298,10 +725,9 @@ function Publish-GitHubRelease $restBody = ConvertTo-Json -InputObject $restParams $uri = "https://api.github.com/repos/$Organization/$Repository/releases" - $headers = @{ - Accept = 'application/vnd.github.v3+json' - Authorization = "token $GitHubToken" - } + $headers = GetGitHubHeaders -GitHubToken $GitHubToken -Accept 'application/vnd.github.v3+json' + + Write-Verbose "Publishing GitHub release '$ReleaseName' to $Organization/$Repository" $response = Invoke-RestMethod -Method Post -Uri $uri -Body $restBody -Headers $headers @@ -328,9 +754,10 @@ function Publish-GitHubRelease } $assetUri = "${assetBaseUri}?name=$fileName" - $headers = @{ - Authorization = "token $GitHubToken" - } + $headers = GetGitHubHeaders -GitHubToken $GitHubToken + + Write-Verbose "Uploading release asset '$fileName' to release '$ReleaseName' in $Organization/$Repository" + # This can be very slow, but it does work $null = Invoke-RestMethod -Method Post -Uri $assetUri -InFile $asset -ContentType $contentType -Headers $headers } @@ -338,4 +765,12 @@ function Publish-GitHubRelease return $response } -Export-ModuleMember -Function Copy-GitRepository,Submit-GitChanges,New-GitHubPR,Publish-GitHubRelease +Export-ModuleMember -Function @( + 'Copy-GitRepository', + 'Submit-GitChanges', + 'Get-GitCommit', + 'New-GitHubPR', + 'Get-GitHubPR', + 'Get-GitHubIssue', + 'Publish-GitHubRelease' +) diff --git a/tools/changelog/updateChangelog.ps1 b/tools/changelog/updateChangelog.ps1 new file mode 100644 index 0000000000..daf0fefd9f --- /dev/null +++ b/tools/changelog/updateChangelog.ps1 @@ -0,0 +1,350 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +#requires -Version 6.0 + +using module ..\GitHubTools.psm1 +using module ..\ChangelogTools.psm1 + +<# +.EXAMPLE +.\updateChangelog.ps1 -GitHubToken $ghTok -PSExtensionSinceRef v2019.5.0 -PsesSinceRef v2.0.0-preview.4 -PSExtensionVersion 2019.9.0 -PsesVersion 2.0.0-preview.5 -PSExtensionUntilRef master -PsesUntilRef master -Verbose +#> +[CmdletBinding()] +param( + [Parameter(Mandatory)] + [string] + $GitHubToken, + + [Parameter(Mandatory)] + [string] + $PSExtensionSinceRef, + + [Parameter(Mandatory)] + [string] + $PsesSinceRef, + + [Parameter()] + [version] + $PSExtensionVersion, # Default from package.json + + [Parameter()] + [semver] + $PsesVersion, # Default from PowerShellEditorServices.Common.props + + [Parameter()] + [string] + $PSExtensionReleaseName, # Default from $PSExtensionVersion + + [Parameter()] + [string] + $PsesReleaseName, # Default from $PsesVersion + + [Parameter()] + [string] + $PSExtensionUntilRef = 'HEAD', + + [Parameter()] + [string] + $PsesUntilRef = 'HEAD', + + [Parameter()] + [string] + $PSExtensionBaseBranch, # Default is master if HEAD, otherwise $PSExtensionSinceRef + + [Parameter()] + [string] + $PsesBaseBranch, # Default is master if HEAD, otherwise $PsesSinceRef + + [Parameter()] + [string] + $Organization = 'PowerShell', + + [Parameter()] + [string] + $TargetFork = $Organization, + + [Parameter()] + [string] + $FromFork = 'rjmholt', + + [Parameter()] + [string] + $ChangelogName = 'CHANGELOG.md', + + [Parameter()] + [string] + $PSExtensionRepositoryPath = (Resolve-Path "$PSScriptRoot/../../"), + + [Parameter()] + [string] + $PsesRepositoryPath = (Resolve-Path "$PSExtensionRepositoryPath/../PowerShellEditorServices") +) + +$PSExtensionRepositoryPath = $PSCmdlet.GetUnresolvedProviderPathFromPSPath($PSExtensionRepositoryPath) +$PsesRepositoryPath = $PSCmdlet.GetUnresolvedProviderPathFromPSPath($PsesRepositoryPath) + +$packageJson = Get-Content -Raw "$PSExtensionRepositoryPath/package.json" | ConvertFrom-Json +$extensionName = $packageJson.name +if (-not $PSExtensionVersion) +{ + $PSExtensionVersion = $packageJson.version +} + +if (-not $PsesVersion) +{ + $psesProps = [xml](Get-Content -Raw "$PsesRepositoryPath/PowerShellEditorServices.Common.props") + $psesVersionPrefix = $psesProps.Project.PropertyData.VersionPrefix + $psesVersionSuffix = $psesProps.Project.PropertyData.VersionSuffix + + $PsesVersion = [semver]"$psesVersionPrefix-$psesVersionSuffix" +} + +if (-not $PSExtensionReleaseName) +{ + $PSExtensionReleaseName = "v$PSExtensionVersion" +} + +if (-not $PsesReleaseName) +{ + $PsesReleaseName = "v$PsesVersion" +} + +if (-not $PSExtensionBaseBranch) +{ + $PSExtensionBaseBranch = if ($PSExtensionUntilRef -eq 'HEAD') + { + 'master' + } + else + { + $PSExtensionUntilRef + } +} + +if (-not $PsesBaseBranch) +{ + $PsesBaseBranch = if ($PsesUntilRef -eq 'HEAD') + { + 'master' + } + else + { + $PsesUntilRef + } +} + +function UpdateChangelogFile +{ + param( + [Parameter(Mandatory)] + [string] + $NewSection, + + [Parameter(Mandatory)] + [string] + $Path + ) + + Write-Verbose "Writing new changelog section to '$Path'" + + $changelogLines = Get-Content -Path $Path + $newContent = ($changelogLines[0..1] -join "`n`n") + $NewSection + ($changelogLines[2..$changelogLines.Length] -join "`n") + Set-Content -Encoding utf8NoBOM -Value $newContent -Path $Path +} + +#region Configuration + +Write-Verbose "Configuring settings" + +$vscodeRepoName = 'vscode-PowerShell' +$psesRepoName = 'PowerShellEditorServices' + +$dateFormat = 'dddd, MMMM dd, yyyy' + +$ignore = @{ + User = 'dependabot[bot]' + CommitLabel = 'Ignore' +} + +$noThanks = @( + 'rjmholt' + 'TylerLeonhardt' + 'daxian-dbw' + 'SteveL-MSFT' + 'PaulHigin' +) + +$categories = [ordered]@{ + Debugging = @{ + Issue = 'Area-Debugging' + } + CodeLens = @{ + Issue = 'Area-CodeLens' + } + 'Script Analysis' = @{ + Issue = 'Area-Script Analysis' + } + Formatting = @{ + Issue = 'Area-Formatting' + } + 'Integrated Console' = @{ + Issue = 'Area-Integrated Console','Area-PSReadLine' + } + Intellisense = @{ + Issue = 'Area-Intellisense' + } + General = @{ + Issue = 'Area-General' + } +} + +$defaultCategory = 'General' + +$branchName = "changelog-$PSExtensionReleaseName" + +#endregion Configuration + +#region PSES Changelog + +$psesGetCommitParams = @{ + SinceRef = $PsesSinceRef + UntilRef = $PsesUntilRef + GitHubToken = $GitHubToken + RepositoryPath = $PsesRepositoryPath + Verbose = $VerbosePreference +} + +$clEntryParams = @{ + EntryCategories = $categories + DefaultCategory = $defaultCategory + TagLabels = @{ + 'Issue-Enhancement' = '✨' + 'Issue-Bug' = '🐛' + 'Issue-Performance' = '⚡️' + 'Area-Build & Release' = '👷' + 'Area-Code Formatting' = '💎' + 'Area-Configuration' = '🔧' + 'Area-Debugging' = '🔍' + 'Area-Documentation' = '📖' + 'Area-Engine' = '🚂' + 'Area-Folding' = '📚' + 'Area-Integrated Console' = '📟' + 'Area-IntelliSense' = '🧠' + 'Area-Logging' = '💭' + 'Area-Pester' = '🐢' + 'Area-Script Analysis' = '👮‍' + 'Area-Snippets' = '✂️' + 'Area-Startup' = '🛫' + 'Area-Symbols & References' = '🔗' + 'Area-Tasks' = '✅' + 'Area-Test' = '🚨' + 'Area-Threading' = '⏱️' + 'Area-UI' = '📺' + 'Area-Workspaces' = '📁' + } + NoThanks = $noThanks + Verbose = $VerbosePreference +} + +$clSectionParams = @{ + Categories = $categories.Keys + DefaultCategory = $defaultCategory + DateFormat = $dateFormat + Verbose = $VerbosePreference +} + +Write-Verbose "Creating PSES changelog" + +$psesChangelogSection = Get-GitCommit @psesGetCommitParams | + Get-ChangeInfoFromCommit -GitHubToken $GitHubToken -Verbose:$VerbosePreference | + Skip-IgnoredChange @ignore -Verbose:$VerbosePreference | + New-ChangelogEntry @clEntryParams | + New-ChangelogSection @clSectionParams -ReleaseName $PsesReleaseName + +Write-Host "PSES CHANGELOG:`n`n$psesChangelogSection`n`n" + +#endregion PSES Changelog + +#region vscode-PowerShell Changelog +$psesChangelogPostamble = $psesChangelogSection -split "`n" +$psesChangelogPostamble = @("#### [$psesRepoName](https://github.com/$Organization/$psesRepoName)") + $psesChangelogPostamble[2..($psesChangelogPostamble.Length-3)] +$psesChangelogPostamble = $psesChangelogPostamble -join "`n" + +$psExtGetCommitParams = @{ + SinceRef = $PSExtensionSinceRef + UntilRef = $PSExtensionUntilRef + GitHubToken = $GitHubToken + RepositoryPath = $PSExtensionRepositoryPath + Verbose = $VerbosePreference +} +$psextChangelogSection = Get-GitCommit @psExtGetCommitParams | + Get-ChangeInfoFromCommit -GitHubToken $GitHubToken -Verbose:$VerbosePreference | + Skip-IgnoredChange @ignore -Verbose:$VerbosePreference | + New-ChangelogEntry @clEntryParams | + New-ChangelogSection @clSectionParams -Preamble "#### [$vscodeRepoName](https://github.com/$Organization/$vscodeRepoName)" -Postamble $psesChangelogPostamble -ReleaseName $PSExtensionReleaseName + +Write-Host "vscode-PowerShell CHANGELOG:`n`n$psextChangelogSection`n`n" + +#endregion vscode-PowerShell Changelog + +#region PRs + +# PSES PR +$cloneLocation = Join-Path ([System.IO.Path]::GetTempPath()) "${psesRepoName}_changelogupdate" + +$cloneParams = @{ + OriginRemote = "https://github.com/$FromFork/$psesRepoName" + Destination = $cloneLocation + CheckoutBranch = $branchName + CloneBranch = $PsesBaseBranch + Clobber = $true + Remotes = @{ 'upstream' = "https://github.com/$TargetFork/$vscodeRepoName" } +} +Copy-GitRepository @cloneParams -Verbose:$VerbosePreference + +UpdateChangelogFile -NewSection $psesChangelogSection -Path "$cloneLocation/$ChangelogName" + +Submit-GitChanges -RepositoryLocation $cloneLocation -File $GalleryFileName -Branch $branchName -Message "Update CHANGELOG for $PsesReleaseName" -Verbose:$VerbosePreference + +$prParams = @{ + Organization = $TargetFork + Repository = $psesRepoName + Branch = $branchName + Title = "Update CHANGELOG for $PsesReleaseName" + GitHubToken = $GitHubToken + FromOrg = $FromFork + TargetBranch = $PsesBaseBranch +} +New-GitHubPR @prParams -Verbose:$VerbosePreference + +# vscode-PowerShell PR +$cloneLocation = Join-Path ([System.IO.Path]::GetTempPath()) "${vscodeRepoName}_changelogupdate" + +$cloneParams = @{ + OriginRemote = "https://github.com/$FromFork/$vscodeRepoName" + Destination = $cloneLocation + CheckoutBranch = $branchName + CloneBranch = $PSExtensionBaseBranch + Clobber = $true + Remotes = @{ 'upstream' = "https://github.com/$TargetFork/$vscodeRepoName" } + PullUpstream = $true +} +Copy-GitRepository @cloneParams -Verbose:$VerbosePreference + +UpdateChangelogFile -NewSection $psextChangelogSection -Path "$cloneLocation/$ChangelogName" + +Submit-GitChanges -RepositoryLocation $cloneLocation -File $GalleryFileName -Branch $branchName -Message "Update CHANGELOG for $PSExtensionReleaseName" -Verbose:$VerbosePreference + +$prParams = @{ + Organization = $TargetFork + Repository = $vscodeRepoName + Branch = $branchName + Title = "Update $extensionName CHANGELOG for $PSExtensionReleaseName" + GitHubToken = $GitHubToken + FromOrg = $FromFork + TargetBranch = $PSExtensionBaseBranch +} +New-GitHubPR @prParams -Verbose:$VerbosePreference + +#endregion PRs diff --git a/tools/postReleaseScripts/publishGHRelease.ps1 b/tools/postReleaseScripts/publishGHRelease.ps1 index 435c2f715c..db467d3190 100644 --- a/tools/postReleaseScripts/publishGHRelease.ps1 +++ b/tools/postReleaseScripts/publishGHRelease.ps1 @@ -34,14 +34,11 @@ Import-Module "$PSScriptRoot/../GitHubTools.psm1" -Force <# .SYNOPSIS Get the release description from the CHANGELOG - .DESCRIPTION Gets the latest CHANGELOG entry from the CHANGELOG for use as the GitHub release description - .PARAMETER ChangelogPath Path to the changelog file #> - function GetDescriptionFromChangelog { param( From 923241037cff5a195adcb9f095d8f09cc08ec3e6 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 17 Sep 2019 13:56:38 -0700 Subject: [PATCH 014/166] Rev version to 2019.9.0 (#2185) --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index f69a6b6007..f0cb0c489c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "powershell-preview", - "version": "2019.5.0", + "version": "2019.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 47f6c22bba..08189d7f86 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2019.5.0", + "version": "2019.9.0", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From 1804af06f7c2ec40d0c400f525312c33a45530d2 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 17 Sep 2019 14:08:54 -0700 Subject: [PATCH 015/166] rev changelog for v2019.9.0 (#2186) --- CHANGELOG.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3b5f9b22b..8848025796 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,69 @@ # PowerShell Preview Extension Release History +## v2019.9.0 +### Wednesday, September 18, 2019 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 👷 [vscode-powershell #1961](https://github.com/PowerShell/vscode-powershell/pull/1961) - + Changelog tools. +- 🐛 [vscode-powershell #2141](https://github.com/PowerShell/vscode-powershell/pull/2141) - + Null check on activeTerminal to workaround vscode behavior. +- ✨ [vscode-powershell #2105](https://github.com/PowerShell/vscode-powershell/pull/2105) - + Prompt to update PowerShell version. +- 🔎 [vscode-powershell #2165](https://github.com/PowerShell/vscode-powershell/pull/2165) - + Add powershell.codeFormatting.autoCorrectAliases setting to add support for optionally correcting aliases as well (added in PSSA 1.18.2). Disabled by default.. (Thanks @bergmeister!) +- ✨ [vscode-powershell #2160](https://github.com/PowerShell/vscode-powershell/pull/2160) - + Added functionality to install the User variant of Stable Edition. (Thanks @Lothindir!) +- ✨ [vscode-powershell #2156](https://github.com/PowerShell/vscode-powershell) - + Default to PowerShell Core on Windows if it's installed. (Thanks @SydneyhSmith!) +- ✨ [vscode-powershell #2084](https://github.com/PowerShell/vscode-powershell/pull/2084) - + Implement #1611 - provide dynamic debug config. (Thanks @rkeithhill!) +- ✨ [vscode-powershell #2024](https://github.com/PowerShell/vscode-powershell/pull/2039) - + Add machine scope per VS Code team request. +- ✨ [vscode-powershell #2081](https://github.com/PowerShell/vscode-powershell/pull/2081) - + Add param-block snippet. (Thanks @AspenForester!) +- 🧹 [vscode-powershell #2062](https://github.com/PowerShell/vscode-powershell/pull/2062) - + Remove redundant snippets. (Thanks @travis-c-lagrone!) +- ✨ [vscode-powershell #1974](https://github.com/PowerShell/vscode-powershell/pull/1974) - + Add #Requires snippets. (Thanks @travis-c-lagrone!) +- 🧹 [vscode-powershell #2063](https://github.com/PowerShell/vscode-powershell/pull/2063) - + Remove redundant community snippets. (Thanks @travis-c-lagrone!) +- 👷 [vscode-powershell #2065](https://github.com/PowerShell/vscode-powershell/pull/2065) - + Update '.vscode/settings.json' to identify snippet files as 'JSON with Comments'. (Thanks @travis-c-lagrone!) +- 📔 [vscode-powershell #2065](https://github.com/PowerShell/vscode-powershell) - + Docs updates. (Thanks @SydneyhSmith!) +- 👷 [vscode-powershell #2038](https://github.com/PowerShell/vscode-powershell/pull/2038) - + Add ADS insiders gallery file to update script. +- 🔎 [vscode-powershell #2037](https://github.com/PowerShell/vscode-powershell/pull/2037) - + Update PSScriptAnalyzer docs Url to point to master branch because master is now the default branch. (Thanks @bergmeister!) +- 🐛 [vscode-powershell #2035](https://github.com/PowerShell/vscode-powershell/pull/2035) - + #1019: Get format settings from document editor instead of global. (Thanks @tillig!) +- 👷 [vscode-powershell #2025](https://github.com/PowerShell/vscode-powershell/pull/2025) - + Fix node version detect logic to handle node v10. (Thanks @rkeithhill!) +- ✨ [vscode-powershell #1946](https://github.com/PowerShell/vscode-powershell/pull/1946) - + Add ArgumentCompleter snippets. (Thanks @travis-c-lagrone!) +- 🧹 [vscode-powershell #2015](https://github.com/PowerShell/vscode-powershell/pull/2015) - + Fix node types version. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛 [PowerShellEditorServices #1022](https://github.com/PowerShell/PowerShellEditorServices/pull/1022) - + Catch stream exceptions for some Debug Adapter stability. +- 🔎 [PowerShellEditorServices #1021](https://github.com/PowerShell/PowerShellEditorServices/pull/1021) - + Add AutoCorrectAliases setting (PR to be made in VS-Code repo as well) to add support for optionally correcting aliases as well (added in PSSA 1.18.2). (Thanks @bergmeister!). +- 🐛 [vscode-powershell #1994](https://github.com/PowerShell/PowerShellEditorServices/pull/1000) - + Fix crash when setBreakpoint from VSCode sends a git:/ URI. +- 🧹 [PowerShellEditorServices #988](https://github.com/PowerShell/PowerShellEditorServices/pull/988) - + Remove consoleecho lib for PowerShell 7. +- 📔 [PowerShellEditorServices #986](https://github.com/PowerShell/PowerShellEditorServices) - + Documentation updates. (Thanks @SydneyhSmith!) +- ⚙️ [PowerShellEditorServices #981](https://github.com/PowerShell/PowerShellEditorServices/pull/981) - + Update NewtonSoft.Json dependency from 10.0.3 to 11.02 since PS 6.0 has been deprecated. (Thanks @bergmeister!) +- 🐛 [vscode-powershell #2007](https://github.com/PowerShell/PowerShellEditorServices/pull/974) - + Defend against crash when no PSScriptAnalyzer is found. +- 👷 [PowerShellEditorServices #978](https://github.com/PowerShell/PowerShellEditorServices/pull/977) - + Delete stale WebSocket code. + ## v2019.5.0 ### Wednesday, May 22, 2019 #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) From 1b55f7894fffc4d8cdc67ce77b72978b77aef2e0 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 19 Sep 2019 18:47:45 -0700 Subject: [PATCH 016/166] [ignore] Move to yml for release (#2191) * move to yml * correct pool * env var * install invokebuild * FORCE * no test for now * whitespace * download to build directory * sources * help * help * idk * release * remove remove * number * TERMS * update script to get partially succeeded results and move to other build * logs * move-to-yml * no value * correct buildid * delete leftover docker build stuff * Remove debug code * Revert back to master --- .vsts-ci/azure-pipelines-release.yml | 43 +++ .vsts-ci/templates/release-general.yml | 120 +++++++ tools/releaseBuild/Image/DockerFile | 34 -- tools/releaseBuild/Image/build.ps1 | 14 - tools/releaseBuild/Image/dockerInstall.psm1 | 114 ------ tools/releaseBuild/build.json | 15 - tools/releaseBuild/findPsesBuild.ps1 | 24 +- tools/releaseBuild/signing.xml | 4 +- tools/releaseBuild/vstsbuild.ps1 | 79 ---- tools/terms/FileTypeSet.xml | 379 ++++++++++++++++++++ vscode-powershell.build.ps1 | 7 +- 11 files changed, 568 insertions(+), 265 deletions(-) create mode 100644 .vsts-ci/azure-pipelines-release.yml create mode 100644 .vsts-ci/templates/release-general.yml delete mode 100644 tools/releaseBuild/Image/DockerFile delete mode 100644 tools/releaseBuild/Image/build.ps1 delete mode 100644 tools/releaseBuild/Image/dockerInstall.psm1 delete mode 100644 tools/releaseBuild/build.json delete mode 100644 tools/releaseBuild/vstsbuild.ps1 create mode 100644 tools/terms/FileTypeSet.xml diff --git a/.vsts-ci/azure-pipelines-release.yml b/.vsts-ci/azure-pipelines-release.yml new file mode 100644 index 0000000000..31e1b812ef --- /dev/null +++ b/.vsts-ci/azure-pipelines-release.yml @@ -0,0 +1,43 @@ +name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr) + +variables: + # Don't download unneeded packages + - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE + value: 'true' + # Improve performance by not sending telemetry + - name: DOTNET_CLI_TELEMETRY_OPTOUT + value: 'true' + +trigger: + batch: true + branches: + include: + - master + - legacy/1.x + paths: + exclude: + - /.dependabot/* + - /.poshchan/* + - /.github/**/* + - /.vscode/**/* + - /.vsts-ci/misc-analysis.yml + - /tools/**/* + - .editorconfig + - .gitattributes + - .gitignore + - /docs/**/* + - /CHANGELOG.md + - /CONTRIBUTING.md + - /README.md + - /LICENSE + - /CODE_OF_CONDUCT.md + +jobs: + +- job: 'ReleaseBuild' + displayName: 'Build release' + pool: + name: 'Package ES CodeHub Lab E' + demands: DotNetFramework + steps: + - template: templates/release-general.yml diff --git a/.vsts-ci/templates/release-general.yml b/.vsts-ci/templates/release-general.yml new file mode 100644 index 0000000000..cce356d94c --- /dev/null +++ b/.vsts-ci/templates/release-general.yml @@ -0,0 +1,120 @@ +steps: +- pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" + displayName: Set Build Name for Non-PR + condition: ne(variables['Build.Reason'], 'PullRequest') + +- pwsh: | + Get-ChildItem -Path env: + displayName: Capture environment + condition: succeededOrFailed() + +- task: PkgESSetupBuild@10 + displayName: 'Package ES - Setup Build' + inputs: + productName: vscode-powershell + +- task: PowerShell@2 + displayName: 'Set environment variables for VSTS (Phase 1)' + inputs: + targetType: filePath + filePath: ./tools/releaseBuild/setVstsVariables.ps1 + +- task: PowerShell@2 + displayName: 'Find PowerShellEditorServices build' + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + targetType: filePath + filePath: ./tools/releaseBuild/findPsesBuild.ps1 + +- task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifacts from PowerShell Editor Services' + inputs: + buildType: specific + project: '8e2735c1-3674-408a-bcab-87f089ea29d5' + pipeline: 1056 + buildVersionToDownload: specific + buildId: '$(PSES_BUILDID)' + downloadType: specific + downloadPath: '$(Build.SourcesDirectory)' + +- pwsh: | + Install-Module InvokeBuild -Force + Invoke-Build Release + +- task: PublishTestResults@2 + inputs: + testRunner: JUnit + testResultsFiles: '**/test-results.xml' + condition: succeededOrFailed() + +- task: PkgESCodeSign@10 + displayName: 'CodeSign tools/releaseBuild/signing.xml' + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + signConfigXml: tools/releaseBuild/signing.xml + inPathRoot: '$(Build.ArtifactStagingDirectory)' + outPathRoot: '$(Build.ArtifactStagingDirectory)\Signed' + +- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 + displayName: 'Component Detection' + +- task: AntiMalware@3 + inputs: + InputType: 'Basic' + ScanType: 'CustomScan' + FileDirPath: '$(Build.ArtifactStagingDirectory)' + EnableServices: false + SupportLogOnError: false + TreatSignatureUpdateFailureAs: 'Warning' + SignatureFreshness: 'UpToDate' + TreatStaleSignatureAs: 'Error' + +- task: PoliCheck@1 + condition: succeededOrFailed() + inputs: + targetType: F + optionsFC: 0 + optionsXS: 0 + optionsPE: '1|2|3|4' + optionsHMENABLE: 0 + optionsFTPATH: '$(Build.SourcesDirectory)\tools\terms\FileTypeSet.xml' + # toolVersion: 5.8.2.1 + +- task: CredScan@2 + condition: succeededOrFailed() + +# Publish results as artifacts +- task: PublishSecurityAnalysisLogs@3 + condition: succeededOrFailed() + inputs: + ArtifactName: 'CodeAnalysisLogs' + ArtifactType: 'Container' + +# Publish to TSA server +- task: TSAUpload@1 + condition: succeededOrFailed() + continueOnError: true + inputs: + tsaVersion: 'TsaV2' + codebase: 'Existing' + tsaEnvironment: 'PROD' + codeBaseName: 'PowerShell_PowerShellEditorServices_20190917' + uploadAPIScan: false + uploadBinSkim: false + uploadCredScan: true + uploadFortifySCA: false + uploadFxCop: false + uploadModernCop: false + uploadPoliCheck: true + uploadPREfast: false + uploadRoslyn: false + uploadTSLint: false + uploadAsync: true + +- task: PowerShell@1 + displayName: 'Upload artifacts' + inputs: + scriptType: inlineScript + inlineScript: 'Write-Host "##vso[artifact.upload containerfolder=vscode-powershell;artifactname=vscode-powershell]$(System.ArtifactsDirectory)\Signed"' diff --git a/tools/releaseBuild/Image/DockerFile b/tools/releaseBuild/Image/DockerFile deleted file mode 100644 index fd7bd26abb..0000000000 --- a/tools/releaseBuild/Image/DockerFile +++ /dev/null @@ -1,34 +0,0 @@ -# escape=` -#0.3.6 (no powershell 6) -FROM microsoft/dotnet-framework:4.7.1 -LABEL maintainer='PowerShell Team ' -LABEL description="Build's PowerShell Editor Services" - -SHELL ["C:\\windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "-command"] - -COPY dockerInstall.psm1 containerFiles/dockerInstall.psm1 - -RUN Import-Module PackageManagement; ` - Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force; ` - Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | Out-Null; ` - Install-Module InvokeBuild -MaximumVersion 5.1.0 -Scope CurrentUser -Force; ` - Install-Module platyPS -RequiredVersion 0.9.0 -Scope CurrentUser -Force; - -# Install Nodejs -RUN Import-Module ./containerFiles/dockerInstall.psm1; ` - Install-ChocolateyPackage -PackageName nodejs-lts -Executable node.exe; - -# Copy build script over -COPY build.ps1 containerFiles/build.ps1 - -# Add an environment variable for build versioning -ENV VSTS_BUILD=1 -ENV VSTS_BUILD_VERSION=2.0.2 - -# Uncomment to debug locally -# RUN Import-Module ./containerFiles/dockerInstall.psm1; ` -# Install-ChocolateyPackage -PackageName git -Executable git.exe; ` -# git clone https://github.com/PowerShell/PowerShellEditorServices; - -ENTRYPOINT ["C:\\windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "-command"] - diff --git a/tools/releaseBuild/Image/build.ps1 b/tools/releaseBuild/Image/build.ps1 deleted file mode 100644 index 1a5242a914..0000000000 --- a/tools/releaseBuild/Image/build.ps1 +++ /dev/null @@ -1,14 +0,0 @@ -param ( [string]$target ) -if ( ! (test-path ${target} ) ) { - new-item -type directory ${target} -} -else { - if ( test-path -pathtype leaf ${target} ) { - remove-item -force ${target} - new-item -type directory ${target} - } -} -push-location C:/vscode-powershell -Invoke-Build Release -Copy-Item -Verbose -Recurse "C:/vscode-powershell/PowerShell-insiders.vsix" "${target}/PowerShell-insiders.vsix" -Copy-Item -Verbose -Recurse "C:/vscode-powershell/scripts/Install-VSCode.ps1" "${target}/Install-VSCode.ps1" diff --git a/tools/releaseBuild/Image/dockerInstall.psm1 b/tools/releaseBuild/Image/dockerInstall.psm1 deleted file mode 100644 index 143334e273..0000000000 --- a/tools/releaseBuild/Image/dockerInstall.psm1 +++ /dev/null @@ -1,114 +0,0 @@ -function Install-ChocolateyPackage -{ - param( - [Parameter(Mandatory=$true)] - [string] - $PackageName, - - [Parameter(Mandatory=$false)] - [string] - $Executable, - - [string[]] - $ArgumentList, - - [switch] - $Cleanup, - - [int] - $ExecutionTimeout = 2700, - - [string] - $Version - ) - - if(-not(Get-Command -name Choco -ErrorAction SilentlyContinue)) - { - Write-Verbose "Installing Chocolatey provider..." -Verbose - Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression - } - - Write-Verbose "Installing $PackageName..." -Verbose - $extraCommand = @() - if($Version) - { - $extraCommand += '--version', $version - } - choco install -y $PackageName --no-progress --execution-timeout=$ExecutionTimeout $ArgumentList $extraCommands - - if($executable) - { - Write-Verbose "Verifing $Executable is in path..." -Verbose - $exeSource = $null - $exeSource = Get-ChildItem -path "$env:ProgramFiles\$Executable" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName - if(!$exeSource) - { - Write-Verbose "Falling back to x86 program files..." -Verbose - $exeSource = Get-ChildItem -path "${env:ProgramFiles(x86)}\$Executable" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName - } - - # Don't search the chocolatey program data until more official locations have been searched - if(!$exeSource) - { - Write-Verbose "Falling back to chocolatey..." -Verbose - $exeSource = Get-ChildItem -path "$env:ProgramData\chocolatey\$Executable" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName - } - - # all obvious locations are exhausted, use brute force and search from the root of the filesystem - if(!$exeSource) - { - Write-Verbose "Falling back to the root of the drive..." -Verbose - $exeSource = Get-ChildItem -path "/$Executable" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName - } - - if(!$exeSource) - { - throw "$Executable not found" - } - - $exePath = Split-Path -Path $exeSource - Add-Path -path $exePath - } - - if($Cleanup.IsPresent) - { - Remove-Folder -Folder "$env:temp\chocolatey" - } -} - -function Add-Path -{ - param - ( - $path - ) - $machinePathString = [System.Environment]::GetEnvironmentVariable('path',[System.EnvironmentVariableTarget]::Machine) - $machinePath = $machinePathString -split ';' - - if($machinePath -inotcontains $path) - { - $newPath = "$machinePathString;$path" - Write-Verbose "Adding $path to path..." -Verbose - [System.Environment]::SetEnvironmentVariable('path',$newPath,[System.EnvironmentVariableTarget]::Machine) - Write-Verbose "Added $path to path." -Verbose - $env:Path += ";$newPath" - } - else - { - Write-Verbose "$path already in path." -Verbose - } -} - -function Remove-Folder -{ - param( - [string] - $Folder - ) - - Write-Verbose "Cleaning up $Folder..." -Verbose - $filter = Join-Path -Path $Folder -ChildPath * - [int]$measuredCleanupMB = (Get-ChildItem $filter -Recurse | Measure-Object -Property Length -Sum).Sum / 1MB - Remove-Item -recurse -force $filter -ErrorAction SilentlyContinue - Write-Verbose "Cleaned up $measuredCleanupMB MB from $Folder" -Verbose -} diff --git a/tools/releaseBuild/build.json b/tools/releaseBuild/build.json deleted file mode 100644 index 2115a64f63..0000000000 --- a/tools/releaseBuild/build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Windows": { - "Name": "win7-x64", - "RepoDestinationPath": "C:\\vscode-powershell", - "BuildCommand": "C:\\containerFiles\\build.ps1 -target _DockerVolume_", - "DockerFile": ".\\tools\\releaseBuild\\Image\\DockerFile", - "DockerImageName": "vscodepowershell", - "BinaryBucket": "release", - "PublishAsFolder": true, - "AdditionalContextFiles" : [ - ".\\tools\\releaseBuild\\Image\\build.ps1", - ".\\tools\\releaseBuild\\Image\\dockerInstall.psm1" - ] - } -} diff --git a/tools/releaseBuild/findPsesBuild.ps1 b/tools/releaseBuild/findPsesBuild.ps1 index 01df27b3e3..bc575b7feb 100644 --- a/tools/releaseBuild/findPsesBuild.ps1 +++ b/tools/releaseBuild/findPsesBuild.ps1 @@ -1,9 +1,21 @@ $branch = [uri]::EscapeDataString($env:PSES_BRANCH) -$buildsUrl = $env:VSTS_PSES_URL_TEMPLATE -f $branch $headers = @{Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"} -$builds = Invoke-RestMethod -ContentType application/json -Uri $buildsUrl -Headers $headers -Write-Host "Got PSES_BRANCH: ${env:PSES_BRANCH}" + +$buildsUrl = $env:VSTS_PSES_URL_TEMPLATE -f $branch, "succeeded" +$succeededBuilds = Invoke-RestMethod -ContentType application/json -Uri $buildsUrl -Headers $headers +Write-Host "Requested URL: $buildsUrl" +Write-Host "Got response:`n$(ConvertTo-Json $succeededBuilds)" + +$buildsUrl = $env:VSTS_PSES_URL_TEMPLATE -f $branch, "partiallySucceeded" +$partiallySucceededBuilds = Invoke-RestMethod -ContentType application/json -Uri $buildsUrl -Headers $headers Write-Host "Requested URL: $buildsUrl" -Write-Host "Got response:`n$(ConvertTo-Json $builds)" -Write-Host "setting PSES_BUILDID to $($builds.value[0].Id)" -Write-Host "##vso[task.setvariable variable=PSES_BUILDID]$($builds.value[0].Id)" \ No newline at end of file +Write-Host "Got response:`n$(ConvertTo-Json $partiallySucceededBuilds)" + +$builds = @( + $succeededBuilds.value + $partiallySucceededBuilds.value + ) | Sort-Object finishTime -Descending + +Write-Host "Got PSES_BRANCH: ${env:PSES_BRANCH}" +Write-Host "setting PSES_BUILDID to $($builds[0].Id)" +Write-Host "##vso[task.setvariable variable=PSES_BUILDID]$($builds[0].Id)" diff --git a/tools/releaseBuild/signing.xml b/tools/releaseBuild/signing.xml index 4a763ebb7e..4ee935d4ce 100644 --- a/tools/releaseBuild/signing.xml +++ b/tools/releaseBuild/signing.xml @@ -1,9 +1,9 @@ - - diff --git a/tools/releaseBuild/vstsbuild.ps1 b/tools/releaseBuild/vstsbuild.ps1 deleted file mode 100644 index 1d78994f7b..0000000000 --- a/tools/releaseBuild/vstsbuild.ps1 +++ /dev/null @@ -1,79 +0,0 @@ -[cmdletbinding()] -param() - -Begin -{ - $ErrorActionPreference = 'Stop' - - $gitBinFullPath = (Get-Command -Name git -CommandType Application).Path | Select-Object -First 1 - if ( ! $gitBinFullPath ) - { - throw "Git is missing! Install from 'https://git-scm.com/download/win'" - } - - # clone the release tools - $releaseToolsDirName = "PSRelease" - $releaseToolsLocation = Join-Path -Path $PSScriptRoot -ChildPath PSRelease - if ( Test-Path $releaseToolsLocation ) - { - Remove-Item -Force -Recurse -Path $releaseToolsLocation - } - & $gitBinFullPath clone -b master --quiet https://github.com/PowerShell/${releaseToolsDirName}.git $releaseToolsLocation - Import-Module "$releaseToolsLocation/vstsBuild" -Force - Import-Module "$releaseToolsLocation/dockerBasedBuild" -Force -Prefix DockerBased - - # Get the update signing script and update the signing XML file - $updateSigningPath = Join-Path $releaseToolsLocation 'updateSigning.ps1' - Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/releaseBuild/updateSigning.ps1' -OutFile $updateSigningPath - & $updateSigningPath -SigningXmlPath (Join-Path $PSScriptRoot 'signing.xml') -} - -End { - - $AdditionalFiles = .{ - Join-Path $PSScriptRoot -child "Image/build.ps1" - Join-Path $PSScriptRoot -child "Image/dockerInstall.psm1" - "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\PowerShellEditorServices" - } - $buildPackageName = $null - - # defined if building in VSTS - if($env:BUILD_STAGINGDIRECTORY) - { - # Use artifact staging if running in VSTS - $destFolder = $env:BUILD_STAGINGDIRECTORY - } - else - { - # Use temp as destination if not running in VSTS - $destFolder = $env:temp - } - - $resolvedRepoRoot = (Resolve-Path (Join-Path -Path $PSScriptRoot -ChildPath "../../")).Path - - try - { - Write-Verbose "Starting build at $resolvedRepoRoot ..." -Verbose - Clear-VstsTaskState - - $buildParameters = @{ - ReleaseTag = $ReleaseTag - } - $buildArgs = @{ - RepoPath = $resolvedRepoRoot - BuildJsonPath = './tools/releaseBuild/build.json' - Parameters = $buildParameters - AdditionalFiles = $AdditionalFiles - Name = "win7-x64" - } - Invoke-DockerBasedBuild @buildArgs - } - catch - { - Write-VstsError -Error $_ - } - finally{ - Write-VstsTaskState - exit 0 - } -} diff --git a/tools/terms/FileTypeSet.xml b/tools/terms/FileTypeSet.xml new file mode 100644 index 0000000000..82f9f4d09e --- /dev/null +++ b/tools/terms/FileTypeSet.xml @@ -0,0 +1,379 @@ + + + + + Pure Text Files + + .txt + .des + .pwd + .asm + .cmd + .ini + .poc + .pwt + .hpj + .sql + .inf + .log + .def + .url + .bat + .aspx + .idl + .sys + .resources + .strings + .md + .yml + .yaml + .spelling + .gitignore + .gitattributes + .gitmodules + .csv + .tsv + + + + CodeFiles + + .frm + .inc + .cpp + .cls + .c + .hpp + .vbs + .java + .cs + .cxx + .h + .jav + .bas + .hxx + .js + .pl + .rc + .vb + .json + .resjson + .fs + .fsi + .fsx + .m + .psm1 + .config + .ps1 + .psd1 + .cmake + .sh + .cshtml + .plist + .mof + .mc + + + + XML Files + + .xml + .hxa + .hxk + .hxl + .xsl + .hxc + .hxt + .hxm + .resx + .hxe + .hxf + .hxv + .acctb + .accfl + .xaml + .ttml + .ddue + .sln + .props + .ps1xml + .csproj + .xsd + .svg + .clixml + .nuspec + .cdxml + .manifest + + + + Microsoft Word Documents + + .doc + .dot + .wiz + + + + Microsoft Access Database Compatible + + .mdb + .mda + .mde + .mpd + .mdt + + + + Microsoft PowerPoint Presentation + + .ppt + .pot + .pps + + + + Microsoft Publisher Files + + .pub + + + + Microsoft Excel Workbooks + + .xls + .xlt + + + + Pure Binary Files + + .com + .bin + .tlb + .drv + .fon + .blg + .gif + .png + .icns + .ico + .bmp + .pfx + + + + Localization resource databases + + .edb + .lcl + .xlf + .xliff + + + + Microsoft Project Files + + .mpp + .mpt + + + + Microsoft Visio Files + + .vsd + .vdx + .vss + .vst + + + + Windows Installer databases + + .msi + .msm + + + + Zip Files + + .zip + .accdt + .axtr + + + + Cabinet / MS Compression Files + + .cab + + + + Table driven IME lexicons + + .mb + + + + IME ( IMD ) Files + + .imd + + + + TrueType Font Files + + .ttf + + + + Microsoft Outlook Mail Files + + .msg + .oft + + + + HTML Help 2.0 Files / InfoTech5.x Storage System Files + + .its + .hxh + .hxr + .hxw + .hxi + .hxs + .hxq + + + + Adobe Acrobat PDF Files + + .pdf + + + + HTML Files / Web Page + + .htm + .dtd + .hhk + .htw + .asp + .htc + .htx + .html + .hhc + .css + .stm + + + + Rich Text Files + + .rtf + + + + Windows 3.x Write Files + + .wri + + + + MHTML Files + + .eml + .nws + .mht + + + + Word 2007 Files + + .docx + .docm + .dotx + .dotm + + + + Excel 2007 Files + + .xlsx + .xlsm + .xltx + .xltm + .xlsb + .xlam + + + + Power Point 2007 Files + + .pptx + .pptm + .potx + .potm + .ppsx + .ppsm + .ppam + + + + Access 2007 Files + + .accdb + .accde + .accdr + + + + Win32/64-based executable (image) Files + + .exe + .dll + .ocx + .scr + .acm + .rll + .cpl + .mui + .ax + .ime + + + + HTML Help 1.0 Files + + .chm + + + + LocStudio lsg + + .lsg + + + + Microsoft Office OneNote Files + + .one + .onepkg + + + + Custom Parsers + + + + + Visio 2011 Files + + .vstx + .vsdx + .vssx + + + + + diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index c99bebf39e..b5958ea059 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -192,11 +192,16 @@ task Package UpdateReadme, { # Change the package to have a static name for automation purposes Move-Item -Force .\$($script:PackageJson.name)-$($script:PackageJson.version).vsix .\PowerShell-insiders.vsix + + if ($env:TF_BUILD) { + Copy-Item -Verbose -Recurse "./PowerShell-insiders.vsix" "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/PowerShell-insiders.vsix" + Copy-Item -Verbose -Recurse "./scripts/Install-VSCode.ps1" "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/Install-VSCode.ps1" + } } #endregion # The set of tasks for a release -task Release Clean, Build, Test, Package +task Release Clean, Build, Package # The default task is to run the entire CI build task . CleanAll, BuildAll, Test, UpdatePackageJson, Package, UploadArtifacts From e7b87c05828953aaeb68d975560bcd38499a3037 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 19 Sep 2019 21:02:37 -0700 Subject: [PATCH 017/166] [ignore] last yml change (#2193) --- .vsts-ci/templates/release-general.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vsts-ci/templates/release-general.yml b/.vsts-ci/templates/release-general.yml index cce356d94c..263cf4f8fb 100644 --- a/.vsts-ci/templates/release-general.yml +++ b/.vsts-ci/templates/release-general.yml @@ -35,7 +35,8 @@ steps: pipeline: 1056 buildVersionToDownload: specific buildId: '$(PSES_BUILDID)' - downloadType: specific + downloadType: single + artifactName: 'PowerShellEditorServices' downloadPath: '$(Build.SourcesDirectory)' - pwsh: | From 28bd9071082cab020a62539674ad153e51fc6504 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Fri, 20 Sep 2019 10:22:25 -0700 Subject: [PATCH 018/166] [ignore] ship on monday --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8848025796..aa75427a6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # PowerShell Preview Extension Release History ## v2019.9.0 -### Wednesday, September 18, 2019 +### Monday, September 23, 2019 #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - 👷 [vscode-powershell #1961](https://github.com/PowerShell/vscode-powershell/pull/1961) - From 3c4791d6b441fbf0249b41886cb1174344220970 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 23 Sep 2019 09:04:04 -0700 Subject: [PATCH 019/166] [ignore] update ISE compatibility link (#2204) --- docs/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 5f064c5be5..caa16fd15d 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -23,7 +23,7 @@ the experience of the PowerShell ISE. However, we do want to support compatibility whenever possible to do so without breaking existing functionality. -Please see [the ISE compatibility doc](./ise_compatibility.md) +Please see [the ISE compatibility doc](https://docs.microsoft.com/powershell/scripting/components/vscode/how-to-replicate-the-ise-experience-in-vscode) for ways to configure VSCode to be closer to the ISE. Bear in mind that many of the UI/UX aspects of VSCode are driven by From 325a00d4b87669b9742becef28532ace7040ac23 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 24 Sep 2019 16:09:02 -0700 Subject: [PATCH 020/166] [Ignore] Update changelog and ADS script (#2209) --- tools/changelog/updateChangelog.ps1 | 2 +- tools/postReleaseScripts/updateAzureDataStudio.ps1 | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/changelog/updateChangelog.ps1 b/tools/changelog/updateChangelog.ps1 index daf0fefd9f..1323e5e1e4 100644 --- a/tools/changelog/updateChangelog.ps1 +++ b/tools/changelog/updateChangelog.ps1 @@ -299,7 +299,7 @@ $cloneParams = @{ CheckoutBranch = $branchName CloneBranch = $PsesBaseBranch Clobber = $true - Remotes = @{ 'upstream' = "https://github.com/$TargetFork/$vscodeRepoName" } + Remotes = @{ 'upstream' = "https://github.com/$TargetFork/$psesRepoName" } } Copy-GitRepository @cloneParams -Verbose:$VerbosePreference diff --git a/tools/postReleaseScripts/updateAzureDataStudio.ps1 b/tools/postReleaseScripts/updateAzureDataStudio.ps1 index b82fee6eed..3db678f1c8 100644 --- a/tools/postReleaseScripts/updateAzureDataStudio.ps1 +++ b/tools/postReleaseScripts/updateAzureDataStudio.ps1 @@ -16,6 +16,10 @@ param( [string[]] $GalleryFileName = ('extensionsGallery.json','extensionsGallery-insider.json'), + [Parameter()] + [string] + $SourceFork = 'rjmholt', + [Parameter()] [string] $TargetFork = 'Microsoft', @@ -52,7 +56,7 @@ function NewReleaseVersionEntry files = @( [ordered]@{ assetType = 'Microsoft.VisualStudio.Services.VSIXPackage' - source = "https://sqlopsextensions.blob.core.windows.net/extensions/powershell/PowerShell-$Version.vsix" + source = "https://sqlopsextensions.blob.core.windows.net/extensions/powershell/ms-vscode.PowerShell-$Version.vsix" } [ordered]@{ assetType = 'Microsoft.VisualStudio.Services.Icons.Default' @@ -244,7 +248,7 @@ function UpdateGalleryFile $repoLocation = Join-Path ([System.IO.Path]::GetTempPath()) 'ads-temp-checkout' $cloneParams = @{ - OriginRemote = 'https://github.com/rjmholt/AzureDataStudio' + OriginRemote = "https://github.com/$SourceFork/AzureDataStudio" Destination = $repoLocation CloneBranch = 'release/extensions' CheckoutBranch = $branchName @@ -271,6 +275,6 @@ $prParams = @{ Title = "Update PowerShell extension to v$ExtensionVersion" Description = $PRDescription GitHubToken = $GitHubToken - FromOrg = 'rjmholt' + FromOrg = $SourceFork } New-GitHubPR @prParams From 9c4e65f9d5c14c98804b766d8293ee76f0054f76 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2019 15:46:42 -0700 Subject: [PATCH 021/166] Bump @types/node-fetch from 2.5.0 to 2.5.2 (#2207) Bumps [@types/node-fetch](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node-fetch) from 2.5.0 to 2.5.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node-fetch) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0cb0c489c..ce20b2deb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,9 +45,9 @@ "dev": true }, "@types/node-fetch": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.0.tgz", - "integrity": "sha512-TLFRywthBgL68auWj+ziWu+vnmmcHCDFC/sqCOQf1xTz4hRq8cu79z8CtHU9lncExGBsB8fXA4TiLDLt6xvMzw==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.2.tgz", + "integrity": "sha512-djYYKmdNRSBtL1x4CiE9UJb9yZhwtI1VC+UxZD0psNznrUj80ywsxKlEGAE+QL1qvLjPbfb24VosjkYM6W4RSQ==", "dev": true, "requires": { "@types/node": "*" diff --git a/package.json b/package.json index 08189d7f86..fbb93d38d8 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "devDependencies": { "@types/mocha": "~5.2.7", "@types/node": "~10.11.0", - "@types/node-fetch": "^2.5.0", + "@types/node-fetch": "^2.5.2", "@types/rewire": "^2.5.28", "@types/semver": "^6.0.2", "mocha": "~5.2.0", From 661a9ee07804bc1fa513fa2fe95cc48f4ae5a582 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 2 Oct 2019 17:13:07 -0700 Subject: [PATCH 022/166] don't delete the session file to fix restart capability. (#2223) --- src/debugAdapter.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/debugAdapter.ts b/src/debugAdapter.ts index 5fca22b01a..1e7d0e6a41 100644 --- a/src/debugAdapter.ts +++ b/src/debugAdapter.ts @@ -35,9 +35,9 @@ function startDebugging() { // the connection details for the debug service const sessionDetails = utils.readSessionFile(debugSessionFilePath); - // Delete the session file after it has been read so that - // it isn't used mistakenly by another debug session - utils.deleteSessionFile(debugSessionFilePath); + // TODO: store session details into an in-memory store that can be shared between + // the debug adapter and client extension + // and then clean up the session details file. // Establish connection before setting up the session debugAdapterLogWriter.write("Connecting to pipe: " + sessionDetails.debugServicePipeName + "\r\n"); From fcc13c17bfedd500b155cccda1865f1bac63f545 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 3 Oct 2019 15:07:55 -0700 Subject: [PATCH 023/166] Changes needed for Omnisharp migration of PowerShellEditorServices (#2226) * everything needed so far (#2118) * Needed changes due to lack of support for strings over the wire. (#2150) * everything needed so far * needed changes due to lack of support for strings over the wire --- src/features/DebugSession.ts | 2 +- src/features/DocumentFormatter.ts | 356 ------------------------------ src/features/ExpandAlias.ts | 6 +- src/features/GetCommands.ts | 6 +- src/features/ShowHelp.ts | 10 +- src/main.ts | 2 - src/session.ts | 12 +- 7 files changed, 18 insertions(+), 376 deletions(-) delete mode 100644 src/features/DocumentFormatter.ts diff --git a/src/features/DebugSession.ts b/src/features/DebugSession.ts index 4c092f2f6e..f38dd885c4 100644 --- a/src/features/DebugSession.ts +++ b/src/features/DebugSession.ts @@ -570,7 +570,7 @@ export class PickRunspaceFeature implements IFeature { } private pickRunspace(processId): Thenable { - return this.languageClient.sendRequest(GetRunspaceRequestType, processId).then((response) => { + return this.languageClient.sendRequest(GetRunspaceRequestType, { processId }).then((response) => { const items: IRunspaceItem[] = []; for (const runspace of response) { diff --git a/src/features/DocumentFormatter.ts b/src/features/DocumentFormatter.ts deleted file mode 100644 index cb801fa5dd..0000000000 --- a/src/features/DocumentFormatter.ts +++ /dev/null @@ -1,356 +0,0 @@ -/*--------------------------------------------------------- - * Copyright (C) Microsoft Corporation. All rights reserved. - *--------------------------------------------------------*/ - -import * as path from "path"; -import vscode = require("vscode"); -import { - CancellationToken, - DocumentFormattingEditProvider, - DocumentRangeFormattingEditProvider, - FormattingOptions, - OnTypeFormattingEditProvider, - Position, - Range, - TextDocument, - TextEdit, - TextEditor, - TextLine, -} from "vscode"; -import { - DocumentFormattingRequest, - DocumentRangeFormattingParams, - DocumentRangeFormattingRequest, - DocumentSelector, - LanguageClient, - RequestType, -} from "vscode-languageclient"; -import { TextDocumentIdentifier } from "vscode-languageserver-types"; -import Window = vscode.window; -import * as AnimatedStatusBar from "../controls/animatedStatusBar"; -import { IFeature } from "../feature"; -import { Logger } from "../logging"; -import * as Settings from "../settings"; -import * as Utils from "../utils"; - -export const ScriptRegionRequestType = new RequestType("powerShell/getScriptRegion"); - -interface IScriptRegionRequestParams { - fileUri: string; - character: string; - line: number; - column: number; -} - -interface IScriptRegionRequestResult { - scriptRegion: IScriptRegion; -} - -interface IScriptRegion { - file: string; - text: string; - startLineNumber: number; - startColumnNumber: number; - startOffset: number; - endLineNumber: number; - endColumnNumber: number; - endOffset: number; -} - -function toRange(scriptRegion: IScriptRegion): vscode.Range { - return new vscode.Range( - scriptRegion.startLineNumber - 1, - scriptRegion.startColumnNumber - 1, - scriptRegion.endLineNumber - 1, - scriptRegion.endColumnNumber - 1); -} - -function toOneBasedPosition(position: Position): Position { - return position.translate({ lineDelta: 1, characterDelta: 1 }); -} - -class DocumentLocker { - // tslint:disable-next-line:ban-types - private lockedDocuments: Object; - - constructor() { - this.lockedDocuments = new Object(); - } - - public isLocked(document: TextDocument): boolean { - return this.isLockedInternal(this.getKey(document)); - } - - public lock(document: TextDocument, unlockWhenDone?: Thenable): void { - this.lockInternal(this.getKey(document), unlockWhenDone); - } - - public unlock(document: TextDocument): void { - this.unlockInternal(this.getKey(document)); - } - - public unlockAll(): void { - Object.keys(this.lockedDocuments).slice().forEach((documentKey) => this.unlockInternal(documentKey)); - } - - private getKey(document: TextDocument): string { - return document.uri.toString(); - } - - private lockInternal(documentKey: string, unlockWhenDone?: Thenable): void { - if (!this.isLockedInternal(documentKey)) { - this.lockedDocuments[documentKey] = true; - } - - if (unlockWhenDone !== undefined) { - unlockWhenDone.then(() => this.unlockInternal(documentKey)); - } - } - - private unlockInternal(documentKey: string): void { - if (this.isLockedInternal(documentKey)) { - delete this.lockedDocuments[documentKey]; - } - } - - private isLockedInternal(documentKey: string): boolean { - return this.lockedDocuments.hasOwnProperty(documentKey); - } -} - -class PSDocumentFormattingEditProvider implements - DocumentFormattingEditProvider, - DocumentRangeFormattingEditProvider, - OnTypeFormattingEditProvider { - - private static documentLocker = new DocumentLocker(); - private static statusBarTracker = new Object(); - - private static showStatusBar(document: TextDocument, hideWhenDone: Thenable): void { - const statusBar = - AnimatedStatusBar.showAnimatedStatusBarMessage("Formatting PowerShell document", hideWhenDone); - this.statusBarTracker[document.uri.toString()] = statusBar; - hideWhenDone.then(() => { - this.disposeStatusBar(document.uri.toString()); - }); - } - - private static disposeStatusBar(documentUri: string) { - if (this.statusBarTracker.hasOwnProperty(documentUri)) { - this.statusBarTracker[documentUri].dispose(); - delete this.statusBarTracker[documentUri]; - } - } - - private static disposeAllStatusBars() { - Object.keys(this.statusBarTracker).slice().forEach((key) => this.disposeStatusBar(key)); - } - - private languageClient: LanguageClient; - - private get emptyPromise(): Promise { - return Promise.resolve(TextEdit[0]); - } - - constructor(private logger: Logger) { - } - - public setLanguageClient(languageClient: LanguageClient): void { - this.languageClient = languageClient; - - // setLanguageClient is called while restarting a session, - // so this makes sure we clean up the document locker and - // any residual status bars - PSDocumentFormattingEditProvider.documentLocker.unlockAll(); - PSDocumentFormattingEditProvider.disposeAllStatusBars(); - } - - public provideDocumentFormattingEdits( - document: TextDocument, - options: FormattingOptions, - token: CancellationToken): TextEdit[] | Thenable { - - this.logger.writeVerbose(`Formatting entire document - ${document.uri}...`); - return this.sendDocumentFormatRequest(document, null, options, token); - } - - public provideDocumentRangeFormattingEdits( - document: TextDocument, - range: Range, - options: FormattingOptions, - token: CancellationToken): TextEdit[] | Thenable { - - this.logger.writeVerbose(`Formatting document range ${JSON.stringify(range)} - ${document.uri}...`); - return this.sendDocumentFormatRequest(document, range, options, token); - } - - public provideOnTypeFormattingEdits( - document: TextDocument, - position: Position, - ch: string, - options: FormattingOptions, - token: CancellationToken): TextEdit[] | Thenable { - - this.logger.writeVerbose(`Formatting on type at position ${JSON.stringify(position)} - ${document.uri}...`); - - return this.getScriptRegion(document, position, ch).then((scriptRegion) => { - if (scriptRegion === null) { - this.logger.writeVerbose("No formattable range returned."); - return this.emptyPromise; - } - - return this.sendDocumentFormatRequest( - document, - toRange(scriptRegion), - options, - token); - }, - (err) => { - this.logger.writeVerbose(`Error while requesting script region for formatting: ${err}`); - }); - } - - private sendDocumentFormatRequest( - document: TextDocument, - range: Range, - options: FormattingOptions, - token: CancellationToken): TextEdit[] | Thenable { - - const editor: TextEditor = this.getEditor(document); - if (editor === undefined) { - return this.emptyPromise; - } - - // Check if the document is already being formatted. - // If so, then ignore the formatting request. - if (this.isDocumentLocked(document)) { - return this.emptyPromise; - } - - // somehow range object gets serialized to an array of Position objects, - // so we need to use the object literal syntax to initialize it. - let rangeParam = null; - if (range != null) { - rangeParam = { - start: { - line: range.start.line, - character: range.start.character, - }, - end: { - line: range.end.line, - character: range.end.character, - }, - }; - } - - const requestParams: DocumentRangeFormattingParams = { - textDocument: TextDocumentIdentifier.create(document.uri.toString()), - range: rangeParam, - options: this.getEditorSettings(editor), - }; - - const formattingStartTime = new Date().valueOf(); - function getFormattingDuration() { - return ((new Date().valueOf()) - formattingStartTime) / 1000; - } - - const textEdits = this.languageClient.sendRequest( - DocumentRangeFormattingRequest.type, - requestParams); - this.lockDocument(document, textEdits); - PSDocumentFormattingEditProvider.showStatusBar(document, textEdits); - - return this.logAndReturnTextEdits(textEdits, getFormattingDuration); - } - - // There is something about having this code in the calling method that causes a TS compile error. - // It causes the following error: - // Type 'import("C:/Users/Keith/GitHub/rkeithhill/vscode-powershell/node_modules/vscode-languageserver-typ...' - // is not assignable to type ''vscode'.TextEdit'. Property 'newEol' is missing in type 'TextEdit'. - private logAndReturnTextEdits( - textEdits, - getFormattingDuration: () => number): vscode.TextEdit[] | Thenable { - - return textEdits.then((edits) => { - this.logger.writeVerbose(`Document formatting finished in ${getFormattingDuration()}s`); - return edits; - }, (err) => { - this.logger.writeVerbose(`Document formatting failed in ${getFormattingDuration()}: ${err}`); - }); - } - - private getScriptRegion(document: TextDocument, position: Position, ch: string): Thenable { - const oneBasedPosition = toOneBasedPosition(position); - return this.languageClient.sendRequest( - ScriptRegionRequestType, - { - fileUri: document.uri.toString(), - character: ch, - line: oneBasedPosition.line, - column: oneBasedPosition.character, - }).then((result: IScriptRegionRequestResult) => { - if (result === null) { - return null; - } - - return result.scriptRegion; - }); - } - - private getEditor(document: TextDocument): TextEditor { - return Window.visibleTextEditors.find((e, n, obj) => e.document === document); - } - - private isDocumentLocked(document: TextDocument): boolean { - return PSDocumentFormattingEditProvider.documentLocker.isLocked(document); - } - - private lockDocument(document: TextDocument, unlockWhenDone: Thenable): void { - PSDocumentFormattingEditProvider.documentLocker.lock(document, unlockWhenDone); - } - - private getEditorSettings(editor: TextEditor): { insertSpaces: boolean, tabSize: number } { - // Writing the editor options allows string or strong types going in, but always - // resolves to an appropriate value on read. - return { - insertSpaces: editor.options.insertSpaces as boolean, - tabSize: editor.options.tabSize as number, - }; - } -} - -export class DocumentFormatterFeature implements IFeature { - private firstTriggerCharacter: string = "}"; - private moreTriggerCharacters: string[] = ["\n"]; - private formattingEditProvider: vscode.Disposable; - private rangeFormattingEditProvider: vscode.Disposable; - private onTypeFormattingEditProvider: vscode.Disposable; - private languageClient: LanguageClient; - private documentFormattingEditProvider: PSDocumentFormattingEditProvider; - - constructor(private logger: Logger, documentSelector: DocumentSelector) { - this.documentFormattingEditProvider = new PSDocumentFormattingEditProvider(logger); - this.formattingEditProvider = vscode.languages.registerDocumentFormattingEditProvider( - documentSelector, - this.documentFormattingEditProvider); - this.rangeFormattingEditProvider = vscode.languages.registerDocumentRangeFormattingEditProvider( - documentSelector, - this.documentFormattingEditProvider); - this.onTypeFormattingEditProvider = vscode.languages.registerOnTypeFormattingEditProvider( - documentSelector, - this.documentFormattingEditProvider, - this.firstTriggerCharacter, - ...this.moreTriggerCharacters); - } - - public dispose(): any { - this.formattingEditProvider.dispose(); - this.rangeFormattingEditProvider.dispose(); - this.onTypeFormattingEditProvider.dispose(); - } - - public setLanguageClient(languageclient: LanguageClient): void { - this.languageClient = languageclient; - this.documentFormattingEditProvider.setLanguageClient(languageclient); - } -} diff --git a/src/features/ExpandAlias.ts b/src/features/ExpandAlias.ts index dd1872ff90..ec1568e098 100644 --- a/src/features/ExpandAlias.ts +++ b/src/features/ExpandAlias.ts @@ -8,7 +8,7 @@ import { LanguageClient, NotificationType, RequestType } from "vscode-languagecl import { IFeature } from "../feature"; import { Logger } from "../logging"; -export const ExpandAliasRequestType = new RequestType("powerShell/expandAlias"); +export const ExpandAliasRequestType = new RequestType("powerShell/expandAlias"); export class ExpandAliasFeature implements IFeature { private command: vscode.Disposable; @@ -39,9 +39,9 @@ export class ExpandAliasFeature implements IFeature { range = new vscode.Range(sls.line, sls.character, sle.line, sle.character); } - this.languageClient.sendRequest(ExpandAliasRequestType, text).then((result) => { + this.languageClient.sendRequest(ExpandAliasRequestType, { text }).then((result) => { editor.edit((editBuilder) => { - editBuilder.replace(range, result); + editBuilder.replace(range, result.text); }); }); }); diff --git a/src/features/GetCommands.ts b/src/features/GetCommands.ts index b109c74e73..12fff1d453 100644 --- a/src/features/GetCommands.ts +++ b/src/features/GetCommands.ts @@ -2,7 +2,7 @@ * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ import * as vscode from "vscode"; -import { LanguageClient, RequestType } from "vscode-languageclient"; +import { LanguageClient, RequestType0 } from "vscode-languageclient"; import { IFeature } from "../feature"; import { Logger } from "../logging"; @@ -18,7 +18,7 @@ interface ICommand { * RequestType sent over to PSES. * Expects: ICommand to be returned */ -export const GetCommandRequestType = new RequestType("powerShell/getCommand"); +export const GetCommandRequestType = new RequestType0("powerShell/getCommand"); /** * A PowerShell Command listing feature. Implements a treeview control. @@ -63,7 +63,7 @@ export class GetCommandsFeature implements IFeature { this.log.writeVerbose(`<${GetCommandsFeature.name}>: Unable to send getCommand request`); return; } - this.languageClient.sendRequest(GetCommandRequestType, "").then((result) => { + this.languageClient.sendRequest(GetCommandRequestType).then((result) => { const SidebarConfig = vscode.workspace.getConfiguration("powershell.sideBar"); const excludeFilter = (SidebarConfig.CommandExplorerExcludeFilter).map((filter) => filter.toLowerCase()); result = result.filter((command) => (excludeFilter.indexOf(command.moduleName.toLowerCase()) === -1)); diff --git a/src/features/ShowHelp.ts b/src/features/ShowHelp.ts index 3322a43f66..fd185eb05a 100644 --- a/src/features/ShowHelp.ts +++ b/src/features/ShowHelp.ts @@ -3,12 +3,12 @@ *--------------------------------------------------------*/ import vscode = require("vscode"); -import { LanguageClient, NotificationType, RequestType } from "vscode-languageclient"; +import { LanguageClient, NotificationType } from "vscode-languageclient"; import { IFeature } from "../feature"; import { Logger } from "../logging"; -export const ShowHelpRequestType = - new RequestType("powerShell/showHelp"); +export const ShowHelpNotificationType = + new NotificationType("powerShell/showHelp"); export class ShowHelpFeature implements IFeature { private command: vscode.Disposable; @@ -31,9 +31,9 @@ export class ShowHelpFeature implements IFeature { const cwr = doc.getWordRangeAtPosition(selection.active); const text = doc.getText(cwr); - this.languageClient.sendRequest(ShowHelpRequestType, text); + this.languageClient.sendNotification(ShowHelpNotificationType, { text }); } else { - this.languageClient.sendRequest(ShowHelpRequestType, item.Name); + this.languageClient.sendNotification(ShowHelpNotificationType, { text: item.Name } ); } }); } diff --git a/src/main.ts b/src/main.ts index dd6148df42..b88886f9ca 100644 --- a/src/main.ts +++ b/src/main.ts @@ -16,7 +16,6 @@ import { DebugSessionFeature } from "./features/DebugSession"; import { PickPSHostProcessFeature } from "./features/DebugSession"; import { PickRunspaceFeature } from "./features/DebugSession"; import { SpecifyScriptArgsFeature } from "./features/DebugSession"; -import { DocumentFormatterFeature } from "./features/DocumentFormatter"; import { ExamplesFeature } from "./features/Examples"; import { ExpandAliasFeature } from "./features/ExpandAlias"; import { ExtensionCommandsFeature } from "./features/ExtensionCommands"; @@ -155,7 +154,6 @@ export function activate(context: vscode.ExtensionContext): void { new SelectPSSARulesFeature(logger), new CodeActionsFeature(logger), new NewFileOrProjectFeature(), - new DocumentFormatterFeature(logger, documentSelector), new RemoteFilesFeature(), new DebugSessionFeature(context, sessionManager), new PickPSHostProcessFeature(), diff --git a/src/session.ts b/src/session.ts index 5a0598f287..78e0482a1c 100644 --- a/src/session.ts +++ b/src/session.ts @@ -352,15 +352,15 @@ export class SessionManager implements Middleware { codeLensToFix.command.arguments = [ vscode.Uri.parse(oldArgs[0]), - new vscode.Position(oldArgs[1].line, oldArgs[1].character), + new vscode.Position(oldArgs[1].Line, oldArgs[1].Character), oldArgs[2].map((position) => { return new vscode.Location( - vscode.Uri.parse(position.uri), + vscode.Uri.parse(position.Uri), new vscode.Range( - position.range.start.line, - position.range.start.character, - position.range.end.line, - position.range.end.character)); + position.Range.Start.Line, + position.Range.Start.Character, + position.Range.End.Line, + position.Range.End.Character)); }), ]; } From 3f915b6be1a2e27dc11d37d957c5254693ffb048 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Mon, 7 Oct 2019 09:47:07 -0700 Subject: [PATCH 024/166] Fix version check in Install-VSCode.ps1 (#2232) Fix https://github.com/PowerShell/vscode-powershell/issues/2229 --- scripts/Install-VSCode.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Install-VSCode.ps1 b/scripts/Install-VSCode.ps1 index 46c3ca8049..b01ae29212 100644 --- a/scripts/Install-VSCode.ps1 +++ b/scripts/Install-VSCode.ps1 @@ -460,7 +460,7 @@ if (($IsLinux -or $IsMacOS) -and (id -u) -ne 0) { } # User builds can only be installed on Windows systems -if ($BuildEdition.EndsWith('User') -and -not ($IsWindows -or $PSVersionTable.PSVersion.Major -lt 5)) { +if ($BuildEdition.EndsWith('User') -and -not ($IsWindows -or $PSVersionTable.PSVersion.Major -lt 6)) { throw 'User builds are not available for non-Windows systems' } From 7df727d74404b00dfa5b36d356ca9558dc2654f3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2019 14:07:32 -0700 Subject: [PATCH 025/166] Bump vsce from 1.66.0 to 1.67.1 (#2233) Bumps [vsce](https://github.com/Microsoft/vsce) from 1.66.0 to 1.67.1. - [Release notes](https://github.com/Microsoft/vsce/releases) - [Commits](https://github.com/Microsoft/vsce/compare/v1.66.0...v1.67.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index ce20b2deb2..2671b59fb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1536,9 +1536,9 @@ }, "dependencies": { "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true } } @@ -2148,9 +2148,9 @@ } }, "vsce": { - "version": "1.66.0", - "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.66.0.tgz", - "integrity": "sha512-Zf4+WD4PhEcOr7jkU08SI9lwFqDhmhk73YOCGQ/tNLaBy+PnnX4eSdqj9LdzDLuI2dsyomJLXzDSNgxuaInxCQ==", + "version": "1.67.1", + "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.67.1.tgz", + "integrity": "sha512-Y/0fnfaLs2cCfytTGmy4Cp1bf9BaxHO7020YePdUwxjAlPlZ9+lm74M9yEFEWXTIug0L0sMax1WMz0TnozIqxg==", "dev": true, "requires": { "azure-devops-node-api": "^7.2.0", @@ -2176,9 +2176,9 @@ }, "dependencies": { "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "tmp": { diff --git a/package.json b/package.json index fbb93d38d8..f370412556 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "rewire": "~4.0.1", "tslint": "~5.20.0", "typescript": "~3.5.3", - "vsce": "~1.66.0", + "vsce": "~1.67.1", "vscode": "~1.1.36" }, "extensionDependencies": [ From 5f1257c0a191338f94155185549cf13dfbd85cfc Mon Sep 17 00:00:00 2001 From: James Pogran Date: Wed, 16 Oct 2019 15:19:01 -0400 Subject: [PATCH 026/166] Provide Run Selection button in Editor Title Menu (#2224) * Provide Run Selection button in Editor Title Menu This commit adds a editor title menu button for the `powershell.RunSelection` command in the primary navigation group, and a custom `play` icon based on ones from the https://github.com/microsoft/vscode-icons repo. This shows the button in the visible part of the menu when a PowerShell file is open. --- package.json | 27 ++++++++++++++++++++++++++- resources/dark/play.svg | 5 +++++ resources/dark/run.svg | 3 +++ resources/light/play.svg | 5 +++++ resources/light/run.svg | 3 +++ 5 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 resources/dark/play.svg create mode 100644 resources/dark/run.svg create mode 100644 resources/light/play.svg create mode 100644 resources/light/run.svg diff --git a/package.json b/package.json index f370412556..06f5035c99 100644 --- a/package.json +++ b/package.json @@ -161,10 +161,23 @@ }, "category": "PowerShell" }, + { + "command": "workbench.action.debug.start", + "title": "Run", + "category": "PowerShell", + "icon": { + "light": "resources/light/run.svg", + "dark": "resources/dark/run.svg" + } + }, { "command": "PowerShell.RunSelection", "title": "Run Selection", - "category": "PowerShell" + "category": "PowerShell", + "icon": { + "light": "resources/light/play.svg", + "dark": "resources/dark/play.svg" + } }, { "command": "PowerShell.RestartSession", @@ -260,6 +273,18 @@ "group": "2_powershell" } ], + "editor/title": [ + { + "when": "resourceLangId == powershell", + "command": "workbench.action.debug.start", + "group": "navigation@100" + }, + { + "when": "resourceLangId == powershell", + "command": "PowerShell.RunSelection", + "group": "navigation@101" + } + ], "editor/title/context": [ { "when": "resourceFilename =~ /\\.tests\\.ps1$/i", diff --git a/resources/dark/play.svg b/resources/dark/play.svg new file mode 100644 index 0000000000..464ef5147e --- /dev/null +++ b/resources/dark/play.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/dark/run.svg b/resources/dark/run.svg new file mode 100644 index 0000000000..8b0a58eca9 --- /dev/null +++ b/resources/dark/run.svg @@ -0,0 +1,3 @@ + + + diff --git a/resources/light/play.svg b/resources/light/play.svg new file mode 100644 index 0000000000..6f479653b5 --- /dev/null +++ b/resources/light/play.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/light/run.svg b/resources/light/run.svg new file mode 100644 index 0000000000..2563bfa114 --- /dev/null +++ b/resources/light/run.svg @@ -0,0 +1,3 @@ + + + From 4b0b965fb42239303b1e05e9d83e31f568f1f5fc Mon Sep 17 00:00:00 2001 From: James Pogran Date: Wed, 16 Oct 2019 15:19:51 -0400 Subject: [PATCH 027/166] Surface Invoke Registered Editor Command (#2225) This commit allows the `PowerShell.InvokeRegisteredEditorCommand` command to be accessible to the user in the Command Palette. --- package.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package.json b/package.json index 06f5035c99..d58547a887 100644 --- a/package.json +++ b/package.json @@ -248,6 +248,11 @@ "command": "PowerShell.OpenExamplesFolder", "title": "Open Examples Folder", "category": "PowerShell" + }, + { + "command": "PowerShell.InvokeRegisteredEditorCommand", + "title": "Invoke Registered Editor Command", + "category": "PowerShell" } ], "menus": { @@ -259,6 +264,10 @@ { "command": "PowerShell.RefreshCommandsExplorer", "when": "config.powershell.sideBar.CommandExplorerVisibility" + }, + { + "command": "PowerShell.InvokeRegisteredEditorCommand", + "when": "false" } ], "editor/context": [ From 3e16efd6a41734fcd18cc6c7b4a743256219e19d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2019 13:35:02 -0700 Subject: [PATCH 028/166] Bump vsce from 1.67.1 to 1.68.0 (#2248) Bumps [vsce](https://github.com/Microsoft/vsce) from 1.67.1 to 1.68.0. - [Release notes](https://github.com/Microsoft/vsce/releases) - [Commits](https://github.com/Microsoft/vsce/compare/v1.67.1...v1.68.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2671b59fb2..c33f09d492 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2148,9 +2148,9 @@ } }, "vsce": { - "version": "1.67.1", - "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.67.1.tgz", - "integrity": "sha512-Y/0fnfaLs2cCfytTGmy4Cp1bf9BaxHO7020YePdUwxjAlPlZ9+lm74M9yEFEWXTIug0L0sMax1WMz0TnozIqxg==", + "version": "1.68.0", + "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.68.0.tgz", + "integrity": "sha512-yFbRYu4x4GbdQzZdEQQeRJBxgPdummgcUOFHUtnclW8XQl3MTuKgXL3TtI09gb5oq7jE6kdyvBmpBcmDGsmhcQ==", "dev": true, "requires": { "azure-devops-node-api": "^7.2.0", diff --git a/package.json b/package.json index d58547a887..71f290a420 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "rewire": "~4.0.1", "tslint": "~5.20.0", "typescript": "~3.5.3", - "vsce": "~1.67.1", + "vsce": "~1.68.0", "vscode": "~1.1.36" }, "extensionDependencies": [ From ae720894b581cfc7b144bb39873067e51c423625 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 28 Oct 2019 16:12:06 -0700 Subject: [PATCH 029/166] Fix tests by using API Key for CI (#2255) * Fix tests by using API Key for CI * new lines so codacy is happy * better logging of errors * tslint * refactor to more concise code --- src/features/UpdatePowerShell.ts | 35 +++++++++++++++++++++++--------- src/session.ts | 3 ++- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/features/UpdatePowerShell.ts b/src/features/UpdatePowerShell.ts index ab7caf5a40..5252e11f65 100644 --- a/src/features/UpdatePowerShell.ts +++ b/src/features/UpdatePowerShell.ts @@ -2,7 +2,7 @@ * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ -import fetch from "node-fetch"; +import fetch, { RequestInit } from "node-fetch"; import * as semver from "semver"; import { MessageItem, window } from "vscode"; import { LanguageClient } from "vscode-languageclient"; @@ -16,18 +16,33 @@ const PowerShellGitHubPrereleasesUrl = export class GitHubReleaseInformation { public static async FetchLatestRelease(preview: boolean): Promise { + const requestConfig: RequestInit = {}; + + // For CI. This prevents GitHub from rate limiting us. + if (process.env.PS_TEST_GITHUB_API_USERNAME && process.env.PS_TEST_GITHUB_API_PAT) { + const authHeaderValue = Buffer + .from(`${process.env.PS_TEST_GITHUB_API_USERNAME}:${process.env.PS_TEST_GITHUB_API_PAT}`) + .toString("base64"); + requestConfig.headers = { + Authorization: `Basic ${authHeaderValue}`, + }; + } + // Fetch the latest PowerShell releases from GitHub. - let releaseJson: any; - if (preview) { - // This gets all releases and the first one is the latest prerelease if - // there is a prerelease version. - releaseJson = (await fetch(PowerShellGitHubPrereleasesUrl) - .then((res) => res.json())).find((release: any) => release.prerelease); - } else { - releaseJson = await fetch(PowerShellGitHubReleasesUrl) - .then((res) => res.json()); + const response = await fetch( + preview ? PowerShellGitHubPrereleasesUrl : PowerShellGitHubReleasesUrl, + requestConfig); + + if (!response.ok) { + const json = await response.json(); + throw json.message || json || "response was not ok."; } + // For preview, we grab all the releases and then grab the first prerelease. + const releaseJson = preview + ? (await response.json()).find((release: any) => release.prerelease) + : await response.json(); + return new GitHubReleaseInformation( releaseJson.tag_name, releaseJson.assets); } diff --git a/src/session.ts b/src/session.ts index 78e0482a1c..6de4882965 100644 --- a/src/session.ts +++ b/src/session.ts @@ -591,8 +591,9 @@ export class SessionManager implements Middleware { localVersion, this.versionDetails.architecture, release); - } catch { + } catch (e) { // best effort. This probably failed to fetch the data from GitHub. + this.log.writeWarning(e.message); } }); From fb0551f8cb2cee8961beabc171c39de1f30afbbf Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2019 16:30:21 -0700 Subject: [PATCH 030/166] Bump @types/semver from 6.0.2 to 6.2.0 (#2257) Bumps [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) from 6.0.2 to 6.2.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index c33f09d492..51081f0d30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,9 +60,9 @@ "dev": true }, "@types/semver": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.0.2.tgz", - "integrity": "sha512-G1Ggy7/9Nsa1Jt2yiBR2riEuyK2DFNnqow6R7cromXPMNynackRY1vqFTLz/gwnef1LHokbXThcPhqMRjUbkpQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.0.tgz", + "integrity": "sha512-1OzrNb4RuAzIT7wHSsgZRlMBlNsJl+do6UblR7JMW4oB7bbR+uBEYtUh7gEc/jM84GGilh68lSOokyM/zNUlBA==", "dev": true }, "acorn": { diff --git a/package.json b/package.json index 71f290a420..4da5a73421 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@types/node": "~10.11.0", "@types/node-fetch": "^2.5.2", "@types/rewire": "^2.5.28", - "@types/semver": "^6.0.2", + "@types/semver": "^6.2.0", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.1", "mocha-multi-reporters": "~1.1.7", From d76f2e2c9d85c1f5840b2568940ad47d3e79a22d Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Tue, 29 Oct 2019 16:45:03 -0700 Subject: [PATCH 031/166] Discover new PowerShell installations, fix startup issue with Windows PowerShell (#2238) * Fix original startup issue * Create PowerShell searcher class for reuse * Find MSIX/Store and dotnet global tool installations * Disable .NET global tool discovery until its ready * Change startup order to present most relevant first * Refactor tests to make it easier to test multiple configurations * Offer PowerShell installation link when no PowerShell is found --- .vscode/launch.json | 8 +- package-lock.json | 145 ++++++++++ package.json | 10 +- src/logging.ts | 23 ++ src/platform.ts | 589 ++++++++++++++++++++++++++----------- src/session.ts | 285 +++++++++--------- test/platform.test.ts | 660 ++++++++++++++++++++++++++++++++++++------ 7 files changed, 1317 insertions(+), 403 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index f53cedf458..155db9a086 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -32,7 +32,13 @@ "stopOnEntry": false, "sourceMaps": true, "outFiles": ["${workspaceRoot}/out/test/**/*.js"], - "preLaunchTask": "Build" + "preLaunchTask": "Build", + "skipFiles": [ + "${workspaceFolder}/node_modules/**/*", + "${workspaceFolder}/lib/**/*", + "/private/var/folders/**/*", + "/**/*" + ] }, { "name": "Attach", diff --git a/package-lock.json b/package-lock.json index 51081f0d30..250eaa6423 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,12 +32,65 @@ } } }, + "@sinonjs/commons": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.6.0.tgz", + "integrity": "sha512-w4/WHG7C4WWFyE5geCieFJF6MZkbW4VAriol5KlmQXpAQdxvV0p26sqNZOW6Qyw6Y0l9K4g+cHvvczR2sEEpqg==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/formatio": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.2.tgz", + "integrity": "sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1", + "@sinonjs/samsam": "^3.1.0" + } + }, + "@sinonjs/samsam": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz", + "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.3.0", + "array-from": "^2.1.1", + "lodash": "^4.17.15" + }, + "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + } + } + }, + "@sinonjs/text-encoding": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", + "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", + "dev": true + }, "@types/mocha": { "version": "5.2.7", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", "dev": true }, + "@types/mock-fs": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@types/mock-fs/-/mock-fs-4.10.0.tgz", + "integrity": "sha512-FQ5alSzmHMmliqcL36JqIA4Yyn9jyJKvRSGV3mvPh108VFatX7naJDzSG4fnFQNZFq9dIx0Dzoe6ddflMB2Xkg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/node": { "version": "10.11.7", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.11.7.tgz", @@ -65,6 +118,12 @@ "integrity": "sha512-1OzrNb4RuAzIT7wHSsgZRlMBlNsJl+do6UblR7JMW4oB7bbR+uBEYtUh7gEc/jM84GGilh68lSOokyM/zNUlBA==", "dev": true }, + "@types/sinon": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.0.tgz", + "integrity": "sha512-NyzhuSBy97B/zE58cDw4NyGvByQbAHNP9069KVSgnXt/sc0T6MFRh0InKAeBVHJWdSXG1S3+PxgVIgKo9mTHbw==", + "dev": true + }, "acorn": { "version": "5.7.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", @@ -153,6 +212,12 @@ "sprintf-js": "~1.0.2" } }, + "array-from": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", + "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", + "dev": true + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -1253,6 +1318,12 @@ "verror": "1.10.0" } }, + "just-extend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", + "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", + "dev": true + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -1278,6 +1349,12 @@ "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", "dev": true }, + "lolex": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", + "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==", + "dev": true + }, "lru-cache": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", @@ -1422,6 +1499,12 @@ "lodash": "^4.16.4" } }, + "mock-fs": { + "version": "4.10.2", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.2.tgz", + "integrity": "sha512-ewPQ83O4U8/Gd8I15WoB6vgTTmq5khxBskUWCRvswUqjCfOOTREmxllztQOm+PXMWUxATry+VBWXQJloAyxtbQ==", + "dev": true + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -1440,6 +1523,19 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "nise": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.2.tgz", + "integrity": "sha512-/6RhOUlicRCbE9s+94qCUsyE+pKlVJ5AhIv+jEE7ESKwnbXqulKZ1FYU+XAtHHWE9TinYvAxDUJAb912PwPoWA==", + "dev": true, + "requires": { + "@sinonjs/formatio": "^3.2.1", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "lolex": "^4.1.0", + "path-to-regexp": "^1.7.0" + } + }, "node-fetch": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", @@ -1570,6 +1666,23 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "dev": true, + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -1836,6 +1949,32 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "sinon": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.5.0.tgz", + "integrity": "sha512-AoD0oJWerp0/rY9czP/D6hDTTUYGpObhZjMpd7Cl/A6+j0xBE+ayL/ldfggkBXUs0IkvIiM1ljM8+WkOc5k78Q==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.4.0", + "@sinonjs/formatio": "^3.2.1", + "@sinonjs/samsam": "^3.3.3", + "diff": "^3.5.0", + "lolex": "^4.2.0", + "nise": "^1.5.2", + "supports-color": "^5.5.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "slice-ansi": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", @@ -2065,6 +2204,12 @@ "prelude-ls": "~1.1.2" } }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, "typed-rest-client": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.2.0.tgz", diff --git a/package.json b/package.json index 4da5a73421..c142503f58 100644 --- a/package.json +++ b/package.json @@ -48,14 +48,18 @@ }, "devDependencies": { "@types/mocha": "~5.2.7", + "@types/mock-fs": "~4.10.0", "@types/node": "~10.11.0", - "@types/node-fetch": "^2.5.2", - "@types/rewire": "^2.5.28", - "@types/semver": "^6.2.0", + "@types/node-fetch": "~2.5.2", + "@types/rewire": "~2.5.28", + "@types/semver": "~6.0.2", + "@types/sinon": "~7.5.0", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.1", "mocha-multi-reporters": "~1.1.7", + "mock-fs": "~4.10.2", "rewire": "~4.0.1", + "sinon": "~7.5.0", "tslint": "~5.20.0", "typescript": "~3.5.3", "vsce": "~1.68.0", diff --git a/src/logging.ts b/src/logging.ts index 62d26a56a4..5faf83df35 100644 --- a/src/logging.ts +++ b/src/logging.ts @@ -114,6 +114,29 @@ export class Logger implements ILogger { }); } + public async writeAndShowErrorWithActions( + message: string, + actions: Array<{ prompt: string; action: () => Promise }>) { + this.writeError(message); + + const fullActions = [ + ...actions, + { prompt: "Show Logs", action: async () => { this.showLogPanel(); } }, + ]; + + const actionKeys: string[] = fullActions.map((action) => action.prompt); + + const choice = await vscode.window.showErrorMessage(message, ...actionKeys); + if (choice) { + for (const action of fullActions) { + if (choice === action.prompt) { + await action.action(); + return; + } + } + } + } + public startNewLog(minimumLogLevel: string = "Normal") { this.MinimumLogLevel = this.logLevelNameToValue(minimumLogLevel.trim()); diff --git a/src/platform.ts b/src/platform.ts index 2cede17892..2ade340989 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -2,19 +2,24 @@ * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ -import fs = require("fs"); -import path = require("path"); -import process = require("process"); -import Settings = require("./settings"); +import * as child_process from "child_process"; +import * as fs from "fs"; +import * as os from "os"; +import * as path from "path"; +import * as process from "process"; +import { IPowerShellAdditionalExePathSettings } from "./settings"; -const linuxExePath = "/usr/bin/pwsh"; -const linuxPreviewExePath = "/usr/bin/pwsh-preview"; +const WindowsPowerShell64BitLabel = "Windows PowerShell (x64)"; +const WindowsPowerShell32BitLabel = "Windows PowerShell (x86)"; -const snapExePath = "/snap/bin/pwsh"; -const snapPreviewExePath = "/snap/bin/pwsh-preview"; +const LinuxExePath = "/usr/bin/pwsh"; +const LinuxPreviewExePath = "/usr/bin/pwsh-preview"; -const macOSExePath = "/usr/local/bin/pwsh"; -const macOSPreviewExePath = "/usr/local/bin/pwsh-preview"; +const SnapExePath = "/snap/bin/pwsh"; +const SnapPreviewExePath = "/snap/bin/pwsh-preview"; + +const MacOSExePath = "/usr/local/bin/pwsh"; +const MacOSPreviewExePath = "/usr/local/bin/pwsh-preview"; export enum OperatingSystem { Unknown, @@ -30,8 +35,8 @@ export interface IPlatformDetails { } export interface IPowerShellExeDetails { - versionName: string; - exePath: string; + readonly displayName: string; + readonly exePath: string; } export function getPlatformDetails(): IPlatformDetails { @@ -55,196 +60,436 @@ export function getPlatformDetails(): IPlatformDetails { } /** - * Gets the default instance of PowerShell for the specified platform. - * On Windows, the default version of PowerShell is "Windows PowerShell". - * @param platformDetails Specifies information about the platform - primarily the operating system. - * @param use32Bit On Windows, this boolean determines whether the 32-bit version of Windows PowerShell is returned. - * @returns A string containing the path of the default version of PowerShell. + * Class to lazily find installed PowerShell executables on a machine. + * When given a list of additional PowerShell executables, + * this will also surface those at the end of the list. */ -export function getDefaultPowerShellPath( - platformDetails: IPlatformDetails, - use32Bit: boolean = false): string | null { - - let powerShellExePath; - let psCoreInstallPath; - - // Find the path to the powershell executable based on the current platform - // and the user's desire to run the x86 version of PowerShell - if (platformDetails.operatingSystem === OperatingSystem.Windows) { - if (use32Bit) { - psCoreInstallPath = - (platformDetails.isProcess64Bit ? process.env["ProgramFiles(x86)"] : process.env.ProgramFiles) - + "\\PowerShell"; - } else { - psCoreInstallPath = - (platformDetails.isProcess64Bit ? process.env.ProgramFiles : process.env.ProgramW6432) + "\\PowerShell"; - } - - if (fs.existsSync(psCoreInstallPath)) { - const arch = platformDetails.isProcess64Bit ? "(x64)" : "(x86)"; - const psCorePaths = - fs.readdirSync(psCoreInstallPath) - .map((item) => path.join(psCoreInstallPath, item)) - .filter((item) => { - const exePath = path.join(item, "pwsh.exe"); - return fs.lstatSync(item).isDirectory() && fs.existsSync(exePath); - }) - .map((item) => ({ - versionName: `PowerShell ${path.parse(item).base} ${arch}`, - exePath: path.join(item, "pwsh.exe"), - })); - - if (psCorePaths) { - return powerShellExePath = psCorePaths[0].exePath; +export class PowerShellExeFinder { + // This is required, since parseInt("7-preview") will return 7. + private static IntRegex: RegExp = /^\d+$/; + + private static PwshMsixRegex: RegExp = /^Microsoft.PowerShell_.*/; + + private static PwshPreviewMsixRegex: RegExp = /^Microsoft.PowerShellPreview_.*/; + + // The platform details descriptor for the platform we're on + private readonly platformDetails: IPlatformDetails; + + // Additional configured PowerShells + private readonly additionalPSExeSettings: Iterable; + + private winPS: IPossiblePowerShellExe; + + private alternateBitnessWinPS: IPossiblePowerShellExe; + + /** + * Create a new PowerShellFinder object to discover PowerShell installations. + * @param platformDetails Information about the machine we are running on. + * @param additionalPowerShellExes Additional PowerShell installations as configured in the settings. + */ + constructor( + platformDetails?: IPlatformDetails, + additionalPowerShellExes?: Iterable) { + + this.platformDetails = platformDetails || getPlatformDetails(); + this.additionalPSExeSettings = additionalPowerShellExes || []; + } + + /** + * Returns the first available PowerShell executable found in the search order. + */ + public getFirstAvailablePowerShellInstallation(): IPowerShellExeDetails { + for (const pwsh of this.enumeratePowerShellInstallations()) { + return pwsh; + } + } + + /** + * Get an array of all PowerShell executables found when searching for PowerShell installations. + */ + public getAllAvailablePowerShellInstallations(): IPowerShellExeDetails[] { + return Array.from(this.enumeratePowerShellInstallations()); + } + + /** + * Fixes PowerShell paths when Windows PowerShell is set to the non-native bitness. + * @param configuredPowerShellPath the PowerShell path configured by the user. + */ + public fixWindowsPowerShellPath(configuredPowerShellPath: string): string { + const lowerConfiguredPath = configuredPowerShellPath.toLocaleLowerCase(); + const lowerAltWinPSPath = this.alternateBitnessWinPS.exePath.toLocaleLowerCase(); + + if (lowerConfiguredPath === lowerAltWinPSPath) { + return this.winPS.exePath; + } + + return configuredPowerShellPath; + } + + /** + * Iterates through PowerShell installations on the machine according + * to configuration passed in through the constructor. + * PowerShell items returned by this object are verified + * to exist on the filesystem. + */ + public *enumeratePowerShellInstallations(): Iterable { + // Get the default PowerShell installations first + for (const defaultPwsh of this.enumerateDefaultPowerShellInstallations()) { + if (defaultPwsh && defaultPwsh.exists()) { + yield defaultPwsh; } } - // No PowerShell 6+ detected so use Windows PowerShell. - if (use32Bit) { - return platformDetails.isOS64Bit && platformDetails.isProcess64Bit - ? SysWow64PowerShellPath - : System32PowerShellPath; + // Also show any additionally configured PowerShells + // These may be duplicates of the default installations, but given a different name. + for (const additionalPwsh of this.enumerateAdditionalPowerShellInstallations()) { + if (additionalPwsh && additionalPwsh.exists()) { + yield additionalPwsh; + } } - return !platformDetails.isOS64Bit || platformDetails.isProcess64Bit - ? System32PowerShellPath - : SysnativePowerShellPath; } - if (platformDetails.operatingSystem === OperatingSystem.MacOS) { - // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed - powerShellExePath = macOSExePath; - if (!fs.existsSync(macOSExePath) && fs.existsSync(macOSPreviewExePath)) { - powerShellExePath = macOSPreviewExePath; + + /** + * Iterates through all the possible well-known PowerShell installations on a machine. + * Returned values may not exist, but come with an .exists property + * which will check whether the executable exists. + */ + private *enumerateDefaultPowerShellInstallations(): Iterable { + // Find PSCore stable first + yield this.findPSCoreStable(); + + switch (this.platformDetails.operatingSystem) { + case OperatingSystem.Linux: + // On Linux, find the snap + yield this.findPSCoreStableSnap(); + break; + + case OperatingSystem.Windows: + // Windows may have a 32-bit pwsh.exe + yield this.findPSCoreWindowsInstallation({ useAlternateBitness: true }); + + // Also look for the MSIX/UWP installation + yield this.findPSCoreMsix(); + + break; + } + + // TODO: + // Enable this when the global tool has been updated + // to support proper argument passing. + // Currently it cannot take startup arguments to start PSES with. + // + // Look for the .NET global tool + // yield this.pwshDotnetGlobalTool; + + // Look for PSCore preview + yield this.findPSCorePreview(); + + switch (this.platformDetails.operatingSystem) { + // On Linux, there might be a preview snap + case OperatingSystem.Linux: + yield this.findPSCorePreviewSnap(); + break; + + case OperatingSystem.Windows: + // Find a preview MSIX + yield this.findPSCoreMsix({ findPreview: true }); + + // Look for pwsh-preview with the opposite bitness + yield this.findPSCoreWindowsInstallation({ useAlternateBitness: true, findPreview: true }); + + // Finally, get Windows PowerShell + + // Get the natural Windows PowerShell for the process bitness + yield this.findWinPS(); + + // Get the alternate bitness Windows PowerShell + yield this.findWinPS({ useAlternateBitness: true }); + + break; + } } - } else if (platformDetails.operatingSystem === OperatingSystem.Linux) { - // Always default to the stable version of PowerShell (if installed) but handle case of only Preview installed - // as well as the Snaps case - https://snapcraft.io/ - powerShellExePath = linuxExePath; - if (!fs.existsSync(linuxExePath) && fs.existsSync(linuxPreviewExePath)) { - powerShellExePath = linuxPreviewExePath; - } else if (fs.existsSync(snapExePath)) { - powerShellExePath = snapExePath; - } else if (fs.existsSync(snapPreviewExePath)) { - powerShellExePath = snapPreviewExePath; + + /** + * Iterates through the configured additonal PowerShell executable locations, + * without checking for their existence. + */ + private *enumerateAdditionalPowerShellInstallations(): Iterable { + for (const additionalPwshSetting of this.additionalPSExeSettings) { + yield new PossiblePowerShellExe(additionalPwshSetting.exePath, additionalPwshSetting.versionName); } } - return powerShellExePath; -} + private findPSCoreStable(): IPossiblePowerShellExe { + switch (this.platformDetails.operatingSystem) { + case OperatingSystem.Linux: + return new PossiblePowerShellExe(LinuxExePath, "PowerShell"); -export function getWindowsSystemPowerShellPath(systemFolderName: string) { - return `${process.env.windir}\\${systemFolderName}\\WindowsPowerShell\\v1.0\\powershell.exe`; -} + case OperatingSystem.MacOS: + return new PossiblePowerShellExe(MacOSExePath, "PowerShell"); + + case OperatingSystem.Windows: + return this.findPSCoreWindowsInstallation(); + } + } + + private findPSCorePreview(): IPossiblePowerShellExe { + switch (this.platformDetails.operatingSystem) { + case OperatingSystem.Linux: + return new PossiblePowerShellExe(LinuxPreviewExePath, "PowerShell Preview"); -export const System32PowerShellPath = getWindowsSystemPowerShellPath("System32"); -export const SysnativePowerShellPath = getWindowsSystemPowerShellPath("Sysnative"); -export const SysWow64PowerShellPath = getWindowsSystemPowerShellPath("SysWow64"); + case OperatingSystem.MacOS: + return new PossiblePowerShellExe(MacOSPreviewExePath, "PowerShell Preview"); -export const WindowsPowerShell64BitLabel = "Windows PowerShell (x64)"; -export const WindowsPowerShell32BitLabel = "Windows PowerShell (x86)"; + case OperatingSystem.Windows: + return this.findPSCoreWindowsInstallation({ findPreview: true }); + } + } -const powerShell64BitPathOn32Bit = SysnativePowerShellPath.toLocaleLowerCase(); -const powerShell32BitPathOn64Bit = SysWow64PowerShellPath.toLocaleLowerCase(); + private findPSCoreDotnetGlobalTool(): IPossiblePowerShellExe { + const exeName: string = this.platformDetails.operatingSystem === OperatingSystem.Windows + ? "pwsh.exe" + : "pwsh"; -export function fixWindowsPowerShellPath(powerShellExePath: string, platformDetails: IPlatformDetails): string { - const lowerCasedPath = powerShellExePath.toLocaleLowerCase(); + const dotnetGlobalToolExePath: string = path.join(os.homedir(), ".dotnet", "tools", exeName); - if ((platformDetails.isProcess64Bit && (lowerCasedPath === powerShell64BitPathOn32Bit)) || - (!platformDetails.isProcess64Bit && (lowerCasedPath === powerShell32BitPathOn64Bit))) { - return System32PowerShellPath; + return new PossiblePowerShellExe(dotnetGlobalToolExePath, ".NET Core PowerShell Global Tool"); } - // If the path doesn't need to be fixed, return the original - return powerShellExePath; -} + private findPSCoreMsix({ findPreview }: { findPreview?: boolean } = {}): IPossiblePowerShellExe { + // We can't proceed if there's no LOCALAPPDATA path + if (!process.env.LOCALAPPDATA) { + return null; + } -/** - * Gets a list of all available PowerShell instance on the specified platform. - * @param platformDetails Specifies information about the platform - primarily the operating system. - * @param sessionSettings Specifies the user/workspace settings. Additional PowerShell exe paths loaded from settings. - * @returns An array of IPowerShellExeDetails objects with the PowerShell name & exe path for each instance found. - */ -export function getAvailablePowerShellExes( - platformDetails: IPlatformDetails, - sessionSettings: Settings.ISettings | undefined): IPowerShellExeDetails[] { - - let paths: IPowerShellExeDetails[] = []; - - if (platformDetails.operatingSystem === OperatingSystem.Windows) { - if (platformDetails.isProcess64Bit) { - paths.push({ - versionName: WindowsPowerShell64BitLabel, - exePath: System32PowerShellPath, - }); - - paths.push({ - versionName: WindowsPowerShell32BitLabel, - exePath: SysWow64PowerShellPath, - }); - } else { - if (platformDetails.isOS64Bit) { - paths.push({ - versionName: WindowsPowerShell64BitLabel, - exePath: SysnativePowerShellPath, - }); + // Find the base directory for MSIX application exe shortcuts + const msixAppDir = path.join(process.env.LOCALAPPDATA, "Microsoft", "WindowsApps"); + + if (!fs.existsSync(msixAppDir)) { + return null; + } + + // Define whether we're looking for the preview or the stable + const { pwshMsixDirRegex, pwshMsixName } = findPreview + ? { pwshMsixDirRegex: PowerShellExeFinder.PwshPreviewMsixRegex, pwshMsixName: "PowerShell Preview (Store)" } + : { pwshMsixDirRegex: PowerShellExeFinder.PwshMsixRegex, pwshMsixName: "PowerShell (Store)" }; + + // We should find only one such application, so return on the first one + for (const subdir of fs.readdirSync(msixAppDir)) { + if (pwshMsixDirRegex.test(subdir)) { + const pwshMsixPath = path.join(msixAppDir, subdir, "pwsh.exe"); + return new PossiblePowerShellExe(pwshMsixPath, pwshMsixName); } + } - paths.push({ - versionName: WindowsPowerShell32BitLabel, - exePath: System32PowerShellPath, - }); - } - - const psCoreInstallPath = - (!platformDetails.isProcess64Bit ? process.env.ProgramW6432 : process.env.ProgramFiles) + "\\PowerShell"; - - if (fs.existsSync(psCoreInstallPath)) { - const arch = platformDetails.isProcess64Bit ? "(x64)" : "(x86)"; - const psCorePaths = - fs.readdirSync(psCoreInstallPath) - .map((item) => path.join(psCoreInstallPath, item)) - .filter((item) => { - const exePath = path.join(item, "pwsh.exe"); - return fs.lstatSync(item).isDirectory() && fs.existsSync(exePath); - }) - .map((item) => ({ - versionName: `PowerShell ${path.parse(item).base} ${arch}`, - exePath: path.join(item, "pwsh.exe"), - })); - - if (psCorePaths) { - paths = paths.concat(psCorePaths); + // If we find nothing, return null + return null; + } + + private findPSCoreStableSnap(): IPossiblePowerShellExe { + return new PossiblePowerShellExe(SnapExePath, "PowerShell Snap"); + } + + private findPSCorePreviewSnap(): IPossiblePowerShellExe { + return new PossiblePowerShellExe(SnapPreviewExePath, "PowerShell Preview Snap"); + } + + private findPSCoreWindowsInstallation( + { useAlternateBitness = false, findPreview = false }: + { useAlternateBitness?: boolean; findPreview?: boolean } = {}): IPossiblePowerShellExe { + + const programFilesPath: string = this.getProgramFilesPath({ useAlternateBitness }); + + if (!programFilesPath) { + return null; + } + + const powerShellInstallBaseDir = path.join(programFilesPath, "PowerShell"); + + // Ensure the base directory exists + if (!(fs.existsSync(powerShellInstallBaseDir) && fs.lstatSync(powerShellInstallBaseDir).isDirectory())) { + return null; + } + + let highestSeenVersion: number = -1; + let pwshExePath: string = null; + for (const item of fs.readdirSync(powerShellInstallBaseDir)) { + + let currentVersion: number = -1; + if (findPreview) { + // We are looking for something like "7-preview" + + // Preview dirs all have dashes in them + const dashIndex = item.indexOf("-"); + if (dashIndex < 0) { + continue; + } + + // Verify that the part before the dash is an integer + const intPart: string = item.substring(0, dashIndex); + if (!PowerShellExeFinder.IntRegex.test(intPart)) { + continue; + } + + // Verify that the part after the dash is "preview" + if (item.substring(dashIndex + 1) !== "preview") { + continue; + } + + currentVersion = parseInt(intPart, 10); + } else { + // Search for a directory like "6" or "7" + if (!PowerShellExeFinder.IntRegex.test(item)) { + continue; + } + + currentVersion = parseInt(item, 10); + } + + // Ensure we haven't already seen a higher version + if (currentVersion <= highestSeenVersion) { + continue; + } + + // Now look for the file + const exePath = path.join(powerShellInstallBaseDir, item, "pwsh.exe"); + if (!fs.existsSync(exePath)) { + continue; } + + pwshExePath = exePath; + highestSeenVersion = currentVersion; + } + + if (!pwshExePath) { + return null; } - } else { - // Handle Linux and macOS case - let exePaths: string[]; - if (platformDetails.operatingSystem === OperatingSystem.Linux) { - exePaths = [ linuxExePath, snapExePath, linuxPreviewExePath, snapPreviewExePath ]; - } else { - exePaths = [ macOSExePath, macOSPreviewExePath ]; + const bitness: string = programFilesPath.includes("x86") + ? "(x86)" + : "(x64)"; + + const preview: string = findPreview ? " Preview" : ""; + + return new PossiblePowerShellExe(pwshExePath, `PowerShell${preview} ${bitness}`); + } + + private findWinPS({ useAlternateBitness = false }: { useAlternateBitness?: boolean } = {}): IPossiblePowerShellExe { + + // 32-bit OSes only have one WinPS on them + if (!this.platformDetails.isOS64Bit && useAlternateBitness) { + return null; } - exePaths.forEach((exePath) => { - if (fs.existsSync(exePath)) { - paths.push({ - versionName: "PowerShell" + (/-preview/.test(exePath) ? " Preview" : ""), - exePath, - }); + let winPS = useAlternateBitness ? this.alternateBitnessWinPS : this.winPS; + if (winPS === undefined) { + const systemFolderPath: string = this.getSystem32Path({ useAlternateBitness }); + + const winPSPath = path.join(systemFolderPath, "WindowsPowerShell", "v1.0", "powershell.exe"); + + let displayName: string; + if (this.platformDetails.isProcess64Bit) { + displayName = useAlternateBitness + ? WindowsPowerShell32BitLabel + : WindowsPowerShell64BitLabel; + } else if (this.platformDetails.isOS64Bit) { + displayName = useAlternateBitness + ? WindowsPowerShell64BitLabel + : WindowsPowerShell32BitLabel; + } else { + displayName = WindowsPowerShell32BitLabel; + } + + winPS = new PossiblePowerShellExe(winPSPath, displayName, { knownToExist: true }); + + if (useAlternateBitness) { + this.alternateBitnessWinPS = winPS; + } else { + this.winPS = winPS; } - }); + } + + return winPS; } - // When unit testing, we don't have session settings available to test, so skip reading this setting - if (sessionSettings) { - // Add additional PowerShell paths as configured in settings - for (const additionalPowerShellExePath of sessionSettings.powerShellAdditionalExePaths) { - paths.push({ - versionName: additionalPowerShellExePath.versionName, - exePath: additionalPowerShellExePath.exePath, - }); + private getProgramFilesPath( + { useAlternateBitness = false }: { useAlternateBitness?: boolean } = {}): string | null { + + if (!useAlternateBitness) { + // Just use the native system bitness + return process.env.ProgramFiles; } + + // We might be a 64-bit process looking for 32-bit program files + if (this.platformDetails.isProcess64Bit) { + return process.env["ProgramFiles(x86)"]; + } + + // We might be a 32-bit process looking for 64-bit program files + if (this.platformDetails.isOS64Bit) { + return process.env.ProgramW6432; + } + + // We're a 32-bit process on 32-bit Windows, there is no other Program Files dir + return null; } - return paths; + private getSystem32Path({ useAlternateBitness = false }: { useAlternateBitness?: boolean } = {}): string | null { + const windir: string = process.env.windir; + + if (!useAlternateBitness) { + // Just use the native system bitness + return path.join(windir, "System32"); + } + + // We might be a 64-bit process looking for 32-bit system32 + if (this.platformDetails.isProcess64Bit) { + return path.join(windir, "SysWOW64"); + } + + // We might be a 32-bit process looking for 64-bit system32 + if (this.platformDetails.isOS64Bit) { + return path.join(windir, "Sysnative"); + } + + // We're on a 32-bit Windows, so no alternate bitness + return null; + } +} + +export function getWindowsSystemPowerShellPath(systemFolderName: string) { + return path.join( + process.env.windir, + systemFolderName, + "WindowsPowerShell", + "v1.0", + "powershell.exe"); +} + +interface IPossiblePowerShellExe extends IPowerShellExeDetails { + exists(): boolean; +} + +class PossiblePowerShellExe implements IPossiblePowerShellExe { + public readonly exePath: string; + public readonly displayName: string; + + private knownToExist: boolean; + + constructor( + pathToExe: string, + installationName: string, + { knownToExist = false }: { knownToExist?: boolean } = {}) { + + this.exePath = pathToExe; + this.displayName = installationName; + this.knownToExist = knownToExist || undefined; + } + + public exists(): boolean { + if (this.knownToExist === undefined) { + this.knownToExist = fs.existsSync(this.exePath); + } + return this.knownToExist; + } } diff --git a/src/session.ts b/src/session.ts index 6de4882965..4fb4186f92 100644 --- a/src/session.ts +++ b/src/session.ts @@ -5,7 +5,6 @@ import cp = require("child_process"); import fs = require("fs"); import net = require("net"); -import os = require("os"); import path = require("path"); import * as semver from "semver"; import vscode = require("vscode"); @@ -24,8 +23,8 @@ import { import { GitHubReleaseInformation, InvokePowerShellUpdateCheck } from "./features/UpdatePowerShell"; import { - fixWindowsPowerShellPath, getAvailablePowerShellExes, getDefaultPowerShellPath, - getPlatformDetails, IPlatformDetails, OperatingSystem } from "./platform"; + getPlatformDetails, IPlatformDetails, + OperatingSystem, PowerShellExeFinder } from "./platform"; export enum SessionStatus { NeverStarted, @@ -57,6 +56,9 @@ export class SessionManager implements Middleware { private bundledModulesPath: string; private telemetryReporter: TelemetryReporter; + // Initialized by the start() method, since this requires settings + private powershellExeFinder: PowerShellExeFinder; + // When in development mode, VS Code's session ID is a fake // value of "someValue.machineId". Use that to detect dev // mode for now until Microsoft/vscode#10272 gets implemented. @@ -71,6 +73,7 @@ export class SessionManager implements Middleware { private reporter: TelemetryReporter) { this.platformDetails = getPlatformDetails(); + this.HostVersion = version; this.telemetryReporter = reporter; @@ -104,55 +107,78 @@ export class SessionManager implements Middleware { public start() { this.sessionSettings = Settings.load(); + this.log.startNewLog(this.sessionSettings.developer.editorServicesLogLevel); + // Create the PowerShell executable finder now + this.powershellExeFinder = new PowerShellExeFinder( + this.platformDetails, + this.sessionSettings.powerShellAdditionalExePaths); + this.focusConsoleOnExecute = this.sessionSettings.integratedConsole.focusConsoleOnExecute; this.createStatusBarItem(); - this.powerShellExePath = this.getPowerShellExePath(); + try { + this.powerShellExePath = this.getPowerShellExePath(); + } catch (e) { + this.log.writeError(`Error occurred while searching for a PowerShell executable:\n${e}`); + } this.suppressRestartPrompt = false; - if (this.powerShellExePath) { + if (!this.powerShellExePath) { + const message = "Unable to find PowerShell." + + " Do you have PowerShell installed?" + + " You can also configure custom PowerShell installations" + + " with the 'powershell.powerShellAdditionalExePaths' setting."; + + this.log.writeAndShowErrorWithActions(message, [ + { + prompt: "Get PowerShell", + action: async () => { + const getPSUri = vscode.Uri.parse("https://aka.ms/get-powershell-vscode"); + vscode.env.openExternal(getPSUri); + }, + }, + ]); + return; + } - this.bundledModulesPath = path.resolve(__dirname, this.sessionSettings.bundledModulesPath); + this.bundledModulesPath = path.resolve(__dirname, this.sessionSettings.bundledModulesPath); - if (this.inDevelopmentMode) { - const devBundledModulesPath = - path.resolve( - __dirname, - this.sessionSettings.developer.bundledModulesPath); + if (this.inDevelopmentMode) { + const devBundledModulesPath = + path.resolve( + __dirname, + this.sessionSettings.developer.bundledModulesPath); - // Make sure the module's bin path exists - if (fs.existsSync(path.join(devBundledModulesPath, "PowerShellEditorServices/bin"))) { - this.bundledModulesPath = devBundledModulesPath; - } else { - this.log.write( - "\nWARNING: In development mode but PowerShellEditorServices dev module path cannot be " + - `found (or has not been built yet): ${devBundledModulesPath}\n`); - } + // Make sure the module's bin path exists + if (fs.existsSync(path.join(devBundledModulesPath, "PowerShellEditorServices/bin"))) { + this.bundledModulesPath = devBundledModulesPath; + } else { + this.log.write( + "\nWARNING: In development mode but PowerShellEditorServices dev module path cannot be " + + `found (or has not been built yet): ${devBundledModulesPath}\n`); } + } - this.editorServicesArgs = - `-HostName 'Visual Studio Code Host' ` + - `-HostProfileId 'Microsoft.VSCode' ` + - `-HostVersion '${this.HostVersion}' ` + - `-AdditionalModules @('PowerShellEditorServices.VSCode') ` + - `-BundledModulesPath '${PowerShellProcess.escapeSingleQuotes(this.bundledModulesPath)}' ` + - `-EnableConsoleRepl `; + this.editorServicesArgs = + `-HostName 'Visual Studio Code Host' ` + + `-HostProfileId 'Microsoft.VSCode' ` + + `-HostVersion '${this.HostVersion}' ` + + `-AdditionalModules @('PowerShellEditorServices.VSCode') ` + + `-BundledModulesPath '${PowerShellProcess.escapeSingleQuotes(this.bundledModulesPath)}' ` + + `-EnableConsoleRepl `; - if (this.sessionSettings.developer.editorServicesWaitForDebugger) { - this.editorServicesArgs += "-WaitForDebugger "; - } - if (this.sessionSettings.developer.editorServicesLogLevel) { - this.editorServicesArgs += `-LogLevel '${this.sessionSettings.developer.editorServicesLogLevel}' `; - } - - this.startPowerShell(); - } else { - this.setSessionFailure("PowerShell could not be started, click 'Show Logs' for more details."); + if (this.sessionSettings.developer.editorServicesWaitForDebugger) { + this.editorServicesArgs += "-WaitForDebugger "; } + if (this.sessionSettings.developer.editorServicesLogLevel) { + this.editorServicesArgs += `-LogLevel '${this.sessionSettings.developer.editorServicesLogLevel}' `; + } + + this.startPowerShell(); } public stop() { @@ -216,62 +242,16 @@ export class SessionManager implements Middleware { } public getPowerShellExePath(): string { - let powerShellExePath: string; - if (!this.sessionSettings.powerShellExePath && this.sessionSettings.developer.powerShellExePath) { // Show deprecation message with fix action. // We don't need to wait on this to complete // because we can finish gathering the configured // PowerShell path without the fix - vscode - .window - .showWarningMessage( - "The 'powershell.developer.powerShellExePath' setting is deprecated, use " + - "'powershell.powerShellExePath' instead.", - "Fix Automatically") - .then((choice) => { - if (choice) { - this.suppressRestartPrompt = true; - Settings - .change( - "powerShellExePath", - this.sessionSettings.developer.powerShellExePath, - true) - .then(() => { - return Settings.change( - "developer.powerShellExePath", - undefined, - true); - }) - .then(() => { - this.suppressRestartPrompt = false; - }); - } - }); + this.showExePathSettingDeprecationWarning(); } - // If powershell.powerShellDefaultVersion specified, attempt to find the PowerShell exe path - // of the version specified by the setting. - if ((this.sessionStatus === SessionStatus.NeverStarted) && this.sessionSettings.powerShellDefaultVersion) { - const powerShellExePaths = getAvailablePowerShellExes(this.platformDetails, this.sessionSettings); - const powerShellDefaultVersion = - powerShellExePaths.find((item) => item.versionName === this.sessionSettings.powerShellDefaultVersion); - - if (powerShellDefaultVersion) { - powerShellExePath = powerShellDefaultVersion.exePath; - } else { - this.log.writeWarning( - `Could not find powerShellDefaultVersion: '${this.sessionSettings.powerShellDefaultVersion}'`); - } - } - - // Is there a setting override for the PowerShell path? - powerShellExePath = - (powerShellExePath || - this.sessionSettings.powerShellExePath || - this.sessionSettings.developer.powerShellExePath || - "").trim(); + let powerShellExePath: string = this.getConfiguredPowerShellExePath().trim(); // New versions of PS Core uninstall the previous version // so make sure the path stored in the settings exists. @@ -282,54 +262,28 @@ export class SessionManager implements Middleware { powerShellExePath = ""; } - if (this.platformDetails.operatingSystem === OperatingSystem.Windows && - powerShellExePath.length > 0) { - - // Check the path bitness - const fixedPath = - fixWindowsPowerShellPath( - powerShellExePath, - this.platformDetails); - - if (fixedPath !== powerShellExePath) { - const bitness = this.platformDetails.isOS64Bit ? 64 : 32; - // Show deprecation message with fix action. - // We don't need to wait on this to complete - // because we can finish gathering the configured - // PowerShell path without the fix - vscode - .window - .showWarningMessage( - `The specified PowerShell path is incorrect for ${bitness}-bit VS Code, using '${fixedPath}' ` + - "instead.", - "Fix Setting Automatically") - .then((choice) => { - if (choice) { - this.suppressRestartPrompt = true; - Settings - .change( - "powerShellExePath", - this.sessionSettings.developer.powerShellExePath, - true) - .then(() => { - return Settings.change( - "developer.powerShellExePath", - undefined, - true); - }) - .then(() => { - this.suppressRestartPrompt = false; - }); - } - }); - - powerShellExePath = fixedPath; + if (powerShellExePath) { + if (this.platformDetails.operatingSystem === OperatingSystem.Windows) { + // Check the path bitness + const fixedPath = this.powershellExeFinder.fixWindowsPowerShellPath( + powerShellExePath); + + if (fixedPath !== powerShellExePath) { + // Show deprecation message with fix action. + // We don't need to wait on this to complete + // because we can finish gathering the configured + // PowerShell path without the fix + this.showBitnessPathFixWarning(fixedPath); + powerShellExePath = fixedPath; + } } + + return this.resolvePowerShellPath(powerShellExePath); } - return powerShellExePath.length > 0 - ? this.resolvePowerShellPath(powerShellExePath) - : getDefaultPowerShellPath(this.platformDetails, this.sessionSettings.useX86Host); + // No need to resolve this path, since the finder guarantees its existence + const firstPowerShell = this.powershellExeFinder.getFirstAvailablePowerShellInstallation(); + return firstPowerShell && firstPowerShell.exePath || null; } // ----- LanguageClient middleware methods ----- @@ -377,6 +331,66 @@ export class SessionManager implements Middleware { return resolvedCodeLens; } + private async showExePathSettingDeprecationWarning(): Promise { + const choice: string = await vscode.window.showWarningMessage( + "The 'powershell.developer.powerShellExePath' setting is deprecated, use " + + "'powershell.powerShellExePath' instead.", + "Fix Automatically"); + + if (!choice) { + return; + } + + this.suppressRestartPrompt = true; + await Settings.change("powerShellExePath", this.sessionSettings.developer.powerShellExePath, true); + await Settings.change("developer.powerShellExePath", undefined, true); + this.suppressRestartPrompt = false; + } + + private async showBitnessPathFixWarning(fixedPath: string): Promise { + const bitness = this.platformDetails.isOS64Bit ? "64" : "32"; + + const choice = await vscode.window.showWarningMessage( + `The specified PowerShell path is incorrect for ${bitness}-bit VS Code, using '${fixedPath}' instead.`, + "Fix Setting Automatically"); + + if (!choice) { + return; + } + + this.suppressRestartPrompt = true; + await Settings.change("powerShellExePath", this.sessionSettings.developer.powerShellExePath, true); + await Settings.change("developer.powerShellExePath", undefined, true); + this.suppressRestartPrompt = false; + } + + private getConfiguredPowerShellExePath(): string { + // If powershell.powerShellDefaultVersion specified, attempt to find the PowerShell exe path + // of the version specified by the setting. + if (this.sessionSettings.powerShellDefaultVersion && this.sessionStatus === SessionStatus.NeverStarted) { + for (const pwshExe of this.powershellExeFinder.enumeratePowerShellInstallations()) { + if (pwshExe.displayName === this.sessionSettings.powerShellDefaultVersion) { + return pwshExe.exePath; + } + } + + // Default PowerShell version was configured but we didn't find it + this.log.writeWarning( + `Could not find powerShellDefaultVersion: '${this.sessionSettings.powerShellDefaultVersion}'`); + } + + if (this.sessionSettings.powerShellExePath) { + return this.sessionSettings.powerShellExePath; + } + + if (this.sessionSettings.developer.powerShellExePath) { + this.showExePathSettingDeprecationWarning(); + return this.sessionSettings.developer.powerShellExePath; + } + + return ""; + } + private onConfigurationUpdated() { const settings = Settings.load(); @@ -687,8 +701,10 @@ export class SessionManager implements Middleware { // If the path does not exist, show an error if (!utils.checkIfFileExists(resolvedPath)) { - this.setSessionFailure( - "powershell.exe cannot be found or is not accessible at path " + resolvedPath); + const pwshPath = resolvedPath || powerShellExePath; + const pwshExeName = path.basename(pwshPath) || "PowerShell executable"; + + this.setSessionFailure(`${pwshExeName} cannot be found or is not accessible at path '${pwshPath}'`); return null; } @@ -730,8 +746,7 @@ export class SessionManager implements Middleware { private showSessionMenu() { const currentExePath = (this.powerShellExePath || "").toLowerCase(); - const availablePowerShellExes = - getAvailablePowerShellExes(this.platformDetails, this.sessionSettings); + const availablePowerShellExes = this.powershellExeFinder.getAllAvailablePowerShellInstallations(); let sessionText: string; @@ -747,7 +762,7 @@ export class SessionManager implements Middleware { const powerShellSessionName = currentPowerShellExe ? - currentPowerShellExe.versionName : + currentPowerShellExe.displayName : `PowerShell ${this.versionDetails.displayVersion} ` + `(${this.versionDetails.architecture}) ${this.versionDetails.edition} Edition ` + `[${this.versionDetails.version}]`; @@ -768,7 +783,7 @@ export class SessionManager implements Middleware { .filter((item) => item.exePath.toLowerCase() !== currentExePath) .map((item) => { return new SessionMenuItem( - `Switch to: ${item.versionName}`, + `Switch to: ${item.displayName}`, () => { this.changePowerShellExePath(item.exePath); }); }); diff --git a/test/platform.test.ts b/test/platform.test.ts index 398ca7560b..e141795029 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -3,119 +3,595 @@ *--------------------------------------------------------*/ import * as assert from "assert"; +import mockFS = require("mock-fs"); +import FileSystem = require("mock-fs/lib/filesystem"); +import * as path from "path"; +import * as sinon from "sinon"; import * as platform from "../src/platform"; -function checkDefaultPowerShellPath(platformDetails, expectedPath) { - test("returns correct default path", () => { - assert.equal( - platform.getDefaultPowerShellPath(platformDetails), - expectedPath); - }); +/** + * Describes a platform on which the PowerShell extension should work, + * including the test conditions (filesystem, environment variables). + */ +interface ITestPlatform { + name: string; + platformDetails: platform.IPlatformDetails; + filesystem: FileSystem.DirectoryItems; + environmentVars?: Record; } -function checkAvailableWindowsPowerShellPaths( - platformDetails: platform.IPlatformDetails, - expectedPaths: platform.IPowerShellExeDetails[]) { - test("correctly enumerates available Windows PowerShell paths", () => { - - // The system may return PowerShell Core paths so only - // enumerate the first list items. - const enumeratedPaths = platform.getAvailablePowerShellExes(platformDetails, undefined); - for (let i; i < expectedPaths.length; i++) { - assert.equal(enumeratedPaths[i], expectedPaths[i]); - } - }); +/** + * A platform where the extension should find a PowerShell, + * including the sequence of PowerShell installations that should be found. + * The expected default PowerShell is the first installation. + */ +interface ITestPlatformSuccessCase extends ITestPlatform { + expectedPowerShellSequence: platform.IPowerShellExeDetails[]; } -function checkFixedWindowsPowerShellpath(platformDetails, inputPath, expectedPath) { - test("fixes incorrect Windows PowerShell Sys* path", () => { - assert.equal( - platform.fixWindowsPowerShellPath(inputPath, platformDetails), - expectedPath); - }); -} +// Platform configurations where we expect to find a set of PowerShells +let successTestCases: ITestPlatformSuccessCase[]; -suite("Platform module", () => { - if (process.platform === "win32") { - suite("64-bit Windows, 64-bit VS Code", () => { - const platformDetails: platform.IPlatformDetails = { +let msixAppDir = null; +let pwshMsixPath = null; +let pwshPreviewMsixPath = null; +if (process.platform === "win32") { + msixAppDir = path.join(process.env.LOCALAPPDATA, "Microsoft", "WindowsApps"); + pwshMsixPath = path.join(msixAppDir, "Microsoft.PowerShell_8wekyb3d8bbwe", "pwsh.exe"); + pwshPreviewMsixPath = path.join(msixAppDir, "Microsoft.PowerShellPreview_8wekyb3d8bbwe", "pwsh.exe"); + + successTestCases = [ + { + name: "Windows 64-bit, 64-bit VSCode (all installations)", + platformDetails: { operatingSystem: platform.OperatingSystem.Windows, isOS64Bit: true, isProcess64Bit: true, - }; - - checkDefaultPowerShellPath( - platformDetails, - platform.System32PowerShellPath); - - checkAvailableWindowsPowerShellPaths( - platformDetails, - [ - { - versionName: platform.WindowsPowerShell64BitLabel, - exePath: platform.System32PowerShellPath, + }, + environmentVars: { + "ProgramFiles": "C:\\Program Files", + "ProgramFiles(x86)": "C:\\Program Files (x86)", + "windir": "C:\\WINDOWS", + }, + expectedPowerShellSequence: [ + { + exePath: "C:\\Program Files\\PowerShell\\6\\pwsh.exe", + displayName: "PowerShell (x64)", + }, + { + exePath: "C:\\Program Files (x86)\\PowerShell\\6\\pwsh.exe", + displayName: "PowerShell (x86)", + }, + { + exePath: pwshMsixPath, + displayName: "PowerShell (Store)", + }, + { + exePath: "C:\\Program Files\\PowerShell\\7-preview\\pwsh.exe", + displayName: "PowerShell Preview (x64)", + }, + { + exePath: pwshPreviewMsixPath, + displayName: "PowerShell Preview (Store)", + }, + { + exePath: "C:\\Program Files (x86)\\PowerShell\\7-preview\\pwsh.exe", + displayName: "PowerShell Preview (x86)", + }, + { + exePath: "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", + displayName: "Windows PowerShell (x64)", + }, + { + exePath: "C:\\WINDOWS\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe", + displayName: "Windows PowerShell (x86)", + }, + ], + filesystem: { + "C:\\Program Files\\PowerShell": { + "6": { + "pwsh.exe": "", }, - { - versionName: platform.WindowsPowerShell32BitLabel, - exePath: platform.SysWow64PowerShellPath, + "7-preview": { + "pwsh.exe": "", }, - ]); - - checkFixedWindowsPowerShellpath( - platformDetails, - platform.SysnativePowerShellPath, - platform.System32PowerShellPath); - }); - - suite("64-bit Windows, 32-bit VS Code", () => { - const platformDetails: platform.IPlatformDetails = { + }, + "C:\\Program Files (x86)\\PowerShell": { + "6": { + "pwsh.exe": "", + }, + "7-preview": { + "pwsh.exe": "", + }, + }, + [msixAppDir]: { + "Microsoft.PowerShell_8wekyb3d8bbwe": { + "pwsh.exe": "", + }, + "Microsoft.PowerShellPreview_8wekyb3d8bbwe": { + "pwsh.exe": "", + }, + }, + "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0": { + "powershell.exe": "", + }, + "C:\\WINDOWS\\SysWOW64\\WindowsPowerShell\\v1.0": { + "powershell.exe": "", + }, + }, + }, + { + name: "Windows 64-bit, 64-bit VSCode (only Windows PowerShell)", + platformDetails: { + operatingSystem: platform.OperatingSystem.Windows, + isOS64Bit: true, + isProcess64Bit: true, + }, + environmentVars: { + "ProgramFiles": "C:\\Program Files", + "ProgramFiles(x86)": "C:\\Program Files (x86)", + "windir": "C:\\WINDOWS", + }, + expectedPowerShellSequence: [ + { + exePath: "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", + displayName: "Windows PowerShell (x64)", + }, + { + exePath: "C:\\WINDOWS\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe", + displayName: "Windows PowerShell (x86)", + }, + ], + filesystem: { + "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0": { + "powershell.exe": "", + }, + "C:\\WINDOWS\\SysWOW64\\WindowsPowerShell\\v1.0": { + "powershell.exe": "", + }, + }, + }, + { + name: "Windows 64-bit, 32-bit VSCode (all installations)", + platformDetails: { operatingSystem: platform.OperatingSystem.Windows, isOS64Bit: true, isProcess64Bit: false, - }; - - checkDefaultPowerShellPath( - platformDetails, - "C:\\Program Files\\PowerShell\\6\\pwsh.exe"); - - checkAvailableWindowsPowerShellPaths( - platformDetails, - [ - { - versionName: platform.WindowsPowerShell64BitLabel, - exePath: platform.SysnativePowerShellPath, + }, + environmentVars: { + "ProgramFiles": "C:\\Program Files (x86)", + "ProgramFiles(x86)": "C:\\Program Files (x86)", + "windir": "C:\\WINDOWS", + }, + expectedPowerShellSequence: [ + { + exePath: "C:\\Program Files (x86)\\PowerShell\\6\\pwsh.exe", + displayName: "PowerShell (x86)", + }, + { + exePath: "C:\\Program Files\\PowerShell\\6\\pwsh.exe", + displayName: "PowerShell (x64)", + }, + { + exePath: pwshMsixPath, + displayName: "PowerShell (Store)", + }, + { + exePath: "C:\\Program Files (x86)\\PowerShell\\7-preview\\pwsh.exe", + displayName: "PowerShell Preview (x86)", + }, + { + exePath: pwshPreviewMsixPath, + displayName: "PowerShell Preview (Store)", + }, + { + exePath: "C:\\Program Files\\PowerShell\\7-preview\\pwsh.exe", + displayName: "PowerShell Preview (x64)", + }, + { + exePath: "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", + displayName: "Windows PowerShell (x86)", + }, + { + exePath: "C:\\WINDOWS\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe", + displayName: "Windows PowerShell (x64)", + }, + ], + filesystem: { + "C:\\Program Files\\PowerShell": { + "6": { + "pwsh.exe": "", }, - { - versionName: platform.WindowsPowerShell32BitLabel, - exePath: platform.System32PowerShellPath, + "7-preview": { + "pwsh.exe": "", }, - ]); - - checkFixedWindowsPowerShellpath( - platformDetails, - platform.SysWow64PowerShellPath, - platform.System32PowerShellPath); - }); - - suite("32-bit Windows, 32-bit VS Code", () => { - const platformDetails: platform.IPlatformDetails = { + }, + "C:\\Program Files (x86)\\PowerShell": { + "6": { + "pwsh.exe": "", + }, + "7-preview": { + "pwsh.exe": "", + }, + }, + [msixAppDir]: { + "Microsoft.PowerShell_8wekyb3d8bbwe": { + "pwsh.exe": "", + }, + "Microsoft.PowerShellPreview_8wekyb3d8bbwe": { + "pwsh.exe": "", + }, + }, + "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0": { + "powershell.exe": "", + }, + "C:\\WINDOWS\\Sysnative\\WindowsPowerShell\\v1.0": { + "powershell.exe": "", + }, + }, + }, + { + name: "Windows 64-bit, 32-bit VSCode (Windows PowerShell only)", + platformDetails: { + operatingSystem: platform.OperatingSystem.Windows, + isOS64Bit: true, + isProcess64Bit: false, + }, + environmentVars: { + "ProgramFiles": "C:\\Program Files (x86)", + "ProgramFiles(x86)": "C:\\Program Files (x86)", + "windir": "C:\\WINDOWS", + }, + expectedPowerShellSequence: [ + { + exePath: "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", + displayName: "Windows PowerShell (x86)", + }, + { + exePath: "C:\\WINDOWS\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe", + displayName: "Windows PowerShell (x64)", + }, + ], + filesystem: { + "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0": { + "powershell.exe": "", + }, + "C:\\WINDOWS\\Sysnative\\WindowsPowerShell\\v1.0": { + "powershell.exe": "", + }, + }, + }, + { + name: "Windows 32-bit, 32-bit VSCode (all installations)", + platformDetails: { + operatingSystem: platform.OperatingSystem.Windows, + isOS64Bit: false, + isProcess64Bit: false, + }, + environmentVars: { + "ProgramFiles": "C:\\Program Files (x86)", + "ProgramFiles(x86)": "C:\\Program Files (x86)", + "windir": "C:\\WINDOWS", + }, + expectedPowerShellSequence: [ + { + exePath: "C:\\Program Files (x86)\\PowerShell\\6\\pwsh.exe", + displayName: "PowerShell (x86)", + }, + { + exePath: pwshMsixPath, + displayName: "PowerShell (Store)", + }, + { + exePath: "C:\\Program Files (x86)\\PowerShell\\7-preview\\pwsh.exe", + displayName: "PowerShell Preview (x86)", + }, + { + exePath: pwshPreviewMsixPath, + displayName: "PowerShell Preview (Store)", + }, + { + exePath: "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", + displayName: "Windows PowerShell (x86)", + }, + ], + filesystem: { + "C:\\Program Files (x86)\\PowerShell": { + "6": { + "pwsh.exe": "", + }, + "7-preview": { + "pwsh.exe": "", + }, + }, + [msixAppDir]: { + "Microsoft.PowerShell_8wekyb3d8bbwe": { + "pwsh.exe": "", + }, + "Microsoft.PowerShellPreview_8wekyb3d8bbwe": { + "pwsh.exe": "", + }, + }, + "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0": { + "powershell.exe": "", + }, + }, + }, + { + name: "Windows 32-bit, 32-bit VSCode (Windows PowerShell only)", + platformDetails: { operatingSystem: platform.OperatingSystem.Windows, isOS64Bit: false, isProcess64Bit: false, - }; + }, + environmentVars: { + "ProgramFiles": "C:\\Program Files (x86)", + "ProgramFiles(x86)": "C:\\Program Files (x86)", + "windir": "C:\\WINDOWS", + }, + expectedPowerShellSequence: [ + { + exePath: "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", + displayName: "Windows PowerShell (x86)", + }, + ], + filesystem: { + "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0": { + "powershell.exe": "", + }, + }, + }, + ]; +} else { + successTestCases = [ + { + name: "Linux (all installations)", + platformDetails: { + operatingSystem: platform.OperatingSystem.Linux, + isOS64Bit: true, + isProcess64Bit: true, + }, + expectedPowerShellSequence: [ + { exePath: "/usr/bin/pwsh", displayName: "PowerShell" }, + { exePath: "/snap/bin/pwsh", displayName: "PowerShell Snap" }, + { exePath: "/usr/bin/pwsh-preview", displayName: "PowerShell Preview" }, + { exePath: "/snap/bin/pwsh-preview", displayName: "PowerShell Preview Snap" }, + ], + filesystem: { + "/usr/bin": { + "pwsh": "", + "pwsh-preview": "", + }, + "/snap/bin": { + "pwsh": "", + "pwsh-preview": "", + }, + }, + }, + { + name: "MacOS (all installations)", + platformDetails: { + operatingSystem: platform.OperatingSystem.MacOS, + isOS64Bit: true, + isProcess64Bit: true, + }, + expectedPowerShellSequence: [ + { exePath: "/usr/local/bin/pwsh", displayName: "PowerShell" }, + { exePath: "/usr/local/bin/pwsh-preview", displayName: "PowerShell Preview" }, + ], + filesystem: { + "/usr/local/bin": { + "pwsh": "", + "pwsh-preview": "", + }, + }, + }, + { + name: "Linux (stable only)", + platformDetails: { + operatingSystem: platform.OperatingSystem.Linux, + isOS64Bit: true, + isProcess64Bit: true, + }, + expectedPowerShellSequence: [ + { exePath: "/usr/bin/pwsh", displayName: "PowerShell" }, + ], + filesystem: { + "/usr/bin": { + pwsh: "", + }, + }, + }, + { + name: "Linux (stable snap only)", + platformDetails: { + operatingSystem: platform.OperatingSystem.Linux, + isOS64Bit: true, + isProcess64Bit: true, + }, + expectedPowerShellSequence: [ + { exePath: "/snap/bin/pwsh", displayName: "PowerShell Snap" }, + ], + filesystem: { + "/snap/bin": { + pwsh: "", + }, + }, + }, + { + name: "MacOS (stable only)", + platformDetails: { + operatingSystem: platform.OperatingSystem.MacOS, + isOS64Bit: true, + isProcess64Bit: true, + }, + expectedPowerShellSequence: [ + { exePath: "/usr/local/bin/pwsh", displayName: "PowerShell" }, + ], + filesystem: { + "/usr/local/bin": { + pwsh: "", + }, + }, + }, + ]; +} - checkDefaultPowerShellPath( - platformDetails, - "C:\\Program Files\\PowerShell\\6\\pwsh.exe"); +const errorTestCases: ITestPlatform[] = [ + { + name: "Linux (no PowerShell)", + platformDetails: { + operatingSystem: platform.OperatingSystem.Linux, + isOS64Bit: true, + isProcess64Bit: true, + }, + filesystem: {}, + }, + { + name: "MacOS (no PowerShell)", + platformDetails: { + operatingSystem: platform.OperatingSystem.MacOS, + isOS64Bit: true, + isProcess64Bit: true, + }, + filesystem: {}, + }, +]; - checkAvailableWindowsPowerShellPaths( - platformDetails, - [ - { - versionName: platform.WindowsPowerShell32BitLabel, - exePath: platform.System32PowerShellPath, - }, - ]); - }); +function setupTestEnvironment(testPlatform: ITestPlatform) { + mockFS(testPlatform.filesystem); + + if (testPlatform.environmentVars) { + for (const envVar of Object.keys(testPlatform.environmentVars)) { + sinon.stub(process.env, envVar).value(testPlatform.environmentVars[envVar]); + } } +} + +suite("Platform module", () => { + suite("PlatformDetails", () => { + const platformDetails: platform.IPlatformDetails = platform.getPlatformDetails(); + switch (process.platform) { + case "darwin": + assert.strictEqual( + platformDetails.operatingSystem, + platform.OperatingSystem.MacOS, + "Platform details operating system should be MacOS"); + assert.strictEqual( + platformDetails.isProcess64Bit, + true, + "VSCode on darwin should be 64-bit"); + assert.strictEqual( + platformDetails.isOS64Bit, + true, + "Darwin is 64-bit only"); + break; + + case "linux": + assert.strictEqual( + platformDetails.operatingSystem, + platform.OperatingSystem.Linux, + "Platform details operating system should be Linux"); + assert.strictEqual( + platformDetails.isProcess64Bit, + true, + "Only 64-bit VSCode supported on Linux"); + assert.strictEqual( + platformDetails.isOS64Bit, + true, + "Only 64-bit Linux supported by PowerShell"); + return; + + case "win32": + assert.strictEqual( + platformDetails.operatingSystem, + platform.OperatingSystem.Windows, + "Platform details operating system should be Windows"); + assert.strictEqual( + platformDetails.isProcess64Bit, + process.arch === "x64", + "Windows process bitness should match process arch"); + assert.strictEqual( + platformDetails.isOS64Bit, + !!(platformDetails.isProcess64Bit || process.env.ProgramW6432), + "Windows OS arch should match process bitness unless 64-bit env var set"); + return; + + default: + assert.fail("Tests run on unsupported platform"); + } + }); + + suite("Default PowerShell installation", () => { + teardown(() => { + sinon.restore(); + mockFS.restore(); + }); + + for (const testPlatform of successTestCases) { + test(`Default PowerShell path on ${testPlatform.name}`, () => { + setupTestEnvironment(testPlatform); + + const powerShellExeFinder = new platform.PowerShellExeFinder(testPlatform.platformDetails); + + const defaultPowerShell = powerShellExeFinder.getFirstAvailablePowerShellInstallation(); + const expectedPowerShell = testPlatform.expectedPowerShellSequence[0]; + + assert.strictEqual(defaultPowerShell.exePath, expectedPowerShell.exePath); + assert.strictEqual(defaultPowerShell.displayName, expectedPowerShell.displayName); + }); + } + + for (const testPlatform of errorTestCases) { + test(`Extension startup fails gracefully on ${testPlatform.name}`, () => { + setupTestEnvironment(testPlatform); + + const powerShellExeFinder = new platform.PowerShellExeFinder(testPlatform.platformDetails); + + const defaultPowerShell = powerShellExeFinder.getFirstAvailablePowerShellInstallation(); + assert.strictEqual(defaultPowerShell, undefined); + }); + } + }); + + suite("Expected PowerShell installation list", () => { + teardown(() => { + sinon.restore(); + mockFS.restore(); + }); + + for (const testPlatform of successTestCases) { + test(`PowerShell installation list on ${testPlatform.name}`, () => { + setupTestEnvironment(testPlatform); + + const powerShellExeFinder = new platform.PowerShellExeFinder(testPlatform.platformDetails); + + const foundPowerShells = powerShellExeFinder.getAllAvailablePowerShellInstallations(); + + for (let i = 0; i < testPlatform.expectedPowerShellSequence.length; i++) { + const foundPowerShell = foundPowerShells[i]; + const expectedPowerShell = testPlatform.expectedPowerShellSequence[i]; + + assert.strictEqual(foundPowerShell && foundPowerShell.exePath, expectedPowerShell.exePath); + assert.strictEqual(foundPowerShell && foundPowerShell.displayName, expectedPowerShell.displayName); + } + + assert.strictEqual( + foundPowerShells.length, + testPlatform.expectedPowerShellSequence.length, + "Number of expected PowerShells found does not match"); + }); + } + + for (const testPlatform of errorTestCases) { + test(`Extension startup fails gracefully on ${testPlatform.name}`, () => { + setupTestEnvironment(testPlatform); + + const powerShellExeFinder = new platform.PowerShellExeFinder(testPlatform.platformDetails); + + const foundPowerShells = powerShellExeFinder.getAllAvailablePowerShellInstallations(); + assert.strictEqual(foundPowerShells.length, 0); + }); + } + }); }); From c7a2adb40581dfbc9447839e8ed87bf60b6eec39 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Wed, 30 Oct 2019 14:54:08 -0700 Subject: [PATCH 032/166] Fix crash when PowerShell selection is changed (#2261) * Fix crash when PowerShell selection is changed * Change commented out dotnet global tool code * Add tests --- src/platform.ts | 12 +++++++++--- test/platform.test.ts | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/src/platform.ts b/src/platform.ts index 2ade340989..b1877501d3 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -116,11 +116,17 @@ export class PowerShellExeFinder { * @param configuredPowerShellPath the PowerShell path configured by the user. */ public fixWindowsPowerShellPath(configuredPowerShellPath: string): string { + const altWinPS = this.findWinPS({ useAlternateBitness: true }); + + if (!altWinPS) { + return configuredPowerShellPath; + } + + const lowerAltWinPSPath = altWinPS.exePath.toLocaleLowerCase(); const lowerConfiguredPath = configuredPowerShellPath.toLocaleLowerCase(); - const lowerAltWinPSPath = this.alternateBitnessWinPS.exePath.toLocaleLowerCase(); if (lowerConfiguredPath === lowerAltWinPSPath) { - return this.winPS.exePath; + return this.findWinPS().exePath; } return configuredPowerShellPath; @@ -180,7 +186,7 @@ export class PowerShellExeFinder { // Currently it cannot take startup arguments to start PSES with. // // Look for the .NET global tool - // yield this.pwshDotnetGlobalTool; + // yield this.findPSCoreDotnetGlobalTool(); // Look for PSCore preview yield this.findPSCorePreview(); diff --git a/test/platform.test.ts b/test/platform.test.ts index e141795029..f6226f634e 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -594,4 +594,47 @@ suite("Platform module", () => { }); } }); + + suite("Windows PowerShell path fix", () => { + teardown(() => { + sinon.restore(); + mockFS.restore(); + }); + + for (const testPlatform of successTestCases + .filter((tp) => tp.platformDetails.operatingSystem === platform.OperatingSystem.Windows)) { + + test(`Corrects the Windows PowerShell path on ${testPlatform.name}`, () => { + setupTestEnvironment(testPlatform); + + function getWinPSPath(systemDir: string) { + return path.join( + testPlatform.environmentVars.windir, + systemDir, + "WindowsPowerShell", + "v1.0", + "powershell.exe"); + } + + const winPSPath = getWinPSPath("System32"); + + let altWinPSPath; + if (testPlatform.platformDetails.isProcess64Bit) { + altWinPSPath = getWinPSPath("SysWOW64"); + } else if (testPlatform.platformDetails.isOS64Bit) { + altWinPSPath = getWinPSPath("Sysnative"); + } else { + altWinPSPath = null; + } + + const powerShellExeFinder = new platform.PowerShellExeFinder(testPlatform.platformDetails); + + assert.strictEqual(powerShellExeFinder.fixWindowsPowerShellPath(winPSPath), winPSPath); + + if (altWinPSPath) { + assert.strictEqual(powerShellExeFinder.fixWindowsPowerShellPath(altWinPSPath), winPSPath); + } + }); + } + }); }); From d65ccf8933ebbaf0bc1d99e2a259190160402387 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 31 Oct 2019 14:53:15 -0400 Subject: [PATCH 033/166] Introduce new setting that controls UseLegacyReadLine (#2262) --- package.json | 5 +++++ src/process.ts | 6 +++++- src/session.ts | 4 +++- src/settings.ts | 10 +++------- test/settings.test.ts | 10 ---------- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index c142503f58..8c57054b46 100644 --- a/package.json +++ b/package.json @@ -683,6 +683,11 @@ "default": true, "description": "Switches focus to the console when a script selection is run or a script file is debugged. This is an accessibility feature. To disable it, set to false." }, + "powershell.integratedConsole.useLegacyReadLine": { + "type": "boolean", + "default": false, + "description": "Falls back to the legacy (lightweight) ReadLine experience. This will disable the use of PSReadLine in the PowerShell Integrated Console." + }, "powershell.debugging.createTemporaryIntegratedConsole": { "type": "boolean", "default": false, diff --git a/src/process.ts b/src/process.ts index ec1b73b1b0..051da88488 100644 --- a/src/process.ts +++ b/src/process.ts @@ -57,7 +57,11 @@ export class PowerShellProcess { this.startArgs += `-LogPath '${PowerShellProcess.escapeSingleQuotes(editorServicesLogPath)}' ` + `-SessionDetailsPath '${PowerShellProcess.escapeSingleQuotes(this.sessionFilePath)}' ` + - `-FeatureFlags @(${featureFlags})`; + `-FeatureFlags @(${featureFlags}) `; + + if (this.sessionSettings.integratedConsole.useLegacyReadLine) { + this.startArgs += "-UseLegacyReadLine"; + } const powerShellArgs = [ "-NoProfile", diff --git a/src/session.ts b/src/session.ts index 4fb4186f92..9d552b9ca3 100644 --- a/src/session.ts +++ b/src/session.ts @@ -406,7 +406,9 @@ export class SessionManager implements Middleware { settings.developer.editorServicesLogLevel.toLowerCase() !== this.sessionSettings.developer.editorServicesLogLevel.toLowerCase() || settings.developer.bundledModulesPath.toLowerCase() !== - this.sessionSettings.developer.bundledModulesPath.toLowerCase())) { + this.sessionSettings.developer.bundledModulesPath.toLowerCase() || + settings.integratedConsole.useLegacyReadLine !== + this.sessionSettings.integratedConsole.useLegacyReadLine)) { vscode.window.showInformationMessage( "The PowerShell runtime configuration has changed, would you like to start a new session?", diff --git a/src/settings.ts b/src/settings.ts index 8a4e3ac9b7..e7c9eea499 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -98,6 +98,7 @@ export interface ISettings { export interface IIntegratedConsoleSettings { showOnStartup?: boolean; focusConsoleOnExecute?: boolean; + useLegacyReadLine?: boolean; } export function load(): ISettings { @@ -118,14 +119,8 @@ export function load(): ISettings { createTemporaryIntegratedConsole: false, }; - // TODO: Remove when PSReadLine is out of preview - const featureFlags = []; - if (utils.isWindowsOS()) { - featureFlags.push("PSReadLine"); - } - const defaultDeveloperSettings: IDeveloperSettings = { - featureFlags, + featureFlags: [], powerShellExePath: undefined, bundledModulesPath: "../../../PowerShellEditorServices/module", editorServicesLogLevel: "Normal", @@ -159,6 +154,7 @@ export function load(): ISettings { const defaultIntegratedConsoleSettings: IIntegratedConsoleSettings = { showOnStartup: true, focusConsoleOnExecute: true, + useLegacyReadLine: false, }; return { diff --git a/test/settings.test.ts b/test/settings.test.ts index ecbaedfb48..6117d170f2 100644 --- a/test/settings.test.ts +++ b/test/settings.test.ts @@ -10,16 +10,6 @@ suite("Settings module", () => { assert.doesNotThrow(Settings.load); }); - // TODO: Remove this test when PSReadLine is in stable - test("PSReadLine featureFlag set correctly", () => { - const settings: Settings.ISettings = Settings.load(); - if (process.platform === "win32") { - assert.deepEqual(settings.developer.featureFlags, ["PSReadLine"]); - } else { - assert.deepEqual(settings.developer.featureFlags, []); - } - }); - test("Settings update correctly", async () => { // then syntax Settings.change("helpCompletion", "BlockComment", false).then(() => From 6a47a89470cf2d71cbd0c70fef8ea7470bc8c289 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 31 Oct 2019 15:00:46 -0400 Subject: [PATCH 034/166] Use list of files for release since build happens first (#2260) --- .vsts-ci/templates/release-general.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.vsts-ci/templates/release-general.yml b/.vsts-ci/templates/release-general.yml index 263cf4f8fb..cc4b802a24 100644 --- a/.vsts-ci/templates/release-general.yml +++ b/.vsts-ci/templates/release-general.yml @@ -83,8 +83,15 @@ steps: optionsFTPATH: '$(Build.SourcesDirectory)\tools\terms\FileTypeSet.xml' # toolVersion: 5.8.2.1 +- pwsh: | + Get-ChildItem -Exclude node_modules | Get-ChildItem -Recurse | ForEach-Object FullName > "$env:BUILD_SOURCESDIRECTORY/credscan.tsv" + displayName: Create credscan.tsv as the list of files to scan + - task: CredScan@2 condition: succeededOrFailed() + inputs: + debugMode: false + scanFolder: '$(Build.SourcesDirectory)/credscan.tsv' # Publish results as artifacts - task: PublishSecurityAnalysisLogs@3 From d2b5e7f09d75169fe02566bb3a8c5f08146dcac8 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 31 Oct 2019 14:15:25 -0700 Subject: [PATCH 035/166] Update powershell-preview CHANGELOG for v2019.11.0 (#2263) * Update CHANGELOG for v2019.11.0 * Increment version --- CHANGELOG.md | 94 ++++++++++++++++++++++++++++++++++++----------- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 75 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa75427a6a..e2cc8dbab2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,57 @@ # PowerShell Preview Extension Release History +## v2019.11.0 +### Friday, November 1, 2019 + +##### Special Note +In this release of the preview extension, +we've merged significant architectural work into PowerShell Editor Services. +After several months of work, PSES now uses the Omnisharp LSP library +to handle Language Server Protocol interaction instead of rolling its own, +allowing PSES to concentrate on being a good PowerShell backend. +We hope you'll see increased performance and stability in this release. +As always, [please let us know if you find any issues](https://github.com/PowerShell/vscode-powershell/issues/new/choose). + +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🔧 [vscode-PowerShell #2262](https://github.com/PowerShell/vscode-PowerShell/pull/2262) - + Introduce `powershell.integratedConsole.useLegacyReadline` setting disable PSReadLine. +- 🛫🐛[vscode-powershell #2217](https://github.com/PowerShell/vscode-PowerShell/pull/2238) - + Discover new PowerShell installations, fix startup issue with Windows PowerShell. +- 📺 [vscode-PowerShell #2225](https://github.com/PowerShell/vscode-PowerShell/pull/2225) - + Surface `InvokeRegisteredEditorCommand` in the Command Palette. (Thanks @jpogran!) +- 📺 [vscode-PowerShell #2224](https://github.com/PowerShell/vscode-PowerShell/pull/2224) - + Provide Run Selection button in editor title menu. (Thanks @jpogran!) +- 👷 [vscode-powershell #2229](https://github.com/PowerShell/vscode-PowerShell/pull/2232) - + Fix version check in Install-VSCode.ps1. +- 🚂 [vscode-PowerShell #2226](https://github.com/PowerShell/vscode-PowerShell/pull/2226) - + Changes needed for Omnisharp migration of PowerShellEditorServices. +- 🔍 [vscode-powershell #2144](https://github.com/PowerShell/vscode-PowerShell/pull/2223) - + Fix debugging restart capability by ensuring the session file is not deleted. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛 [PowerShellEditorServices #1080](https://github.com/PowerShell/PowerShellEditorServices/pull/1080) - + Remove extra newline in GetComment feature. +- 🐛 [PowerShellEditorServices #1079](https://github.com/PowerShell/PowerShellEditorServices/pull/1079) - + Fix duplicate diagnostics caused by DidChange handler. +- 🔧 [PowerShellEditorServices #1076](https://github.com/PowerShell/PowerShellEditorServices/pull/1076) - + Graduate PSReadLine feature and add UseLegacyReadLine. +- ⚙️ [PowerShellEditorServices #1075](https://github.com/PowerShell/PowerShellEditorServices/pull/1075) - + Lock OmniSharp dependencies to v0.14.0. (Thanks @mholo65!) +- 📟 [PowerShellEditorServices #1064](https://github.com/PowerShell/PowerShellEditorServices/pull/1064) - + Add support for terminal error color settings in PS7. +- 🐛 [PowerShellEditorServices #1073](https://github.com/PowerShell/PowerShellEditorServices/pull/1073) - + Fix prerelease version discovery and fix omnisharp change. +- 🐛 [PowerShellEditorServices #1065](https://github.com/PowerShell/PowerShellEditorServices/pull/1065) - + Fix TEMP debugging. +- 🐛 [vscode-powershell #1753](https://github.com/PowerShell/PowerShellEditorServices/pull/1072) - + Override PSRL ReadKey on Windows as well. +- 🚂 [PowerShellEditorServices #1056](https://github.com/PowerShell/PowerShellEditorServices/pull/1056) - + Re-architect PowerShell Editor Services to use the Omnisharp LSP platform. +- 🐛 [vscode-powershell #2116](https://github.com/PowerShell/PowerShellEditorServices/pull/1044) - + Fix UNC intellisense backslash. + ## v2019.9.0 ### Monday, September 23, 2019 #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) @@ -77,33 +129,33 @@ - 👷 [vscode-PowerShell #1942](https://github.com/PowerShell/vscode-PowerShell/pull/1942) - Stop supporting 6.0 - ✨ [vscode-PowerShell #1928](https://github.com/PowerShell/vscode-PowerShell/pull/1928) - - Add RunCode command for CodeLens providers + Add RunCode command for CodeLens providers - 🐛 [vscode-PowerShell #1927](https://github.com/PowerShell/vscode-PowerShell/pull/1927) - - Fix change session by moving to async/await promise + Fix change session by moving to async/await promise - 🐛 [vscode-PowerShell #1931](https://github.com/PowerShell/vscode-PowerShell/pull/1931) - - Fix upload bug report + Fix upload bug report - 🐛 [vscode-PowerShell #1925](https://github.com/PowerShell/vscode-PowerShell/pull/1925) - Fix error in HtmlContentView.ShowContent when no JS/CSS provided (Thanks @rkeithhill!) - 🐛 [vscode-PowerShell #1919](https://github.com/PowerShell/vscode-PowerShell/pull/1919) - - Fix CustomViews by switching to WebViews + Fix CustomViews by switching to WebViews - 🐛 [vscode-PowerShell #1922](https://github.com/PowerShell/vscode-PowerShell/pull/1922) - Fix small typo in Function-Inline description (Thanks @V-ed!) - ✨ [vscode-PowerShell #1908](https://github.com/PowerShell/vscode-PowerShell/pull/1908) - - Add PowerShell version telemetry + Add PowerShell version telemetry - 📖 [vscode-PowerShell #1900](https://github.com/PowerShell/vscode-PowerShell/pull/1900) - Small update to Azure Data Studio marketplace README (Thanks @SQLvariant!) - 💻 [vscode-PowerShell #1871](https://github.com/PowerShell/vscode-PowerShell/pull/1871) - Change CI to use Azure Pipelines - 🐛 [vscode-PowerShell #1867](https://github.com/PowerShell/vscode-PowerShell/pull/1867) - - Change whitespace settings to camelCase + Change whitespace settings to camelCase - 🐛 [vscode-PowerShell #1852](https://github.com/PowerShell/vscode-PowerShell/pull/1852) - Turn `powershell.codeformatting.useCorrectCasing` setting off by default until PSScriptAnalyzer issues are fixed (Thanks @bergmeister!) - 🐛 [vscode-powershell #1822](https://github.com/PowerShell/vscode-PowerShell/pull/1838) - - Set featureFlag default to null so that it can be resolved by settings + Set featureFlag default to null so that it can be resolved by settings - 💻 [vscode-PowerShell #1839](https://github.com/PowerShell/vscode-PowerShell/pull/1839) - - Add initial credscan config ymls for CI + Add initial credscan config ymls for CI - 🐛 [vscode-PowerShell #1837](https://github.com/PowerShell/vscode-PowerShell/pull/1837) - - Don't use -EncodedCommand to start PowerShell on Windows + Don't use -EncodedCommand to start PowerShell on Windows - 🐛 [vscode-PowerShell #1825](https://github.com/PowerShell/vscode-PowerShell/pull/1825) - Switch to current lowercase names for powershell and mdlint extensions (Thanks @rkeithhill!) - 👷 [vscode-PowerShell #1823](https://github.com/PowerShell/vscode-PowerShell/pull/1823) - @@ -112,33 +164,33 @@ #### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - ✨ [PowerShellEditorServices #951](https://github.com/PowerShell/PowerShellEditorServices/pull/951) - - Allow passing RunspaceName + Allow passing RunspaceName - 🚨 [PowerShellEditorServices #944](https://github.com/PowerShell/PowerShellEditorServices/pull/944) - - Add integration testing module with simple tests to verify PSES starts and stops + Add integration testing module with simple tests to verify PSES starts and stops - 🐛 [PowerShellEditorServices #954](https://github.com/PowerShell/PowerShellEditorServices/pull/955) - - Ensure NamedPipeServerStream is assigned in Windows PowerShell + Ensure NamedPipeServerStream is assigned in Windows PowerShell - ✨ [PowerShellEditorServices #952](https://github.com/PowerShell/PowerShellEditorServices/pull/952) - - Update to PSReadLine 2.0.0-beta4 + Update to PSReadLine 2.0.0-beta4 - ✨ [PowerShellEditorServices #877](https://github.com/PowerShell/PowerShellEditorServices/pull/877) - Add filtering for CodeLens and References (Thanks @glennsarti!) - 🐛 [vscode-powershell #1933](https://github.com/PowerShell/PowerShellEditorServices/pull/949) - - Stop crash when workspace doesn't exist + Stop crash when workspace doesn't exist - 👷 [PowerShellEditorServices #878](https://github.com/PowerShell/PowerShellEditorServices/pull/878) - - Remove native named pipes implementation + Remove native named pipes implementation - 🐛 [PowerShellEditorServices #947](https://github.com/PowerShell/PowerShellEditorServices/pull/947) - - Fix silent failure in VSCode WebViews by using Id for dictionary since multiple pages could have the same title + Fix silent failure in VSCode WebViews by using Id for dictionary since multiple pages could have the same title - 🐛 [PowerShellEditorServices #946](https://github.com/PowerShell/PowerShellEditorServices/pull/946) - - Rename to use async + Rename to use async - 👷 [PowerShellEditorServices #943](https://github.com/PowerShell/PowerShellEditorServices/pull/943) - Improvements to the log parsing module (Thanks @rkeithhill!) - 💻 [PowerShellEditorServices #921](https://github.com/PowerShell/PowerShellEditorServices/pull/921) - - Set up CI with Azure Pipelines + Set up CI with Azure Pipelines - 🐛 [PowerShellEditorServices #908](https://github.com/PowerShell/PowerShellEditorServices/pull/908) - Fix issue with reference code lens not working with UNC paths (Thanks @rkeithhill!) - 🐛 [vscode-powershell #1571](https://github.com/PowerShell/PowerShellEditorServices/pull/911) - - Fix faulty netfx check + Fix faulty netfx check - 🐛 [PowerShellEditorServices #906](https://github.com/PowerShell/PowerShellEditorServices/pull/906) - - Fix New-EditorFile with no folder or no files open + Fix New-EditorFile with no folder or no files open - ✨ [vscode-powershell #1398](https://github.com/PowerShell/PowerShellEditorServices/pull/902) - Improve path auto-completion (Thanks @rkeithhill!) - 🐛 [PowerShellEditorServices #910](https://github.com/PowerShell/PowerShellEditorServices/pull/910) - @@ -148,7 +200,7 @@ - 👷 [PowerShellEditorServices #903](https://github.com/PowerShell/PowerShellEditorServices/pull/903) - Move temp folder into repo to avoid state that causes build errors from time to time when rebuilding locally (and packages have updated) (Thanks @bergmeister!) - 💻 [PowerShellEditorServices #904](https://github.com/PowerShell/PowerShellEditorServices/pull/904) - - Add initial credscan configuation ymls for CI + Add initial credscan configuation ymls for CI - 🐛 [PowerShellEditorServices #901](https://github.com/PowerShell/PowerShellEditorServices/pull/901) - Switch to current lowercase names for powershell and mdlint exts (Thanks @rkeithhill!) diff --git a/package-lock.json b/package-lock.json index 250eaa6423..2b1a34fd27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "powershell-preview", - "version": "2019.9.0", + "version": "2019.11.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8c57054b46..beae611d22 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2019.9.0", + "version": "2019.11.0", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From 2ea9252466d9ebd0ab3d2228b3d2d1b7eed72835 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 31 Oct 2019 16:14:18 -0700 Subject: [PATCH 036/166] [Ignore] Allow VSTS env var override (#2264) --- tools/releaseBuild/setVstsVariables.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/releaseBuild/setVstsVariables.ps1 b/tools/releaseBuild/setVstsVariables.ps1 index f08fcc4a9d..dc42416c73 100644 --- a/tools/releaseBuild/setVstsVariables.ps1 +++ b/tools/releaseBuild/setVstsVariables.ps1 @@ -5,6 +5,12 @@ $vstsVariables = @{ # Use VSTS's API to set an env vars foreach ($var in $vstsVariables.Keys) { + # Allow environment to override + if (Get-Item "env:$var" -ErrorAction Ignore) + { + continue + } + $val = $vstsVariables[$var] Write-Host "Setting var '$var' to value '$val'" Write-Host "##vso[task.setvariable variable=$var]$val" From a938420e91807526c24f499b8b2d864de8ca4326 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Fri, 1 Nov 2019 11:48:24 -0700 Subject: [PATCH 037/166] Downgrade vsce (#2266) --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2b1a34fd27..c1865dc0d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2293,9 +2293,9 @@ } }, "vsce": { - "version": "1.68.0", - "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.68.0.tgz", - "integrity": "sha512-yFbRYu4x4GbdQzZdEQQeRJBxgPdummgcUOFHUtnclW8XQl3MTuKgXL3TtI09gb5oq7jE6kdyvBmpBcmDGsmhcQ==", + "version": "1.64.0", + "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.64.0.tgz", + "integrity": "sha512-t3R7QTe2nAXQZs2kD+nA8GjdlX8pAQlnzxaNTG2976i5cyQ8r+ZsMNa/f9PDt7bhjcQM+u/fL+LkNuw+hwoy2A==", "dev": true, "requires": { "azure-devops-node-api": "^7.2.0", diff --git a/package.json b/package.json index beae611d22..c1b0ff167b 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "sinon": "~7.5.0", "tslint": "~5.20.0", "typescript": "~3.5.3", - "vsce": "~1.68.0", + "vsce": "~1.64.0", "vscode": "~1.1.36" }, "extensionDependencies": [ From 3862d2a25efec1b64dc5c7716a4d1486cd6cc19f Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 4 Nov 2019 00:18:08 -0500 Subject: [PATCH 038/166] [Ignore] Add new logging docs (#2254) * add new logging docs * nicer words Co-Authored-By: Robert Holt * add note of what it applies to * update version --- docs/troubleshooting.md | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index caa16fd15d..4f0155c252 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -137,18 +137,13 @@ Logs provide context for what was happening when the issue occurred. **Note: You should skim through your logs for any sensitive information you would not like to share online** - Before sending through logs, try and reproduce the issue with - **log level set to Verbose** or **Diagnostic**. You can set this + **log level set to Diagnostic**. You can set this in the [VSCode Settings] (Ctrl+,) with: - ```json - "powershell.developer.editorServicesLogLevel": "Verbose" - ``` - - or for diagnostic logging: - ```json "powershell.developer.editorServicesLogLevel": "Diagnostic" ``` + After you have captured the issue with the log level turned up, you may want to return it (since verbose logging can use disk space): @@ -185,6 +180,33 @@ Logs provide context for what was happening when the issue occurred. vscode-powershell@microsoft.com. Please still open an issue though so we can track the work — other users may have the same issue. +#### Provide Language Server Protocol payload logs + +> NOTE: This currently only applies to the PowerShell Preview extension and only if you have version +> 2019.11.0 or higher. + +The PowerShell extension works mostly from sending and receiving messages from [PowerShell Editor Services](httos://github.com/PowerShell/PowerShellEditorServices). +In some cases, getting to the bottom of a bug will require looking at the payloads of these messages. To do this: + +- Add the following setting to your settings file: + + ```json + "powershell editor services.trace.server":"verbose" + ``` + +- Restart Visual Studio Code and reproduce the issue. + +- Go into the "Output" panel (Ctrl+Shift+U or Cmd+Shift+U). + +- In the drop down on the right, select "PowerShell Editor Services". + +- Copy the entire contents of the Output panel and paste it into the GitHub issue in the browser. +At this point, you may delete the setting if you want. + +- Again, if you prefer to share your logs privately, you can send them to + vscode-powershell@microsoft.com. Please still open an issue though + so we can track the work — other users may have the same issue. + ### Visual Studio Code Version [Your VSCode version] can be obtained from the Integrated Console From c3c2e098c45929083dbc927694495a11bf0019a6 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 4 Nov 2019 02:43:42 -0500 Subject: [PATCH 039/166] Increment version and doc fix. (#2273) --- scripts/Install-VSCode.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/Install-VSCode.ps1 b/scripts/Install-VSCode.ps1 index b01ae29212..55889b9477 100644 --- a/scripts/Install-VSCode.ps1 +++ b/scripts/Install-VSCode.ps1 @@ -1,6 +1,6 @@ <#PSScriptInfo -.VERSION 1.4 +.VERSION 1.4.1 .GUID 539e5585-7a02-4dd6-b9a6-5dd288d0a5d0 @@ -25,6 +25,8 @@ .EXTERNALSCRIPTDEPENDENCIES .RELEASENOTES + 07/10/2019 - Fix a version check when installing user-builds with Windows Powershell greater than 5. + -- 30/08/2019 - added functionality to install the "User Install" variant of Stable Edition. -- 07/11/2018 - added support for PowerShell Core and macOS/Linux platforms. From b4ad4663ce204dc3f5f7b151e77de74fc8487a4d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2019 07:38:29 -0500 Subject: [PATCH 040/166] Bump @types/node-fetch from 2.5.2 to 2.5.3 (#2283) Bumps [@types/node-fetch](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node-fetch) from 2.5.2 to 2.5.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node-fetch) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index c1865dc0d0..39f35cb833 100644 --- a/package-lock.json +++ b/package-lock.json @@ -98,9 +98,9 @@ "dev": true }, "@types/node-fetch": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.2.tgz", - "integrity": "sha512-djYYKmdNRSBtL1x4CiE9UJb9yZhwtI1VC+UxZD0psNznrUj80ywsxKlEGAE+QL1qvLjPbfb24VosjkYM6W4RSQ==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.3.tgz", + "integrity": "sha512-X3TNlzZ7SuSwZsMkb5fV7GrPbVKvHc2iwHmslb8bIxRKWg2iqkfm3F/Wd79RhDpOXR7wCtKAwc5Y2JE6n/ibyw==", "dev": true, "requires": { "@types/node": "*" @@ -113,9 +113,9 @@ "dev": true }, "@types/semver": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.0.tgz", - "integrity": "sha512-1OzrNb4RuAzIT7wHSsgZRlMBlNsJl+do6UblR7JMW4oB7bbR+uBEYtUh7gEc/jM84GGilh68lSOokyM/zNUlBA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.0.2.tgz", + "integrity": "sha512-G1Ggy7/9Nsa1Jt2yiBR2riEuyK2DFNnqow6R7cromXPMNynackRY1vqFTLz/gwnef1LHokbXThcPhqMRjUbkpQ==", "dev": true }, "@types/sinon": { diff --git a/package.json b/package.json index c1b0ff167b..0ddaf84a89 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@types/mocha": "~5.2.7", "@types/mock-fs": "~4.10.0", "@types/node": "~10.11.0", - "@types/node-fetch": "~2.5.2", + "@types/node-fetch": "~2.5.3", "@types/rewire": "~2.5.28", "@types/semver": "~6.0.2", "@types/sinon": "~7.5.0", From fcadea5bd45c2c34c85ff6b800fef89e15946c2c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2019 07:39:26 -0500 Subject: [PATCH 041/166] Bump mock-fs from 4.10.2 to 4.10.3 (#2281) Bumps [mock-fs](https://github.com/tschaub/mock-fs) from 4.10.2 to 4.10.3. - [Release notes](https://github.com/tschaub/mock-fs/releases) - [Changelog](https://github.com/tschaub/mock-fs/blob/master/changelog.md) - [Commits](https://github.com/tschaub/mock-fs/compare/v4.10.2...v4.10.3) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 39f35cb833..5d180756f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1500,9 +1500,9 @@ } }, "mock-fs": { - "version": "4.10.2", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.2.tgz", - "integrity": "sha512-ewPQ83O4U8/Gd8I15WoB6vgTTmq5khxBskUWCRvswUqjCfOOTREmxllztQOm+PXMWUxATry+VBWXQJloAyxtbQ==", + "version": "4.10.3", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.3.tgz", + "integrity": "sha512-bcukePBvuA3qovmq0Qtqu9+1APCIGkFHnsozrPIVromt5XFGGgkQSfaN0H6RI8gStHkO/hRgimvS3tooNes4pQ==", "dev": true }, "ms": { diff --git a/package.json b/package.json index 0ddaf84a89..7b2320c026 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.1", "mocha-multi-reporters": "~1.1.7", - "mock-fs": "~4.10.2", + "mock-fs": "~4.10.3", "rewire": "~4.0.1", "sinon": "~7.5.0", "tslint": "~5.20.0", From 517fe5cbcb662695aabf2103d5587d18f16dca81 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 12 Nov 2019 09:24:25 -0800 Subject: [PATCH 042/166] buttons show up for untitled files (#2294) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7b2320c026..f28fac36ec 100644 --- a/package.json +++ b/package.json @@ -288,12 +288,12 @@ ], "editor/title": [ { - "when": "resourceLangId == powershell", + "when": "editorLangId == powershell", "command": "workbench.action.debug.start", "group": "navigation@100" }, { - "when": "resourceLangId == powershell", + "when": "editorLangId == powershell", "command": "PowerShell.RunSelection", "group": "navigation@101" } From 5110dadfe80ba5fc60b110892af83290ac0de967 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2019 11:09:31 -0800 Subject: [PATCH 043/166] Bump tslint from 5.20.0 to 5.20.1 (#2297) Bumps [tslint](https://github.com/palantir/tslint) from 5.20.0 to 5.20.1. - [Release notes](https://github.com/palantir/tslint/releases) - [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/palantir/tslint/compare/5.20.0...5.20.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5d180756f0..8f77db975a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2131,9 +2131,9 @@ "dev": true }, "tslint": { - "version": "5.20.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.0.tgz", - "integrity": "sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g==", + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", + "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", diff --git a/package.json b/package.json index f28fac36ec..9e56288f9d 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "mock-fs": "~4.10.3", "rewire": "~4.0.1", "sinon": "~7.5.0", - "tslint": "~5.20.0", + "tslint": "~5.20.1", "typescript": "~3.5.3", "vsce": "~1.64.0", "vscode": "~1.1.36" From c1e1ff892ce1089ca979be74269e7158c9e0dae0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2019 11:10:02 -0800 Subject: [PATCH 044/166] Bump @types/semver from 6.0.2 to 6.2.0 (#2301) Bumps [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) from 6.0.2 to 6.2.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8f77db975a..cc5013fb1d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -113,9 +113,9 @@ "dev": true }, "@types/semver": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.0.2.tgz", - "integrity": "sha512-G1Ggy7/9Nsa1Jt2yiBR2riEuyK2DFNnqow6R7cromXPMNynackRY1vqFTLz/gwnef1LHokbXThcPhqMRjUbkpQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.0.tgz", + "integrity": "sha512-1OzrNb4RuAzIT7wHSsgZRlMBlNsJl+do6UblR7JMW4oB7bbR+uBEYtUh7gEc/jM84GGilh68lSOokyM/zNUlBA==", "dev": true }, "@types/sinon": { diff --git a/package.json b/package.json index 9e56288f9d..0afdbee71e 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@types/node": "~10.11.0", "@types/node-fetch": "~2.5.3", "@types/rewire": "~2.5.28", - "@types/semver": "~6.0.2", + "@types/semver": "~6.2.0", "@types/sinon": "~7.5.0", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.1", From 0a5b5be7235414924bc0636b07b3bf382108a801 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2019 17:36:43 -0800 Subject: [PATCH 045/166] [Security] Bump https-proxy-agent from 2.2.2 to 2.2.4 (#2309) Bumps [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) from 2.2.2 to 2.2.4. **This update includes security fixes.** - [Release notes](https://github.com/TooTallNate/node-https-proxy-agent/releases) - [Commits](https://github.com/TooTallNate/node-https-proxy-agent/compare/2.2.2...2.2.4) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc5013fb1d..313ca6bb2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1144,9 +1144,9 @@ } }, "https-proxy-agent": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", - "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", "dev": true, "requires": { "agent-base": "^4.3.0", From b9eafbbd02808660e47adfcd94f0d47d3a460eb8 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 25 Nov 2019 22:22:25 -0800 Subject: [PATCH 046/166] Use `powerShellDefaultVersion` everywhere and stop using `powerShellExePath` (#2304) * Use powerShellDefaultVersion everywhere and stop using powerShellExePath * add modify settings in session menu * re-add powerShellExePath to package.json so vscode api can update it and remove references to developer.powerShellExePath * actually use setting... * still switch even if workspace setting is set * rob's feedback --- package.json | 14 +- src/features/GenerateBugReport.ts | 2 +- src/session.ts | 247 ++++++++++-------------------- src/settings.ts | 3 +- test/settings.test.ts | 12 +- 5 files changed, 95 insertions(+), 183 deletions(-) diff --git a/package.json b/package.json index 0afdbee71e..4d81a49aee 100644 --- a/package.json +++ b/package.json @@ -499,12 +499,6 @@ "default": [], "description": "Specify array of Modules to exclude from Command Explorer listing." }, - "powershell.powerShellExePath": { - "type": "string", - "default": "", - "scope": "machine", - "description": "Specifies the full path to a PowerShell executable. Changes the installation of PowerShell used for language and debugging services." - }, "powershell.powerShellAdditionalExePaths": { "type": "array", "description": "Specifies an array of versionName / exePath pairs where exePath points to a non-standard install location for PowerShell and versionName can be used to reference this path with the powershell.powerShellDefaultVersion setting.", @@ -530,7 +524,13 @@ }, "powershell.powerShellDefaultVersion": { "type": "string", - "description": "Specifies the PowerShell version name, as displayed by the 'PowerShell: Show Session Menu' command, used when the extension loads e.g \"Windows PowerShell (x86)\" or \"PowerShell Core 6 (x64)\"." + "description": "Specifies the PowerShell version name, as displayed by the 'PowerShell: Show Session Menu' command, used when the extension loads e.g \"Windows PowerShell (x86)\" or \"PowerShell Core 6 (x64)\". You can specify additional PowerShell executables by using the \"powershell.powerShellAdditionalExePaths\" setting." + }, + "powershell.powerShellExePath": { + "type": "string", + "default": "", + "scope": "machine", + "description": "REMOVED. Please use the \"powershell.powerShellDefaultVersion\" setting instead." }, "powershell.promptToUpdatePowerShell": { "type": "boolean", diff --git a/src/features/GenerateBugReport.ts b/src/features/GenerateBugReport.ts index d66487bc35..111fa85fcc 100644 --- a/src/features/GenerateBugReport.ts +++ b/src/features/GenerateBugReport.ts @@ -113,7 +113,7 @@ ${tableHeader}\n${table}; private getRuntimeInfo() { - const powerShellExePath = this.sessionManager.getPowerShellExePath(); + const powerShellExePath = this.sessionManager.PowerShellExeDetails.exePath; const powerShellArgs = [ "-NoProfile", "-Command", diff --git a/src/session.ts b/src/session.ts index 9d552b9ca3..7b4e5cb6b8 100644 --- a/src/session.ts +++ b/src/session.ts @@ -2,7 +2,6 @@ * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ -import cp = require("child_process"); import fs = require("fs"); import net = require("net"); import path = require("path"); @@ -17,13 +16,13 @@ import Settings = require("./settings"); import utils = require("./utils"); import { - CloseAction, DocumentSelector, ErrorAction, Executable, LanguageClient, LanguageClientOptions, - Middleware, NotificationType, RequestType, RequestType0, + CloseAction, DocumentSelector, ErrorAction, LanguageClient, LanguageClientOptions, + Middleware, NotificationType, RequestType0, ResolveCodeLensSignature, RevealOutputChannelOn, StreamInfo } from "vscode-languageclient"; import { GitHubReleaseInformation, InvokePowerShellUpdateCheck } from "./features/UpdatePowerShell"; import { - getPlatformDetails, IPlatformDetails, + getPlatformDetails, IPlatformDetails, IPowerShellExeDetails, OperatingSystem, PowerShellExeFinder } from "./platform"; export enum SessionStatus { @@ -37,9 +36,9 @@ export enum SessionStatus { export class SessionManager implements Middleware { public HostVersion: string; + public PowerShellExeDetails: IPowerShellExeDetails; private ShowSessionMenuCommandName = "PowerShell.ShowSessionMenu"; private editorServicesArgs: string; - private powerShellExePath: string = ""; private sessionStatus: SessionStatus = SessionStatus.NeverStarted; private suppressRestartPrompt: boolean; private focusConsoleOnExecute: boolean; @@ -105,8 +104,11 @@ export class SessionManager implements Middleware { this.extensionFeatures = extensionFeatures; } - public start() { + public start(exeNameOverride?: string) { this.sessionSettings = Settings.load(); + if (exeNameOverride) { + this.sessionSettings.powerShellDefaultVersion = exeNameOverride; + } this.log.startNewLog(this.sessionSettings.developer.editorServicesLogLevel); @@ -119,15 +121,29 @@ export class SessionManager implements Middleware { this.createStatusBarItem(); + this.promptPowerShellExeSettingsCleanup(); + try { - this.powerShellExePath = this.getPowerShellExePath(); + let powerShellExeDetails; + if (this.sessionSettings.powerShellDefaultVersion) { + for (const details of this.powershellExeFinder.enumeratePowerShellInstallations()) { + if (details.displayName === this.sessionSettings.powerShellDefaultVersion) { + powerShellExeDetails = details; + break; + } + } + } + + this.PowerShellExeDetails = powerShellExeDetails || + this.powershellExeFinder.getFirstAvailablePowerShellInstallation(); + } catch (e) { this.log.writeError(`Error occurred while searching for a PowerShell executable:\n${e}`); } this.suppressRestartPrompt = false; - if (!this.powerShellExePath) { + if (!this.PowerShellExeDetails) { const message = "Unable to find PowerShell." + " Do you have PowerShell installed?" + " You can also configure custom PowerShell installations" @@ -212,6 +228,11 @@ export class SessionManager implements Middleware { this.sessionStatus = SessionStatus.NotStarted; } + public restartSession(exeNameOverride?: string) { + this.stop(); + this.start(exeNameOverride); + } + public getSessionDetails(): utils.IEditorServicesSessionDetails { return this.sessionDetails; } @@ -230,7 +251,7 @@ export class SessionManager implements Middleware { this.debugSessionProcess = new PowerShellProcess( - this.powerShellExePath, + this.PowerShellExeDetails.exePath, this.bundledModulesPath, "[TEMP] PowerShell Integrated Console", this.log, @@ -241,51 +262,6 @@ export class SessionManager implements Middleware { return this.debugSessionProcess; } - public getPowerShellExePath(): string { - if (!this.sessionSettings.powerShellExePath && - this.sessionSettings.developer.powerShellExePath) { - // Show deprecation message with fix action. - // We don't need to wait on this to complete - // because we can finish gathering the configured - // PowerShell path without the fix - this.showExePathSettingDeprecationWarning(); - } - - let powerShellExePath: string = this.getConfiguredPowerShellExePath().trim(); - - // New versions of PS Core uninstall the previous version - // so make sure the path stored in the settings exists. - if (!fs.existsSync(powerShellExePath)) { - this.log.write( - `Path specified by 'powerShellExePath' setting - '${powerShellExePath}' - not found, ` + - "reverting to default PowerShell path."); - powerShellExePath = ""; - } - - if (powerShellExePath) { - if (this.platformDetails.operatingSystem === OperatingSystem.Windows) { - // Check the path bitness - const fixedPath = this.powershellExeFinder.fixWindowsPowerShellPath( - powerShellExePath); - - if (fixedPath !== powerShellExePath) { - // Show deprecation message with fix action. - // We don't need to wait on this to complete - // because we can finish gathering the configured - // PowerShell path without the fix - this.showBitnessPathFixWarning(fixedPath); - powerShellExePath = fixedPath; - } - } - - return this.resolvePowerShellPath(powerShellExePath); - } - - // No need to resolve this path, since the finder guarantees its existence - const firstPowerShell = this.powershellExeFinder.getFirstAvailablePowerShellInstallation(); - return firstPowerShell && firstPowerShell.exePath || null; - } - // ----- LanguageClient middleware methods ----- public resolveCodeLens( @@ -331,64 +307,32 @@ export class SessionManager implements Middleware { return resolvedCodeLens; } - private async showExePathSettingDeprecationWarning(): Promise { - const choice: string = await vscode.window.showWarningMessage( - "The 'powershell.developer.powerShellExePath' setting is deprecated, use " + - "'powershell.powerShellExePath' instead.", - "Fix Automatically"); - - if (!choice) { - return; - } - - this.suppressRestartPrompt = true; - await Settings.change("powerShellExePath", this.sessionSettings.developer.powerShellExePath, true); - await Settings.change("developer.powerShellExePath", undefined, true); - this.suppressRestartPrompt = false; - } - - private async showBitnessPathFixWarning(fixedPath: string): Promise { - const bitness = this.platformDetails.isOS64Bit ? "64" : "32"; - - const choice = await vscode.window.showWarningMessage( - `The specified PowerShell path is incorrect for ${bitness}-bit VS Code, using '${fixedPath}' instead.`, - "Fix Setting Automatically"); - - if (!choice) { - return; - } + private async promptPowerShellExeSettingsCleanup() { + if (this.sessionSettings.powerShellExePath) { + let warningMessage = "The 'powerShell.powerShellExePath' setting is no longer used. "; + warningMessage += this.sessionSettings.powerShellDefaultVersion + ? "We can automatically remove it for you." + : "We can remove it from your settings and prompt you for which PowerShell you want to use."; - this.suppressRestartPrompt = true; - await Settings.change("powerShellExePath", this.sessionSettings.developer.powerShellExePath, true); - await Settings.change("developer.powerShellExePath", undefined, true); - this.suppressRestartPrompt = false; - } + const choice = await vscode.window.showWarningMessage(warningMessage, "Let's do it!"); - private getConfiguredPowerShellExePath(): string { - // If powershell.powerShellDefaultVersion specified, attempt to find the PowerShell exe path - // of the version specified by the setting. - if (this.sessionSettings.powerShellDefaultVersion && this.sessionStatus === SessionStatus.NeverStarted) { - for (const pwshExe of this.powershellExeFinder.enumeratePowerShellInstallations()) { - if (pwshExe.displayName === this.sessionSettings.powerShellDefaultVersion) { - return pwshExe.exePath; - } + if (choice === "") { + // They hit the 'x' to close the dialog. + return; } - // Default PowerShell version was configured but we didn't find it - this.log.writeWarning( - `Could not find powerShellDefaultVersion: '${this.sessionSettings.powerShellDefaultVersion}'`); - } - - if (this.sessionSettings.powerShellExePath) { - return this.sessionSettings.powerShellExePath; - } + this.suppressRestartPrompt = true; + try { + await Settings.change("powerShellExePath", undefined, true); + } finally { + this.suppressRestartPrompt = false; + } - if (this.sessionSettings.developer.powerShellExePath) { - this.showExePathSettingDeprecationWarning(); - return this.sessionSettings.developer.powerShellExePath; + // Show the session menu at the end if they don't have a PowerShellDefaultVersion. + if (!this.sessionSettings.powerShellDefaultVersion) { + await vscode.commands.executeCommand(this.ShowSessionMenuCommandName); + } } - - return ""; } private onConfigurationUpdated() { @@ -398,11 +342,10 @@ export class SessionManager implements Middleware { // Detect any setting changes that would affect the session if (!this.suppressRestartPrompt && - (settings.useX86Host !== this.sessionSettings.useX86Host || - settings.powerShellExePath.toLowerCase() !== this.sessionSettings.powerShellExePath.toLowerCase() || - (settings.developer.powerShellExePath ? settings.developer.powerShellExePath.toLowerCase() : null) !== - (this.sessionSettings.developer.powerShellExePath - ? this.sessionSettings.developer.powerShellExePath.toLowerCase() : null) || + (settings.useX86Host !== + this.sessionSettings.useX86Host || + settings.powerShellDefaultVersion.toLowerCase() !== + this.sessionSettings.powerShellDefaultVersion.toLowerCase() || settings.developer.editorServicesLogLevel.toLowerCase() !== this.sessionSettings.developer.editorServicesLogLevel.toLowerCase() || settings.developer.bundledModulesPath.toLowerCase() !== @@ -461,7 +404,7 @@ export class SessionManager implements Middleware { this.languageServerProcess = new PowerShellProcess( - this.powerShellExePath, + this.PowerShellExeDetails.exePath, this.bundledModulesPath, "PowerShell Integrated Console", this.log, @@ -637,11 +580,6 @@ export class SessionManager implements Middleware { }); } - private restartSession() { - this.stop(); - this.start(); - } - private createStatusBarItem() { if (this.statusBarItem === undefined) { // Create the status bar item and place it right next @@ -691,53 +629,15 @@ export class SessionManager implements Middleware { SessionStatus.Failed); } - private changePowerShellExePath(exePath: string) { + private async changePowerShellDefaultVersion(exePath: IPowerShellExeDetails) { this.suppressRestartPrompt = true; - Settings - .change("powerShellExePath", exePath, true) - .then(() => this.restartSession()); - } - - private resolvePowerShellPath(powerShellExePath: string): string { - const resolvedPath = path.resolve(__dirname, powerShellExePath); - - // If the path does not exist, show an error - if (!utils.checkIfFileExists(resolvedPath)) { - const pwshPath = resolvedPath || powerShellExePath; - const pwshExeName = path.basename(pwshPath) || "PowerShell executable"; - - this.setSessionFailure(`${pwshExeName} cannot be found or is not accessible at path '${pwshPath}'`); + await Settings.change("powerShellDefaultVersion", exePath.displayName, true); - return null; - } - - return resolvedPath; - } - - private getPowerShellVersionLabel(): string { - if (this.powerShellExePath) { - const powerShellCommandLine = [ - this.powerShellExePath, - "-NoProfile", - "-NonInteractive", - ]; - - // Only add ExecutionPolicy param on Windows - if (utils.isWindowsOS()) { - powerShellCommandLine.push("-ExecutionPolicy", "Bypass"); - } - - powerShellCommandLine.push( - "-Command", - "'$PSVersionTable | ConvertTo-Json'"); - - const powerShellOutput = cp.execSync(powerShellCommandLine.join(" ")); - const versionDetails = JSON.parse(powerShellOutput.toString()); - return versionDetails.PSVersion.Label; - } else { - // TODO: throw instead? - return null; - } + // We pass in the display name so that we force the extension to use that version + // rather than pull from the settings. The issue we prevent here is when a + // workspace setting is defined which gets priority over user settings which + // is what the change above sets. + this.restartSession(exePath.displayName); } private showSessionConsole(isExecute?: boolean) { @@ -747,7 +647,6 @@ export class SessionManager implements Middleware { } private showSessionMenu() { - const currentExePath = (this.powerShellExePath || "").toLowerCase(); const availablePowerShellExes = this.powershellExeFinder.getAllAvailablePowerShellInstallations(); let sessionText: string; @@ -760,7 +659,7 @@ export class SessionManager implements Middleware { case SessionStatus.Stopping: const currentPowerShellExe = availablePowerShellExes - .find((item) => item.exePath.toLowerCase() === currentExePath); + .find((item) => item.displayName.toLowerCase() === this.PowerShellExeDetails.displayName); const powerShellSessionName = currentPowerShellExe ? @@ -782,11 +681,11 @@ export class SessionManager implements Middleware { const powerShellItems = availablePowerShellExes - .filter((item) => item.exePath.toLowerCase() !== currentExePath) + .filter((item) => item.displayName !== this.PowerShellExeDetails.displayName) .map((item) => { return new SessionMenuItem( `Switch to: ${item.displayName}`, - () => { this.changePowerShellExePath(item.exePath); }); + () => { this.changePowerShellDefaultVersion(item); }); }); const menuItems: SessionMenuItem[] = [ @@ -794,16 +693,24 @@ export class SessionManager implements Middleware { sessionText, () => { vscode.commands.executeCommand("PowerShell.ShowLogs"); }), - new SessionMenuItem( - "Restart Current Session", - () => { this.restartSession(); }), - // Add all of the different PowerShell options ...powerShellItems, + new SessionMenuItem( + "Restart Current Session", + () => { + // We pass in the display name so we guarentee that the session + // will be the same PowerShell. + this.restartSession(this.PowerShellExeDetails.displayName); + }), + new SessionMenuItem( "Open Session Logs Folder", () => { vscode.commands.executeCommand("PowerShell.OpenLogFolder"); }), + + new SessionMenuItem( + "Modify 'powerShell.powerShellAdditionalExePaths' in Settings", + () => { vscode.commands.executeCommand("workbench.action.openSettingsJson"); }), ]; vscode diff --git a/src/settings.ts b/src/settings.ts index e7c9eea499..d29e4ee33c 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -69,7 +69,6 @@ export interface IDebuggingSettings { export interface IDeveloperSettings { featureFlags?: string[]; - powerShellExePath?: string; bundledModulesPath?: string; editorServicesLogLevel?: string; editorServicesWaitForDebugger?: boolean; @@ -79,6 +78,7 @@ export interface IDeveloperSettings { export interface ISettings { powerShellAdditionalExePaths?: IPowerShellAdditionalExePathSettings[]; powerShellDefaultVersion?: string; + // This setting is no longer used but is here to assist in cleaning up the users settings. powerShellExePath?: string; promptToUpdatePowerShell?: boolean; bundledModulesPath?: string; @@ -121,7 +121,6 @@ export function load(): ISettings { const defaultDeveloperSettings: IDeveloperSettings = { featureFlags: [], - powerShellExePath: undefined, bundledModulesPath: "../../../PowerShellEditorServices/module", editorServicesLogLevel: "Normal", editorServicesWaitForDebugger: false, diff --git a/test/settings.test.ts b/test/settings.test.ts index 6117d170f2..d6e42122b6 100644 --- a/test/settings.test.ts +++ b/test/settings.test.ts @@ -3,6 +3,7 @@ *--------------------------------------------------------*/ import * as assert from "assert"; +import { IPowerShellExeDetails } from "../src/platform"; import Settings = require("../src/settings"); suite("Settings module", () => { @@ -22,10 +23,15 @@ suite("Settings module", () => { test("Settings that can only be user settings update correctly", async () => { // set to false means it's set as a workspace-level setting so this should throw. - assert.rejects(async () => await Settings.change("powerShellExePath", "dummyPath", false)); + const psExeDetails = [{ + versionName: "My PowerShell", + exePath: "dummyPath", + }]; + + assert.rejects(async () => await Settings.change("powerShellAdditionalExePaths", psExeDetails, false)); // set to true means it's a user-level setting so this should not throw. - await Settings.change("powerShellExePath", "dummyPath", true); - assert.strictEqual(Settings.load().powerShellExePath, "dummyPath"); + await Settings.change("powerShellAdditionalExePaths", psExeDetails, true); + assert.strictEqual(Settings.load().powerShellAdditionalExePaths[0].versionName, psExeDetails[0].versionName); }); }); From 8657ad58f27f1ab2a37ce9f156c561707cd1cf36 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2019 10:03:46 -0800 Subject: [PATCH 047/166] Bump @types/node-fetch from 2.5.3 to 2.5.4 (#2330) Bumps [@types/node-fetch](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node-fetch) from 2.5.3 to 2.5.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node-fetch) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 313ca6bb2f..dcf23016c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -98,9 +98,9 @@ "dev": true }, "@types/node-fetch": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.3.tgz", - "integrity": "sha512-X3TNlzZ7SuSwZsMkb5fV7GrPbVKvHc2iwHmslb8bIxRKWg2iqkfm3F/Wd79RhDpOXR7wCtKAwc5Y2JE6n/ibyw==", + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.4.tgz", + "integrity": "sha512-Oz6id++2qAOFuOlE1j0ouk1dzl3mmI1+qINPNBhi9nt/gVOz0G+13Ao6qjhdF0Ys+eOkhu6JnFmt38bR3H0POQ==", "dev": true, "requires": { "@types/node": "*" diff --git a/package.json b/package.json index 4d81a49aee..8cfdab65bf 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@types/mocha": "~5.2.7", "@types/mock-fs": "~4.10.0", "@types/node": "~10.11.0", - "@types/node-fetch": "~2.5.3", + "@types/node-fetch": "~2.5.4", "@types/rewire": "~2.5.28", "@types/semver": "~6.2.0", "@types/sinon": "~7.5.0", From adb18ead70631131f5df8fdf04221633caebb52f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2019 10:36:08 -0800 Subject: [PATCH 048/166] Bump @types/sinon from 7.5.0 to 7.5.1 (#2329) Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 7.5.0 to 7.5.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index dcf23016c8..ce48989a01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -119,9 +119,9 @@ "dev": true }, "@types/sinon": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.0.tgz", - "integrity": "sha512-NyzhuSBy97B/zE58cDw4NyGvByQbAHNP9069KVSgnXt/sc0T6MFRh0InKAeBVHJWdSXG1S3+PxgVIgKo9mTHbw==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.1.tgz", + "integrity": "sha512-EZQUP3hSZQyTQRfiLqelC9NMWd1kqLcmQE0dMiklxBkgi84T+cHOhnKpgk4NnOWpGX863yE6+IaGnOXUNFqDnQ==", "dev": true }, "acorn": { diff --git a/package.json b/package.json index 8cfdab65bf..a1786a22c5 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@types/node-fetch": "~2.5.4", "@types/rewire": "~2.5.28", "@types/semver": "~6.2.0", - "@types/sinon": "~7.5.0", + "@types/sinon": "~7.5.1", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.1", "mocha-multi-reporters": "~1.1.7", From dba7d83e91ab2b0d1e359f8f22237450437c1f17 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 26 Nov 2019 18:28:54 -0800 Subject: [PATCH 049/166] Fix update powershell feature on windows (#2325) * fix update powershell feature on windows * PR feedback --- src/features/UpdatePowerShell.ts | 77 ++++++++++++++++++++------------ src/process.ts | 4 +- src/session.ts | 1 + src/utils.ts | 8 ++-- 4 files changed, 56 insertions(+), 34 deletions(-) diff --git a/src/features/UpdatePowerShell.ts b/src/features/UpdatePowerShell.ts index 5252e11f65..ba33673063 100644 --- a/src/features/UpdatePowerShell.ts +++ b/src/features/UpdatePowerShell.ts @@ -2,13 +2,23 @@ * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ +import { spawn } from "child_process"; +import * as fs from "fs"; import fetch, { RequestInit } from "node-fetch"; +import * as os from "os"; +import * as path from "path"; import * as semver from "semver"; -import { MessageItem, window } from "vscode"; +import * as stream from "stream"; +import * as util from "util"; +import { MessageItem, ProgressLocation, window } from "vscode"; import { LanguageClient } from "vscode-languageclient"; +import { SessionManager } from "../session"; import * as Settings from "../settings"; +import { isMacOS, isWindows } from "../utils"; import { EvaluateRequestType } from "./Console"; +const streamPipeline = util.promisify(stream.pipeline); + const PowerShellGitHubReleasesUrl = "https://api.github.com/repos/PowerShell/PowerShell/releases/latest"; const PowerShellGitHubPrereleasesUrl = @@ -67,6 +77,7 @@ interface IUpdateMessageItem extends MessageItem { } export async function InvokePowerShellUpdateCheck( + sessionManager: SessionManager, languageServerClient: LanguageClient, localVersion: semver.SemVer, arch: string, @@ -103,7 +114,6 @@ export async function InvokePowerShellUpdateCheck( return; } - const isMacOS: boolean = process.platform === "darwin"; const result = await window.showInformationMessage( `${commonText} Would you like to update the version? ${ isMacOS ? "(Homebrew is required on macOS)" : "" @@ -116,39 +126,50 @@ export async function InvokePowerShellUpdateCheck( switch (result.id) { // Yes choice. case 0: - let script: string; - if (process.platform === "win32") { + if (isWindows) { const msiMatcher = arch === "x86" ? "win-x86.msi" : "win-x64.msi"; - const assetUrl = release.assets.filter((asset: any) => - asset.name.indexOf(msiMatcher) >= 0)[0].browser_download_url; - - // Grab MSI and run it. - // tslint:disable-next-line: max-line-length - script = ` -$randomFileName = [System.IO.Path]::GetRandomFileName() -$tmpMsiPath = Microsoft.PowerShell.Management\\Join-Path ([System.IO.Path]::GetTempPath()) "$randomFileName.msi" -Microsoft.PowerShell.Utility\\Invoke-RestMethod -Uri ${assetUrl} -OutFile $tmpMsiPath -try -{ - Microsoft.PowerShell.Management\\Start-Process -Wait -Path $tmpMsiPath -} -finally -{ - Microsoft.PowerShell.Management\\Remove-Item $tmpMsiPath -}`; + const asset = release.assets.filter((a: any) => a.name.indexOf(msiMatcher) >= 0)[0]; + const msiDownloadPath = path.join(os.tmpdir(), asset.name); - } else if (isMacOS) { - script = "brew cask upgrade powershell"; - if (release.isPreview) { - script = "brew cask upgrade powershell-preview"; + const res = await fetch(asset.browser_download_url); + if (!res.ok) { + throw new Error("unable to fetch MSI"); } + + await window.withProgress({ + title: "Downloading PowerShell Installer...", + location: ProgressLocation.Notification, + cancellable: false, + }, + async () => { + // Streams the body of the request to a file. + await streamPipeline(res.body, fs.createWriteStream(msiDownloadPath)); + }); + + // Stop the Integrated Console session because Windows likes to hold on to files. + sessionManager.stop(); + + // Invoke the MSI via cmd. + const msi = spawn("msiexec", ["/i", msiDownloadPath]); + + msi.on("close", (code) => { + // Now that the MSI is finished, start the Integrated Console session. + sessionManager.start(); + fs.unlinkSync(msiDownloadPath); + }); + + } else if (isMacOS) { + const script = release.isPreview + ? "brew cask upgrade powershell-preview" + : "brew cask upgrade powershell"; + + await languageServerClient.sendRequest(EvaluateRequestType, { + expression: script, + }); } - await languageServerClient.sendRequest(EvaluateRequestType, { - expression: script, - }); break; // Never choice. diff --git a/src/process.ts b/src/process.ts index 051da88488..d3d9a660ca 100644 --- a/src/process.ts +++ b/src/process.ts @@ -69,7 +69,7 @@ export class PowerShellProcess { ]; // Only add ExecutionPolicy param on Windows - if (utils.isWindowsOS()) { + if (utils.isWindows) { powerShellArgs.push("-ExecutionPolicy", "Bypass"); } @@ -77,7 +77,7 @@ export class PowerShellProcess { PowerShellProcess.escapeSingleQuotes(startScriptPath) + "' " + this.startArgs; - if (utils.isWindowsOS()) { + if (utils.isWindows) { powerShellArgs.push( "-Command", startEditorServices); diff --git a/src/session.ts b/src/session.ts index 7b4e5cb6b8..5a2cd3a6ac 100644 --- a/src/session.ts +++ b/src/session.ts @@ -546,6 +546,7 @@ export class SessionManager implements Middleware { await GitHubReleaseInformation.FetchLatestRelease(isPreRelease); await InvokePowerShellUpdateCheck( + this, this.languageServerClient, localVersion, this.versionDetails.architecture, diff --git a/src/utils.ts b/src/utils.ts index 8604c26deb..57527cf529 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -8,7 +8,7 @@ import fs = require("fs"); import os = require("os"); import path = require("path"); -export let PowerShellLanguageId = "powershell"; +export const PowerShellLanguageId = "powershell"; export function ensurePathExists(targetPath: string) { // Ensure that the path exists @@ -116,6 +116,6 @@ export function getTimestampString() { return `[${time.getHours()}:${time.getMinutes()}:${time.getSeconds()}]`; } -export function isWindowsOS(): boolean { - return os.platform() === "win32"; -} +export const isMacOS: boolean = process.platform === "darwin"; +export const isWindows: boolean = process.platform === "win32"; +export const isLinux: boolean = !isMacOS && !isWindows; From fb59b379edc67be5ca35e8c6f7445538c9b1a0b1 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 26 Nov 2019 18:30:43 -0800 Subject: [PATCH 050/166] Handle clearTerminal message by using vscode clear command (#2316) * handle clearTerminal message by using vscode clear command * Codacy * changed name of setting * delete comment --- package.json | 4 ++++ src/features/ExtensionCommands.ts | 17 ++++++++++++++++- src/settings.ts | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a1786a22c5..847e3a6133 100644 --- a/package.json +++ b/package.json @@ -688,6 +688,10 @@ "default": false, "description": "Falls back to the legacy (lightweight) ReadLine experience. This will disable the use of PSReadLine in the PowerShell Integrated Console." }, + "powershell.integratedConsole.forceClearScrollbackBuffer": { + "type": "boolean", + "description": "Use the vscode API to clear the terminal since that's the only reliable way to clear the scrollback buffer. Turn this on if you're use to 'Clear-Host' clearing scroll history as wellclear-terminal-via-lsp." + }, "powershell.debugging.createTemporaryIntegratedConsole": { "type": "boolean", "default": false, diff --git a/src/features/ExtensionCommands.ts b/src/features/ExtensionCommands.ts index 23c3159b68..504d660dd1 100644 --- a/src/features/ExtensionCommands.ts +++ b/src/features/ExtensionCommands.ts @@ -6,9 +6,11 @@ import * as fs from "fs"; import * as os from "os"; import * as path from "path"; import * as vscode from "vscode"; -import { LanguageClient, NotificationType, Position, Range, RequestType } from "vscode-languageclient"; +import { LanguageClient, NotificationType, NotificationType0, + Position, Range, RequestType } from "vscode-languageclient"; import { IFeature } from "../feature"; import { Logger } from "../logging"; +import Settings = require("../settings"); export interface IExtensionCommand { name: string; @@ -155,6 +157,9 @@ export const SetStatusBarMessageRequestType = new RequestType( "editor/setStatusBarMessage"); +export const ClearTerminalNotificationType = + new NotificationType0("editor/clearTerminal"); + export interface ISaveFileDetails { filePath: string; newPath?: string; @@ -265,6 +270,16 @@ export class ExtensionCommandsFeature implements IFeature { this.languageClient.onRequest( SetStatusBarMessageRequestType, (messageDetails) => this.setStatusBarMessage(messageDetails)); + + this.languageClient.onNotification( + ClearTerminalNotificationType, + () => { + // We check to see if they have TrueClear on. If not, no-op because the + // overriden Clear-Host already calls [System.Console]::Clear() + if (Settings.load().integratedConsole.forceClearScrollbackBuffer) { + vscode.commands.executeCommand("workbench.action.terminal.clear"); + } + }); } } diff --git a/src/settings.ts b/src/settings.ts index d29e4ee33c..397a0a9328 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -99,6 +99,7 @@ export interface IIntegratedConsoleSettings { showOnStartup?: boolean; focusConsoleOnExecute?: boolean; useLegacyReadLine?: boolean; + forceClearScrollbackBuffer?: boolean; } export function load(): ISettings { @@ -154,6 +155,7 @@ export function load(): ISettings { showOnStartup: true, focusConsoleOnExecute: true, useLegacyReadLine: false, + forceClearScrollbackBuffer: false, }; return { From 9033f149b04f967853915964566e5a8c8f82eea0 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 2 Dec 2019 19:26:20 -0500 Subject: [PATCH 051/166] Update URLs to point to master branch (#2338) --- scripts/Install-VSCode.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Install-VSCode.ps1 b/scripts/Install-VSCode.ps1 index 55889b9477..ac3759161a 100644 --- a/scripts/Install-VSCode.ps1 +++ b/scripts/Install-VSCode.ps1 @@ -12,9 +12,9 @@ .TAGS install vscode installer -.LICENSEURI https://github.com/PowerShell/vscode-powershell/blob/develop/LICENSE.txt +.LICENSEURI https://github.com/PowerShell/vscode-powershell/blob/master/LICENSE.txt -.PROJECTURI https://github.com/PowerShell/vscode-powershell/blob/develop/scripts/Install-VSCode.ps1 +.PROJECTURI https://github.com/PowerShell/vscode-powershell/blob/master/scripts/Install-VSCode.ps1 .ICONURI From 5a4e11147dd664b0747b494fd162887e2ca0067f Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Tue, 10 Dec 2019 15:09:36 -0800 Subject: [PATCH 052/166] Start EditorServices without start script (#2348) --- src/process.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/process.ts b/src/process.ts index d3d9a660ca..aefcd451f1 100644 --- a/src/process.ts +++ b/src/process.ts @@ -41,11 +41,11 @@ export class PowerShellProcess { return new Promise( (resolve, reject) => { try { - const startScriptPath = + const psesModulePath = path.resolve( __dirname, this.bundledModulesPath, - "PowerShellEditorServices/Start-EditorServices.ps1"); + "PowerShellEditorServices/PowerShellEditorServices.psd1"); const editorServicesLogPath = this.log.getLogFilePath(logFileName); @@ -73,9 +73,9 @@ export class PowerShellProcess { powerShellArgs.push("-ExecutionPolicy", "Bypass"); } - const startEditorServices = "& '" + - PowerShellProcess.escapeSingleQuotes(startScriptPath) + - "' " + this.startArgs; + const startEditorServices = "Import-Module '" + + PowerShellProcess.escapeSingleQuotes(psesModulePath) + + "'; Start-EditorServices " + this.startArgs; if (utils.isWindows) { powerShellArgs.push( @@ -108,7 +108,7 @@ export class PowerShellProcess { this.log.write( "Language server starting --", " exe: " + powerShellExePath, - " args: " + startScriptPath + " " + this.startArgs); + " args: " + startEditorServices); // Make sure no old session file exists utils.deleteSessionFile(this.sessionFilePath); From 71a0b1fee24b38344a986feaa35fcee724effe0c Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Wed, 11 Dec 2019 16:06:50 -0800 Subject: [PATCH 053/166] [Ignore] Update powershell-preview CHANGELOG for v2019.12.0 (#2360) --- CHANGELOG.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2cc8dbab2..1064ffb840 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,53 @@ # PowerShell Preview Extension Release History +## v2019.12.0 +### Wednesday, December 11, 2019 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- ⚡️ 🛫 [vscode-PowerShell #2348](https://github.com/PowerShell/vscode-PowerShell/pull/2348) - + Start EditorServices without start script. +- ✨ 📟 [vscode-PowerShell #2316](https://github.com/PowerShell/vscode-PowerShell/pull/2316) - + Handle clearTerminal message by using vscode clear command. +- 🐛 📺 [vscode-PowerShell #2325](https://github.com/PowerShell/vscode-PowerShell/pull/2325) - + Fix update powershell feature on windows. +- 🔧 📁 🐛 [vscode-powershell #2099](https://github.com/PowerShell/vscode-PowerShell/pull/2304) - + Use `powerShellDefaultVersion` everywhere and stop using `powerShellExePath`. +- 🐛 📺 [vscode-PowerShell #2294](https://github.com/PowerShell/vscode-PowerShell/pull/2294) - + Buttons show up for untitled files. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 👷 📟 [PowerShellEditorServices #1129](https://github.com/PowerShell/PowerShellEditorServices/pull/1129) - + Update PSReadLine to 2.0.0-rc1 in modules.json. +- 🛫 🐛 ⚡️ [vscode-powershell #2292](https://github.com/PowerShell/PowerShellEditorServices/pull/1118) - + Isolate PSES dependencies from PowerShell on load + make PSES a pure binary module. +- ✨ 📟 [PowerShellEditorServices #1108](https://github.com/PowerShell/PowerShellEditorServices/pull/1108) - + Clear the terminal via the LSP. +- 🔍 🐛 [vscode-powershell #2319](https://github.com/PowerShell/PowerShellEditorServices/pull/1117) - + Run one invocation per SetBreakpoints request. (Thanks @SeeminglyScience!) +- 🐛 [PowerShellEditorServices #1114](https://github.com/PowerShell/PowerShellEditorServices/pull/1114) - + Fix Import-EditorCommand -Module. (Thanks @sk82jack!) +- 🐛 🔍 [PowerShellEditorServices #1112](https://github.com/PowerShell/PowerShellEditorServices/pull/1112) - + Fix breakpoint setting deadlock. +- 🔗 🐛 [vscode-powershell #2306](https://github.com/PowerShell/PowerShellEditorServices/pull/1110) - + Fix references on Windows due to bad WorkspacePath. +- ✨ 👷 [PowerShellEditorServices #993](https://github.com/PowerShell/PowerShellEditorServices/pull/993) - + Add devcontainer support for building in container. (Thanks @bergmeister!) +- 🛫 🐛 [vscode-powershell #2311](https://github.com/PowerShell/PowerShellEditorServices/pull/1107) - + Protect against no RootUri (no open workspace). +- 🐛 📟 [vscode-powershell #2274](https://github.com/PowerShell/PowerShellEditorServices/pull/1092) - + Fix '@' appearing in console. +- 👮‍ 🐛 [vscode-powershell #2288](https://github.com/PowerShell/PowerShellEditorServices/pull/1094) - + Use RootUri.LocalPath for workspace path. +- 🐛 👮‍ [PowerShellEditorServices #1101](https://github.com/PowerShell/PowerShellEditorServices/pull/1101) - + Add PSAvoidAssignmentToAutomaticVariable to the default set of PSSA rules. (Thanks @bergmeister!) +- 👮‍ 🔗 🐛 [vscode-powershell #2290](https://github.com/PowerShell/PowerShellEditorServices/pull/1098) - + Fix diagnostics not showing in untitled files and now also show CodeLens. +- 🔍 🐛 [vscode-powershell #1850](https://github.com/PowerShell/PowerShellEditorServices/pull/1097) - + Fixes no prompt showing up when debugging. +- 🚂 📺 🐛 [vscode-powershell #2284](https://github.com/PowerShell/PowerShellEditorServices/pull/1096) - + Fix running indicator by ignoring PSRL aborts. + ## v2019.11.0 ### Friday, November 1, 2019 diff --git a/package-lock.json b/package-lock.json index ce48989a01..a21e536a44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "powershell-preview", - "version": "2019.11.0", + "version": "2019.12.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 847e3a6133..0d94be3db3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2019.11.0", + "version": "2019.12.0", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From 17add9d7a8e739e88d8e1173338e22ba245a586f Mon Sep 17 00:00:00 2001 From: corbob <30301021+corbob@users.noreply.github.com> Date: Thu, 12 Dec 2019 16:57:51 -0800 Subject: [PATCH 054/166] Add commands to set and unset ISE Compatibility features (#2335) * Add commands to set and unset ISE Compatibility features * Rename to Enable/Disable ISE Mode. Some formatting changes due to vscode format document. Remove option to hide PSIC Check that user hasn't modified settings from ISE settings before returning them to default. * use async await * Update Variable Names. Add interface for settings. * Change foreach to for. * Allow testing on Linux. Caveat: This is sometimes inconsistent if there were compile errors. Sometimes need to run Invoke-Build Clean before Invoke-Build Test will pick up code changes. * Add some tests. * change registerCommand to fix tests * line length * move to static * skip tests on linux * additional checks * move to new lib to update timeout * color check * launch args * revert change that shouldn't have been in * try to run on linux again * change changelog and no ci on linux * command explorer --- CHANGELOG.md | 12 +- package-lock.json | 481 +++---------------------- package.json | 21 +- src/features/ISECompatibility.ts | 70 ++++ src/main.ts | 2 + src/settings.ts | 11 + test/features/ISECompatibility.test.ts | 39 ++ test/index.ts | 21 -- test/runTests.ts | 30 ++ test/testRunner.ts | 49 +++ vscode-powershell.build.ps1 | 11 +- 11 files changed, 273 insertions(+), 474 deletions(-) create mode 100644 src/features/ISECompatibility.ts create mode 100644 test/features/ISECompatibility.test.ts delete mode 100644 test/index.ts create mode 100644 test/runTests.ts create mode 100644 test/testRunner.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 1064ffb840..72e3406633 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,14 @@ ### Wednesday, December 11, 2019 #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) +- ✨ 📺 [vscode-PowerShell #2335](https://github.com/PowerShell/vscode-powershell/pull/2335) - + Add editor command `PowerShell: Enable/Disable ISE Mode` for ISE emulation in VS Code. - ⚡️ 🛫 [vscode-PowerShell #2348](https://github.com/PowerShell/vscode-PowerShell/pull/2348) - Start EditorServices without start script. - ✨ 📟 [vscode-PowerShell #2316](https://github.com/PowerShell/vscode-PowerShell/pull/2316) - - Handle clearTerminal message by using vscode clear command. + Add `powershell.integratedConsole.forceClearScrollbackBuffer` setting to enable `Clear-Host` to clear scrollback buffer. - 🐛 📺 [vscode-PowerShell #2325](https://github.com/PowerShell/vscode-PowerShell/pull/2325) - - Fix update powershell feature on windows. + Fix update PowerShell feature on windows. - 🔧 📁 🐛 [vscode-powershell #2099](https://github.com/PowerShell/vscode-PowerShell/pull/2304) - Use `powerShellDefaultVersion` everywhere and stop using `powerShellExePath`. - 🐛 📺 [vscode-PowerShell #2294](https://github.com/PowerShell/vscode-PowerShell/pull/2294) - @@ -22,11 +24,11 @@ - 🛫 🐛 ⚡️ [vscode-powershell #2292](https://github.com/PowerShell/PowerShellEditorServices/pull/1118) - Isolate PSES dependencies from PowerShell on load + make PSES a pure binary module. - ✨ 📟 [PowerShellEditorServices #1108](https://github.com/PowerShell/PowerShellEditorServices/pull/1108) - - Clear the terminal via the LSP. + Clear the terminal via the LSP message `editor/clearTerminal`. - 🔍 🐛 [vscode-powershell #2319](https://github.com/PowerShell/PowerShellEditorServices/pull/1117) - Run one invocation per SetBreakpoints request. (Thanks @SeeminglyScience!) - 🐛 [PowerShellEditorServices #1114](https://github.com/PowerShell/PowerShellEditorServices/pull/1114) - - Fix Import-EditorCommand -Module. (Thanks @sk82jack!) + Fix `Import-EditorCommand -Module`. (Thanks @sk82jack!) - 🐛 🔍 [PowerShellEditorServices #1112](https://github.com/PowerShell/PowerShellEditorServices/pull/1112) - Fix breakpoint setting deadlock. - 🔗 🐛 [vscode-powershell #2306](https://github.com/PowerShell/PowerShellEditorServices/pull/1110) - @@ -40,7 +42,7 @@ - 👮‍ 🐛 [vscode-powershell #2288](https://github.com/PowerShell/PowerShellEditorServices/pull/1094) - Use RootUri.LocalPath for workspace path. - 🐛 👮‍ [PowerShellEditorServices #1101](https://github.com/PowerShell/PowerShellEditorServices/pull/1101) - - Add PSAvoidAssignmentToAutomaticVariable to the default set of PSSA rules. (Thanks @bergmeister!) + Add `PSAvoidAssignmentToAutomaticVariable` to the default set of PSSA rules. (Thanks @bergmeister!) - 👮‍ 🔗 🐛 [vscode-powershell #2290](https://github.com/PowerShell/PowerShellEditorServices/pull/1098) - Fix diagnostics not showing in untitled files and now also show CodeLens. - 🔍 🐛 [vscode-powershell #1850](https://github.com/PowerShell/PowerShellEditorServices/pull/1097) - diff --git a/package-lock.json b/package-lock.json index a21e536a44..4c63845d90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,6 +76,29 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/@types/events/-/@types/events-3.0.0.tgz", + "integrity": "sha1-KGLz9Yqaf3w+eNefEw3U1xwlwqc=", + "dev": true + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/@types/glob/-/@types/glob-7.1.1.tgz", + "integrity": "sha1-qlmhxuP7xCHgfM0xqUTDDrpSFXU=", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/@types/minimatch/-/@types/minimatch-3.0.3.tgz", + "integrity": "sha1-PcoOPzOyAPx9ETnAzZbBJoyt/Z0=", + "dev": true + }, "@types/mocha": { "version": "5.2.7", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", @@ -124,6 +147,12 @@ "integrity": "sha512-EZQUP3hSZQyTQRfiLqelC9NMWd1kqLcmQE0dMiklxBkgi84T+cHOhnKpgk4NnOWpGX863yE6+IaGnOXUNFqDnQ==", "dev": true }, + "@types/vscode": { + "version": "1.34.0", + "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/@types/vscode/-/@types/vscode-1.34.0.tgz", + "integrity": "sha1-Wr3YtUi+CMj+P/98PjstUy4yV0E=", + "dev": true + }, "acorn": { "version": "5.7.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", @@ -149,8 +178,8 @@ }, "agent-base": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha1-gWXwHENgCbzK0LHRIvBe13Dvxu4=", "dev": true, "requires": { "es6-promisify": "^5.0.0" @@ -218,21 +247,6 @@ "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", "dev": true }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, "async-hook-jl": { "version": "1.7.6", "resolved": "https://registry.npmjs.org/async-hook-jl/-/async-hook-jl-1.7.6.tgz", @@ -257,24 +271,6 @@ } } }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", - "dev": true - }, "azure-devops-node-api": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-7.2.0.tgz", @@ -340,15 +336,6 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, "boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -404,12 +391,6 @@ "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -517,15 +498,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, "commander": { "version": "2.15.1", "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", @@ -600,15 +572,6 @@ "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", "dev": true }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -624,12 +587,6 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, "denodeify": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/denodeify/-/denodeify-1.2.1.tgz", @@ -712,16 +669,6 @@ "domelementtype": "1" } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "emitter-listener": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz", @@ -738,13 +685,13 @@ }, "es6-promise": { "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha1-TrIVlMlyvEBVPSduUQU5FD21Pgo=", "dev": true }, "es6-promisify": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "dev": true, "requires": { @@ -873,12 +820,6 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, "external-editor": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", @@ -890,12 +831,6 @@ "tmp": "^0.0.33" } }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, "fast-deep-equal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", @@ -954,23 +889,6 @@ "write": "^0.2.1" } }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -983,15 +901,6 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", @@ -1024,48 +933,6 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "dev": true, - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - }, - "dependencies": { - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - } - } - }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -1124,29 +991,18 @@ }, "http-proxy-agent": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", - "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha1-5IIb7vWyFCogJr1zkm/lN2McVAU=", "dev": true, "requires": { "agent-base": "4", "debug": "3.1.0" } }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, "https-proxy-agent": { "version": "2.2.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", - "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", + "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha1-TuenN6vZJniik9mzShr00NCMeHs=", "dev": true, "requires": { "agent-base": "^4.3.0", @@ -1236,12 +1092,6 @@ "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1254,12 +1104,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", @@ -1276,18 +1120,6 @@ "esprima": "^4.0.0" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, "json-schema-traverse": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", @@ -1300,24 +1132,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "just-extend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", @@ -1401,21 +1215,6 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true }, - "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", - "dev": true - }, - "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "dev": true, - "requires": { - "mime-db": "1.40.0" - } - }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", @@ -1550,12 +1349,6 @@ "boolbase": "~1.0.0" } }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -1689,12 +1482,6 @@ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", "dev": true }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, "pluralize": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", @@ -1725,30 +1512,6 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, - "psl": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz", - "integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==", - "dev": true - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, - "querystringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", - "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", - "dev": true - }, "read": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", @@ -1779,34 +1542,6 @@ "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", "dev": true }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, "require-uncached": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", @@ -1817,12 +1552,6 @@ "resolve-from": "^1.0.0" } }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", - "dev": true - }, "resolve": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", @@ -1984,45 +1713,12 @@ "is-fullwidth-code-point": "^2.0.0" } }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, "stack-chain": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/stack-chain/-/stack-chain-1.3.7.tgz", @@ -2106,24 +1802,6 @@ "os-tmpdir": "~1.0.2" } }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } - } - }, "tslib": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", @@ -2180,21 +1858,6 @@ "integrity": "sha1-LTeFoVjBdMmhbcLARuxfxfF0IhM=", "dev": true }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -2244,54 +1907,18 @@ "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", "dev": true }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, "url-join": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz", "integrity": "sha1-dBxsL0WWxIMNZxhGCSDQySIC3Hg=", "dev": true }, - "url-parse": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", - "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", - "dev": true, - "requires": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "vsce": { "version": "1.64.0", "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.64.0.tgz", @@ -2337,29 +1964,6 @@ } } }, - "vscode": { - "version": "1.1.36", - "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.36.tgz", - "integrity": "sha512-cGFh9jmGLcTapCpPCKvn8aG/j9zVQ+0x5hzYJq5h5YyUXVGa1iamOaB2M2PZXoumQPES4qeAP1FwkI0b6tL4bQ==", - "dev": true, - "requires": { - "glob": "^7.1.2", - "mocha": "^5.2.0", - "request": "^2.88.0", - "semver": "^5.4.1", - "source-map-support": "^0.5.0", - "url-parse": "^1.4.4", - "vscode-test": "^0.4.1" - }, - "dependencies": { - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - } - } - }, "vscode-extension-telemetry": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.2.tgz", @@ -2404,13 +2008,14 @@ "integrity": "sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==" }, "vscode-test": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-0.4.3.tgz", - "integrity": "sha512-EkMGqBSefZH2MgW65nY05rdRSko15uvzq4VAPM5jVmwYuFQKE7eikKXNJDRxL+OITXHB6pI+a3XqqD32Y3KC5w==", + "version": "1.3.0", + "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/vscode-test/-/vscode-test-1.3.0.tgz", + "integrity": "sha1-MxCrOF2biHtMguj1K+EDDnz5ST0=", "dev": true, "requires": { "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.1" + "https-proxy-agent": "^2.2.4", + "rimraf": "^2.6.3" } }, "which": { diff --git a/package.json b/package.json index 0d94be3db3..0931fb3fb9 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,8 @@ "onCommand:PowerShell.ShowSessionConsole", "onCommand:PowerShell.ShowSessionMenu", "onCommand:PowerShell.RestartSession", + "onCommand:PowerShell.EnableISEMode", + "onCommand:PowerShell.DisableISEMode", "onView:PowerShellCommands" ], "dependencies": { @@ -47,6 +49,7 @@ "vscode-languageclient": "~5.2.1" }, "devDependencies": { + "@types/glob": "^7.1.1", "@types/mocha": "~5.2.7", "@types/mock-fs": "~4.10.0", "@types/node": "~10.11.0", @@ -54,6 +57,7 @@ "@types/rewire": "~2.5.28", "@types/semver": "~6.2.0", "@types/sinon": "~7.5.1", + "@types/vscode": "1.34.0", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.1", "mocha-multi-reporters": "~1.1.7", @@ -63,7 +67,7 @@ "tslint": "~5.20.1", "typescript": "~3.5.3", "vsce": "~1.64.0", - "vscode": "~1.1.36" + "vscode-test": "~1.3.0" }, "extensionDependencies": [ "vscode.powershell" @@ -71,8 +75,7 @@ "scripts": { "compile": "tsc -v && tsc -p ./ && tslint -p ./", "compile-watch": "tsc -watch -p ./", - "postinstall": "node ./node_modules/vscode/bin/install", - "test": "node ./node_modules/vscode/bin/test" + "test": "node ./out/test/runTests.js" }, "contributes": { "breakpoints": [ @@ -84,7 +87,7 @@ "activitybar": [ { "id": "PowerShellCommandExplorer", - "title": "PowerShell Command Explorer", + "title": "(Preview) PowerShell Command Explorer", "icon": "media/pwsh.svg" } ] @@ -133,6 +136,16 @@ "title": "Expand Alias", "category": "PowerShell" }, + { + "command": "PowerShell.EnableISEMode", + "title": "Enable ISE Mode", + "category": "PowerShell" + }, + { + "command": "PowerShell.DisableISEMode", + "title": "Disable ISE Mode (restore to defaults)", + "category": "PowerShell" + }, { "command": "PowerShell.RefreshCommandsExplorer", "title": "Refresh Command Explorer", diff --git a/src/features/ISECompatibility.ts b/src/features/ISECompatibility.ts new file mode 100644 index 0000000000..6bdf3f1edf --- /dev/null +++ b/src/features/ISECompatibility.ts @@ -0,0 +1,70 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +import * as vscode from "vscode"; +import { LanguageClient } from "vscode-languageclient"; +import { IFeature } from "../feature"; +import * as Settings from "../settings"; + +interface ISetting { + path: string; + name: string; + value: string | boolean; +} + +/** + * A feature to implement commands to make code like the ISE and reset the settings. + */ +export class ISECompatibilityFeature implements IFeature { + // Marking settings as public so we can use it within the tests without needing to duplicate the list of settings. + public static settings: ISetting[] = [ + { path: "workbench.activityBar", name: "visible", value: false }, + { path: "debug", name: "openDebug", value: "neverOpen" }, + { path: "editor", name: "tabCompletion", value: "on" }, + { path: "powershell.integratedConsole", name: "focusConsoleOnExecute", value: false }, + { path: "files", name: "defaultLanguage", value: "powershell" }, + { path: "workbench", name: "colorTheme", value: "PowerShell ISE" }, + ]; + private iseCommandRegistration: vscode.Disposable; + private defaultCommandRegistration: vscode.Disposable; + private languageClient: LanguageClient; + + constructor() { + this.iseCommandRegistration = vscode.commands.registerCommand( + "PowerShell.EnableISEMode", this.EnableISEMode); + this.defaultCommandRegistration = vscode.commands.registerCommand( + "PowerShell.DisableISEMode", this.DisableISEMode); + } + + public dispose() { + this.iseCommandRegistration.dispose(); + this.defaultCommandRegistration.dispose(); + } + + public setLanguageClient(languageclient: LanguageClient) { + this.languageClient = languageclient; + } + + private async EnableISEMode() { + for (const iseSetting of ISECompatibilityFeature.settings) { + await vscode.workspace.getConfiguration(iseSetting.path).update(iseSetting.name, iseSetting.value, true); + } + + // Show the PowerShell Command Explorer + await vscode.commands.executeCommand("workbench.view.extension.PowerShellCommandExplorer"); + + if (!Settings.load().sideBar.CommandExplorerVisibility) { + // Hide the explorer if the setting says so. + await vscode.commands.executeCommand("workbench.action.toggleSidebarVisibility"); + } + } + + private async DisableISEMode() { + for (const iseSetting of ISECompatibilityFeature.settings) { + const currently = vscode.workspace.getConfiguration(iseSetting.path).get(iseSetting.name); + if (currently === iseSetting.value) { + await vscode.workspace.getConfiguration(iseSetting.path).update(iseSetting.name, undefined, true); + } + } + } +} diff --git a/src/main.ts b/src/main.ts index b88886f9ca..02a152f5ef 100644 --- a/src/main.ts +++ b/src/main.ts @@ -23,6 +23,7 @@ import { FindModuleFeature } from "./features/FindModule"; import { GenerateBugReportFeature } from "./features/GenerateBugReport"; import { GetCommandsFeature } from "./features/GetCommands"; import { HelpCompletionFeature } from "./features/HelpCompletion"; +import { ISECompatibilityFeature } from "./features/ISECompatibility"; import { NewFileOrProjectFeature } from "./features/NewFileOrProject"; import { OpenInISEFeature } from "./features/OpenInISE"; import { PesterTestsFeature } from "./features/PesterTests"; @@ -146,6 +147,7 @@ export function activate(context: vscode.ExtensionContext): void { new GenerateBugReportFeature(sessionManager), new ExpandAliasFeature(logger), new GetCommandsFeature(logger), + new ISECompatibilityFeature(), new ShowHelpFeature(logger), new FindModuleFeature(), new PesterTestsFeature(sessionManager), diff --git a/src/settings.ts b/src/settings.ts index 397a0a9328..d57a9cedf7 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -93,6 +93,7 @@ export interface ISettings { codeFormatting?: ICodeFormattingSettings; integratedConsole?: IIntegratedConsoleSettings; bugReporting?: IBugReportingSettings; + sideBar?: ISideBarSettings; } export interface IIntegratedConsoleSettings { @@ -102,6 +103,10 @@ export interface IIntegratedConsoleSettings { forceClearScrollbackBuffer?: boolean; } +export interface ISideBarSettings { + CommandExplorerVisibility?: boolean; +} + export function load(): ISettings { const configuration: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration( @@ -158,6 +163,10 @@ export function load(): ISettings { forceClearScrollbackBuffer: false, }; + const defaultSideBarSettings: ISideBarSettings = { + CommandExplorerVisibility: true, + }; + return { startAutomatically: configuration.get("startAutomatically", true), @@ -191,6 +200,8 @@ export function load(): ISettings { configuration.get("integratedConsole", defaultIntegratedConsoleSettings), bugReporting: configuration.get("bugReporting", defaultBugReportingSettings), + sideBar: + configuration.get("sideBar", defaultSideBarSettings), }; } diff --git a/test/features/ISECompatibility.test.ts b/test/features/ISECompatibility.test.ts new file mode 100644 index 0000000000..aa2e32b4a3 --- /dev/null +++ b/test/features/ISECompatibility.test.ts @@ -0,0 +1,39 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +import * as assert from "assert"; +import * as vscode from "vscode"; +import { ISECompatibilityFeature } from "../../src/features/ISECompatibility"; + +suite("ISECompatibility feature", () => { + test("It sets ISE Settings", async () => { + await vscode.commands.executeCommand("PowerShell.EnableISEMode"); + for (const iseSetting of ISECompatibilityFeature.settings) { + const currently = vscode.workspace.getConfiguration(iseSetting.path).get(iseSetting.name); + assert.equal(currently, iseSetting.value); + } + }); + test("It unsets ISE Settings", async () => { + // Change state to something that DisableISEMode will change + await vscode.workspace.getConfiguration("workbench").update("colorTheme", "PowerShell ISE", true); + assert.equal(vscode.workspace.getConfiguration("workbench").get("colorTheme"), "PowerShell ISE"); + + await vscode.commands.executeCommand("PowerShell.DisableISEMode"); + for (const iseSetting of ISECompatibilityFeature.settings) { + const currently = vscode.workspace.getConfiguration(iseSetting.path).get(iseSetting.name); + assert.notEqual(currently, iseSetting.value); + } + }); + test("It leaves Theme after being changed after enabling ISE Mode", async () => { + await vscode.commands.executeCommand("PowerShell.EnableISEMode"); + assert.equal(vscode.workspace.getConfiguration("workbench").get("colorTheme"), "PowerShell ISE"); + + await vscode.workspace.getConfiguration("workbench").update("colorTheme", "Dark+", true); + await vscode.commands.executeCommand("PowerShell.DisableISEMode"); + for (const iseSetting of ISECompatibilityFeature.settings) { + const currently = vscode.workspace.getConfiguration(iseSetting.path).get(iseSetting.name); + assert.notEqual(currently, iseSetting.value); + } + assert.equal(vscode.workspace.getConfiguration("workbench").get("colorTheme"), "Dark+"); + }); +}); diff --git a/test/index.ts b/test/index.ts deleted file mode 100644 index a42d35d3bb..0000000000 --- a/test/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------------------------------- -* Copyright (C) Microsoft Corporation. All rights reserved. -*--------------------------------------------------------*/ -// tslint:disable no-var-requires -import * as path from "path"; -import testRunner = require("vscode/lib/testrunner"); - -// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for options -testRunner.configure({ - ui: "tdd", // the TDD UI is being used in extension.test.ts (suite, test, etc.) - useColors: true, // colored output from test results - reporter: "mocha-multi-reporters", - reporterOptions: { - reporterEnabled: "spec, mocha-junit-reporter", - mochaJunitReporterReporterOptions: { - mochaFile: path.join(__dirname, "..", "..", "test-results.xml"), - }, - }, -}); - -module.exports = testRunner; diff --git a/test/runTests.ts b/test/runTests.ts new file mode 100644 index 0000000000..34d5f724bd --- /dev/null +++ b/test/runTests.ts @@ -0,0 +1,30 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ + +import * as path from "path"; + +import { runTests } from "vscode-test"; + +async function main() { + try { + // The folder containing the Extension Manifest package.json + // Passed to `--extensionDevelopmentPath` + const extensionDevelopmentPath = path.resolve(__dirname, "../../"); + + // The path to the extension test runner script + // Passed to --extensionTestsPath + const extensionTestsPath = path.resolve(__dirname, "./testRunner"); + + // Download VS Code, unzip it and run the integration test from the local directory. + await runTests({ extensionDevelopmentPath, extensionTestsPath, launchArgs: ["."] }); + } catch (err) { + // tslint:disable-next-line:no-console + console.error(err); + // tslint:disable-next-line:no-console + console.error("Failed to run tests"); + process.exit(1); + } +} + +main(); diff --git a/test/testRunner.ts b/test/testRunner.ts new file mode 100644 index 0000000000..fec33426db --- /dev/null +++ b/test/testRunner.ts @@ -0,0 +1,49 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ + +import * as glob from "glob"; +import * as Mocha from "mocha"; +import * as path from "path"; + +export function run(): Promise { + // Create the mocha test + const mocha = new Mocha({ + ui: "tdd", // the TDD UI is being used in extension.test.ts (suite, test, etc.) + useColors: !process.env.TF_BUILD, // colored output from test results + reporter: "mocha-multi-reporters", + timeout: 5000, + reporterOptions: { + reporterEnabled: "spec, mocha-junit-reporter", + mochaJunitReporterReporterOptions: { + mochaFile: path.join(__dirname, "..", "..", "test-results.xml"), + }, + }, + }); + + const testsRoot = path.resolve(__dirname, ".."); + + return new Promise((c, e) => { + glob("**/**.test.js", { cwd: testsRoot }, (err: any, files: any[]) => { + if (err) { + return e(err); + } + + // Add files to the test suite + files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f))); + + try { + // Run the mocha test + mocha.run((failures) => { + if (failures > 0) { + e(new Error(`${failures} tests failed.`)); + } else { + c(); + } + }); + } catch (err) { + e(err); + } + }); + }); +} diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index b5958ea059..bab5a96781 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -101,13 +101,12 @@ task BuildAll BuildEditorServices, Build #region Test tasks task Test Build, { - if (!$global:IsLinux) { - Write-Host "`n### Running extension tests" -ForegroundColor Green - exec { & npm run test } - } - else { - Write-Warning "Skipping extension tests on Linux platform because vscode does not support it." + if ($env:TF_BUILD -and $global:IsLinux) { + Write-Warning "Skipping extension tests in Linux CI because vscode does not support it." + return } + Write-Host "`n### Running extension tests" -ForegroundColor Green + exec { & npm run test } } task TestEditorServices { From f2c925d6209dad01c6475027eab0192dd7d4dbd4 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Mon, 6 Jan 2020 16:29:43 -0800 Subject: [PATCH 055/166] Add configuration to enable/disable banner (#2398) --- package.json | 5 +++++ src/session.ts | 4 ++++ src/settings.ts | 1 + 3 files changed, 10 insertions(+) diff --git a/package.json b/package.json index 0931fb3fb9..7c1e96b258 100644 --- a/package.json +++ b/package.json @@ -705,6 +705,11 @@ "type": "boolean", "description": "Use the vscode API to clear the terminal since that's the only reliable way to clear the scrollback buffer. Turn this on if you're use to 'Clear-Host' clearing scroll history as wellclear-terminal-via-lsp." }, + "powershell.integratedConsole.suppressStartupBanner": { + "type": "boolean", + "default": false, + "description": "Do not show the Powershell Integrated Console banner on launch" + }, "powershell.debugging.createTemporaryIntegratedConsole": { "type": "boolean", "default": false, diff --git a/src/session.ts b/src/session.ts index 5a2cd3a6ac..63ca5cd18f 100644 --- a/src/session.ts +++ b/src/session.ts @@ -187,6 +187,10 @@ export class SessionManager implements Middleware { `-BundledModulesPath '${PowerShellProcess.escapeSingleQuotes(this.bundledModulesPath)}' ` + `-EnableConsoleRepl `; + if (this.sessionSettings.integratedConsole.suppressStartupBanner) { + this.editorServicesArgs += "-StartupBanner '' "; + } + if (this.sessionSettings.developer.editorServicesWaitForDebugger) { this.editorServicesArgs += "-WaitForDebugger "; } diff --git a/src/settings.ts b/src/settings.ts index d57a9cedf7..99e73266af 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -101,6 +101,7 @@ export interface IIntegratedConsoleSettings { focusConsoleOnExecute?: boolean; useLegacyReadLine?: boolean; forceClearScrollbackBuffer?: boolean; + suppressStartupBanner?: boolean; } export interface ISideBarSettings { From 17c520aa45f27026c4ab3bb64f917504f8e8c1c2 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Mon, 6 Jan 2020 16:30:01 -0800 Subject: [PATCH 056/166] Make PowerShell names case insensitive for configuration (#2399) --- src/session.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/session.ts b/src/session.ts index 63ca5cd18f..145ecfbd00 100644 --- a/src/session.ts +++ b/src/session.ts @@ -127,7 +127,9 @@ export class SessionManager implements Middleware { let powerShellExeDetails; if (this.sessionSettings.powerShellDefaultVersion) { for (const details of this.powershellExeFinder.enumeratePowerShellInstallations()) { - if (details.displayName === this.sessionSettings.powerShellDefaultVersion) { + // Need to compare names case-insensitively, from https://stackoverflow.com/a/2140723 + const wantedName = this.sessionSettings.powerShellDefaultVersion; + if (wantedName.localeCompare(details.displayName, undefined, { sensitivity: "accent" }) === 0) { powerShellExeDetails = details; break; } From 9f9f6ca1fb7ad8bbcb3b3dca742294983e4de2d1 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Fri, 10 Jan 2020 12:36:21 -0800 Subject: [PATCH 057/166] Add -Login startup option (#2400) * Add -Login startup option * Improve dummy command * Add explanatory comment * switch to .osx & .linux and code clean up * remove import * rob's feedback Co-authored-by: Tyler James Leonhardt --- package.json | 15 +++++++++----- src/process.ts | 55 ++++++++++++++++++++++++++++--------------------- src/settings.ts | 20 ++++++++++++++++-- 3 files changed, 59 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 7c1e96b258..1219edcedb 100644 --- a/package.json +++ b/package.json @@ -550,6 +550,16 @@ "description": "Specifies whether you should be prompted to update your version of PowerShell.", "default": true }, + "powershell.startAsLoginShell.osx": { + "type": "boolean", + "default": true, + "description": "Starts the PowerShell extension's underlying PowerShell process as a login shell, if applicable." + }, + "powershell.startAsLoginShell.linux": { + "type": "boolean", + "default": false, + "description": "Starts the PowerShell extension's underlying PowerShell process as a login shell, if applicable." + }, "powershell.startAutomatically": { "type": "boolean", "default": true, @@ -740,11 +750,6 @@ "type": "array", "default": null, "description": "An array of strings that enable experimental features in the PowerShell extension." - }, - "powershell.developer.powerShellExeIsWindowsDevBuild": { - "type": "boolean", - "default": false, - "description": "Indicates that the powerShellExePath points to a developer build of Windows PowerShell and configures it for development." } } }, diff --git a/src/process.ts b/src/process.ts index aefcd451f1..3138c6cfdb 100644 --- a/src/process.ts +++ b/src/process.ts @@ -63,10 +63,19 @@ export class PowerShellProcess { this.startArgs += "-UseLegacyReadLine"; } - const powerShellArgs = [ - "-NoProfile", - "-NonInteractive", - ]; + const powerShellArgs = []; + + const useLoginShell: boolean = + (utils.isMacOS && this.sessionSettings.startAsLoginShell.osx) + || (utils.isLinux && this.sessionSettings.startAsLoginShell.linux); + + if (useLoginShell && this.isLoginShell(this.exePath)) { + // This MUST be the first argument. + powerShellArgs.push("-Login"); + } + + powerShellArgs.push("-NoProfile"); + powerShellArgs.push("-NonInteractive"); // Only add ExecutionPolicy param on Windows if (utils.isWindows) { @@ -88,27 +97,11 @@ export class PowerShellProcess { Buffer.from(startEditorServices, "utf16le").toString("base64")); } - let powerShellExePath = this.exePath; - - if (this.sessionSettings.developer.powerShellExeIsWindowsDevBuild) { - // Windows PowerShell development builds need the DEVPATH environment - // variable set to the folder where development binaries are held - - // NOTE: This batch file approach is needed temporarily until VS Code's - // createTerminal API gets an argument for setting environment variables - // on the launched process. - const batScriptPath = path.resolve(__dirname, "../../sessions/powershell.bat"); - fs.writeFileSync( - batScriptPath, - `@set DEVPATH=${path.dirname(powerShellExePath)}\r\n@${powerShellExePath} %*`); - - powerShellExePath = batScriptPath; - } - this.log.write( "Language server starting --", - " exe: " + powerShellExePath, - " args: " + startEditorServices); + " PowerShell executable: " + this.exePath, + " PowerShell args: " + powerShellArgs.join(" "), + " PowerShell Editor Services args: " + startEditorServices); // Make sure no old session file exists utils.deleteSessionFile(this.sessionFilePath); @@ -117,7 +110,7 @@ export class PowerShellProcess { this.consoleTerminal = vscode.window.createTerminal( this.title, - powerShellExePath, + this.exePath, powerShellArgs); if (this.sessionSettings.integratedConsole.showOnStartup) { @@ -178,4 +171,18 @@ export class PowerShellProcess { this.consoleTerminal = undefined; } } + + private isLoginShell(pwshPath: string): boolean { + try { + // We can't know what version of PowerShell we have without running it + // So we try to start PowerShell with -Login + // If it exits successfully, we return true + // If it exits unsuccessfully, node throws, we catch, and return false + cp.execFileSync(pwshPath, ["-Login", "-NoProfile", "-NoLogo", "-Command", "exit 0"]); + } catch { + return false; + } + + return true; + } } diff --git a/src/settings.ts b/src/settings.ts index 99e73266af..a8e931aaf8 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -72,7 +72,6 @@ export interface IDeveloperSettings { bundledModulesPath?: string; editorServicesLogLevel?: string; editorServicesWaitForDebugger?: boolean; - powerShellExeIsWindowsDevBuild?: boolean; } export interface ISettings { @@ -82,6 +81,7 @@ export interface ISettings { powerShellExePath?: string; promptToUpdatePowerShell?: boolean; bundledModulesPath?: string; + startAsLoginShell?: IStartAsLoginShellSettings; startAutomatically?: boolean; useX86Host?: boolean; enableProfileLoading?: boolean; @@ -96,6 +96,11 @@ export interface ISettings { sideBar?: ISideBarSettings; } +export interface IStartAsLoginShellSettings { + osx?: boolean; + linux?: boolean; +} + export interface IIntegratedConsoleSettings { showOnStartup?: boolean; focusConsoleOnExecute?: boolean; @@ -131,7 +136,6 @@ export function load(): ISettings { bundledModulesPath: "../../../PowerShellEditorServices/module", editorServicesLogLevel: "Normal", editorServicesWaitForDebugger: false, - powerShellExeIsWindowsDevBuild: false, }; const defaultCodeFoldingSettings: ICodeFoldingSettings = { @@ -157,6 +161,11 @@ export function load(): ISettings { useCorrectCasing: false, }; + const defaultStartAsLoginShellSettings: IStartAsLoginShellSettings = { + osx: true, + linux: false, + }; + const defaultIntegratedConsoleSettings: IIntegratedConsoleSettings = { showOnStartup: true, focusConsoleOnExecute: true, @@ -203,6 +212,13 @@ export function load(): ISettings { configuration.get("bugReporting", defaultBugReportingSettings), sideBar: configuration.get("sideBar", defaultSideBarSettings), + startAsLoginShell: + // tslint:disable-next-line + // We follow the same convention as VS Code - https://github.com/microsoft/vscode/blob/ff00badd955d6cfcb8eab5f25f3edc86b762f49f/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts#L105-L107 + // "Unlike on Linux, ~/.profile is not sourced when logging into a macOS session. This + // is the reason terminals on macOS typically run login shells by default which set up + // the environment. See http://unix.stackexchange.com/a/119675/115410" + configuration.get("startAsLoginShell", defaultStartAsLoginShellSettings), }; } From 63b9dee0add905bb8be57361b308c30ec1690be4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2020 13:57:33 -0800 Subject: [PATCH 058/166] Bump mock-fs from 4.10.3 to 4.10.4 (#2340) Bumps [mock-fs](https://github.com/tschaub/mock-fs) from 4.10.3 to 4.10.4. - [Release notes](https://github.com/tschaub/mock-fs/releases) - [Changelog](https://github.com/tschaub/mock-fs/blob/master/changelog.md) - [Commits](https://github.com/tschaub/mock-fs/compare/v4.10.3...v4.10.4) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4c63845d90..4231deda8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1299,9 +1299,9 @@ } }, "mock-fs": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.3.tgz", - "integrity": "sha512-bcukePBvuA3qovmq0Qtqu9+1APCIGkFHnsozrPIVromt5XFGGgkQSfaN0H6RI8gStHkO/hRgimvS3tooNes4pQ==", + "version": "4.10.4", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.4.tgz", + "integrity": "sha512-gDfZDLaPIvtOusbusLinfx6YSe2YpQsDT8qdP41P47dQ/NQggtkHukz7hwqgt8QvMBmAv+Z6DGmXPyb5BWX2nQ==", "dev": true }, "ms": { diff --git a/package.json b/package.json index 1219edcedb..27c3cc7568 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.1", "mocha-multi-reporters": "~1.1.7", - "mock-fs": "~4.10.3", + "mock-fs": "~4.10.4", "rewire": "~4.0.1", "sinon": "~7.5.0", "tslint": "~5.20.1", From f37b41e6e699103c2294f283dd426e5f07e38473 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2020 13:57:47 -0800 Subject: [PATCH 059/166] Bump sinon from 7.5.0 to 8.0.4 (#2403) Bumps [sinon](https://github.com/sinonjs/sinon) from 7.5.0 to 8.0.4. - [Release notes](https://github.com/sinonjs/sinon/releases) - [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md) - [Commits](https://github.com/sinonjs/sinon/compare/v7.5.0...v8.0.4) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 114 +++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 62 insertions(+), 54 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4231deda8d..75019ad2e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,41 +33,33 @@ } }, "@sinonjs/commons": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.6.0.tgz", - "integrity": "sha512-w4/WHG7C4WWFyE5geCieFJF6MZkbW4VAriol5KlmQXpAQdxvV0p26sqNZOW6Qyw6Y0l9K4g+cHvvczR2sEEpqg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.0.tgz", + "integrity": "sha512-qbk9AP+cZUsKdW1GJsBpxPKFmCJ0T8swwzVje3qFd+AkQb74Q/tiuzrdfFg8AD2g5HH/XbE/I8Uc1KYHVYWfhg==", "dev": true, "requires": { "type-detect": "4.0.8" } }, "@sinonjs/formatio": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.2.tgz", - "integrity": "sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-4.0.1.tgz", + "integrity": "sha512-asIdlLFrla/WZybhm0C8eEzaDNNrzymiTqHMeJl6zPW2881l3uuVRpm0QlRQEjqYWv6CcKMGYME3LbrLJsORBw==", "dev": true, "requires": { "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" + "@sinonjs/samsam": "^4.2.0" } }, "@sinonjs/samsam": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz", - "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-4.2.1.tgz", + "integrity": "sha512-7+5S4C4wpug5pzHS+z/63+XUwsH7dtyYELDafoT1QnfruFh7eFjlDWwZXltUB0GLk6y5eMeAt34Bjx8wJ4KfSA==", "dev": true, "requires": { - "@sinonjs/commons": "^1.3.0", - "array-from": "^2.1.1", - "lodash": "^4.17.15" - }, - "dependencies": { - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - } + "@sinonjs/commons": "^1.6.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" } }, "@sinonjs/text-encoding": { @@ -241,12 +233,6 @@ "sprintf-js": "~1.0.2" } }, - "array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", - "dev": true - }, "async-hook-jl": { "version": "1.7.6", "resolved": "https://registry.npmjs.org/async-hook-jl/-/async-hook-jl-1.7.6.tgz", @@ -1163,12 +1149,21 @@ "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", "dev": true }, - "lolex": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", - "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==", + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, + "lolex": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-5.1.2.tgz", + "integrity": "sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, "lru-cache": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", @@ -1323,15 +1318,16 @@ "dev": true }, "nise": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.2.tgz", - "integrity": "sha512-/6RhOUlicRCbE9s+94qCUsyE+pKlVJ5AhIv+jEE7ESKwnbXqulKZ1FYU+XAtHHWE9TinYvAxDUJAb912PwPoWA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/nise/-/nise-3.0.1.tgz", + "integrity": "sha512-fYcH9y0drBGSoi88kvhpbZEsenX58Yr+wOJ4/Mi1K4cy+iGP/a73gNoyNhu5E9QxPdgTlVChfIaAlnyOy/gHUA==", "dev": true, "requires": { - "@sinonjs/formatio": "^3.2.1", + "@sinonjs/commons": "^1.7.0", + "@sinonjs/formatio": "^4.0.1", "@sinonjs/text-encoding": "^0.7.1", "just-extend": "^4.0.2", - "lolex": "^4.1.0", + "lolex": "^5.0.1", "path-to-regexp": "^1.7.0" } }, @@ -1460,9 +1456,9 @@ "dev": true }, "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", "dev": true, "requires": { "isarray": "0.0.1" @@ -1679,27 +1675,39 @@ "dev": true }, "sinon": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.5.0.tgz", - "integrity": "sha512-AoD0oJWerp0/rY9czP/D6hDTTUYGpObhZjMpd7Cl/A6+j0xBE+ayL/ldfggkBXUs0IkvIiM1ljM8+WkOc5k78Q==", + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-8.0.4.tgz", + "integrity": "sha512-cFsmgmvsgFb87e7SV7IcekogITlHX2KmlplyI9Pda0FH1Z8Ms/kWbpLs25Idp0m6ZJ3HEEjhaYYXbcTtWWUn4w==", "dev": true, "requires": { - "@sinonjs/commons": "^1.4.0", - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/samsam": "^3.3.3", - "diff": "^3.5.0", - "lolex": "^4.2.0", - "nise": "^1.5.2", - "supports-color": "^5.5.0" + "@sinonjs/commons": "^1.7.0", + "@sinonjs/formatio": "^4.0.1", + "@sinonjs/samsam": "^4.2.1", + "diff": "^4.0.1", + "lolex": "^5.1.2", + "nise": "^3.0.1", + "supports-color": "^7.1.0" }, "dependencies": { + "diff": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", + "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } } } diff --git a/package.json b/package.json index 27c3cc7568..8aab3fc635 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "mocha-multi-reporters": "~1.1.7", "mock-fs": "~4.10.4", "rewire": "~4.0.1", - "sinon": "~7.5.0", + "sinon": "~8.0.4", "tslint": "~5.20.1", "typescript": "~3.5.3", "vsce": "~1.64.0", From 2301577f58af61aa43c47937ce0f973c90c3c4ba Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2020 13:58:07 -0800 Subject: [PATCH 060/166] Bump semver from 6.3.0 to 7.1.1 (#2391) Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 7.1.1. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/master/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v6.3.0...v7.1.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 75019ad2e7..c08ec63eee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1644,9 +1644,9 @@ "dev": true }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.1.tgz", + "integrity": "sha512-WfuG+fl6eh3eZ2qAf6goB7nhiCd7NPXhmyFxigB/TOkQyeLP8w8GsVehvtGNtnNmyboz4TgeK40B1Kbql/8c5A==" }, "shebang-command": { "version": "1.2.0", diff --git a/package.json b/package.json index 8aab3fc635..544f493066 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ ], "dependencies": { "node-fetch": "^2.6.0", - "semver": "^6.3.0", + "semver": "^7.1.1", "vscode-extension-telemetry": "~0.1.2", "vscode-languageclient": "~5.2.1" }, From 9a531e35b919b87c4f602fa8ab201c4f728641b6 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 13 Jan 2020 15:28:20 -0800 Subject: [PATCH 061/166] [Ignore] disable dependabot for legacy (#2416) --- .dependabot/config.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.dependabot/config.yml b/.dependabot/config.yml index 8322290906..ea81451ac9 100644 --- a/.dependabot/config.yml +++ b/.dependabot/config.yml @@ -7,9 +7,3 @@ update_configs: - package_manager: "javascript" directory: "/" update_schedule: "weekly" - - # Will also update legacy branch - - package_manager: "javascript" - directory: "/" - update_schedule: "weekly" - target_branch: "legacy/1.x" From 6796055740aa2bedf71679fc3411d486c1981418 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2020 15:31:49 -0800 Subject: [PATCH 062/166] Bump mocha-junit-reporter from 1.23.1 to 1.23.2 (#2413) Bumps [mocha-junit-reporter](https://github.com/michaelleeallen/mocha-junit-reporter) from 1.23.1 to 1.23.2. - [Release notes](https://github.com/michaelleeallen/mocha-junit-reporter/releases) - [Commits](https://github.com/michaelleeallen/mocha-junit-reporter/compare/v1.23.1...v1.23.2) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index c08ec63eee..50bd0d5039 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1260,9 +1260,9 @@ } }, "mocha-junit-reporter": { - "version": "1.23.1", - "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-1.23.1.tgz", - "integrity": "sha512-qeDvKlZyAH2YJE1vhryvjUQ06t2hcnwwu4k5Ddwn0GQINhgEYFhlGM0DwYCVUHq5cuo32qAW6HDsTHt7zz99Ng==", + "version": "1.23.2", + "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-1.23.2.tgz", + "integrity": "sha512-ro39KUheimNkqdtjk1qXNw4B8b/REkCjlNYAsZ5Eso7tsVIX5BoQzA24vWSnWBdP/KNEKDoMoldzYyCwHuHZlw==", "dev": true, "requires": { "debug": "^2.2.0", diff --git a/package.json b/package.json index 544f493066..115a79eab4 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@types/sinon": "~7.5.1", "@types/vscode": "1.34.0", "mocha": "~5.2.0", - "mocha-junit-reporter": "~1.23.1", + "mocha-junit-reporter": "~1.23.2", "mocha-multi-reporters": "~1.1.7", "mock-fs": "~4.10.4", "rewire": "~4.0.1", From 32c96233889adc0c49d51910e20955812b39fd98 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Tue, 14 Jan 2020 14:22:35 -0800 Subject: [PATCH 063/166] [Ignore] Update powershell-preview CHANGELOG for v2020.1.0 (#2415) --- CHANGELOG.md | 32 ++++++++++++++++++++++++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72e3406633..409114b0b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,37 @@ # PowerShell Preview Extension Release History +## v2020.1.0 +### Monday, January 13, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🛫 ✨ [vscode-powershell #2384](https://github.com/PowerShell/vscode-PowerShell/pull/2400) - + Add -Login startup option. +- 🛫 🐛 [vscode-powershell #2380](https://github.com/PowerShell/vscode-PowerShell/pull/2399) - + Make PowerShell names case insensitive for configuration. +- 🛫 📺 ✨ [vscode-powershell #2370](https://github.com/PowerShell/vscode-PowerShell/pull/2398) - + Add configuration to enable/disable banner. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 📺 [vscode-powershell #2405](https://github.com/PowerShell/PowerShellEditorServices/pull/1152) - + Add tooltip to completions ParameterValue. +- 🛫 🐛 [vscode-powershell #2393](https://github.com/PowerShell/PowerShellEditorServices/pull/1151) - + Probe netfx dir for deps. +- 🚂 ⏱️ 🐛 [vscode-powershell #2352](https://github.com/PowerShell/PowerShellEditorServices/pull/1149) - + Fix lock up that occurs when WinForms is executed on the pipeline thread. +- 💭 🐛 [vscode-powershell #2402](https://github.com/PowerShell/PowerShellEditorServices/pull/1150) - + Fix temp debugging after it broke bringing in $psEditor. +- 🧠 🐛 [vscode-powershell #2324](https://github.com/PowerShell/PowerShellEditorServices/pull/1143) - + Fix unicode character uri bug. +- 🛫 📺 ✨ [vscode-powershell #2370](https://github.com/PowerShell/PowerShellEditorServices/pull/1141) - + Make startup banner simpler. +- [vscode-powershell #2386](https://github.com/PowerShell/PowerShellEditorServices/pull/1140) - + Fix uncaught exception when SafeToString returns null. (Thanks @jborean93!) +- 🔗 🐛 [vscode-powershell #2374](https://github.com/PowerShell/PowerShellEditorServices/pull/1139) - + Simplify logic of determining Reference definition. +- 🛫 🐛 [vscode-powershell #2379](https://github.com/PowerShell/PowerShellEditorServices/pull/1138) - + Use -Option AllScope to fix Windows PowerShell error. + ## v2019.12.0 ### Wednesday, December 11, 2019 #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) diff --git a/package-lock.json b/package-lock.json index 50bd0d5039..e2b1678497 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "powershell-preview", - "version": "2019.12.0", + "version": "2020.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 115a79eab4..ad2840184b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2019.12.0", + "version": "2020.1.0", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From a10ee7b2ed96b25c98a9c24eb94a7e8c580f48f8 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 27 Jan 2020 10:46:31 -0800 Subject: [PATCH 064/166] actually hide terminal until debug session (#2437) --- package-lock.json | 6 +++--- package.json | 4 ++-- src/process.ts | 11 +++++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index e2b1678497..e9e85c799e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -140,9 +140,9 @@ "dev": true }, "@types/vscode": { - "version": "1.34.0", - "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/@types/vscode/-/@types/vscode-1.34.0.tgz", - "integrity": "sha1-Wr3YtUi+CMj+P/98PjstUy4yV0E=", + "version": "1.40.0", + "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/@types/vscode/-/@types/vscode-1.40.0.tgz", + "integrity": "sha1-R9GenjLaUSyYb1ef5q+8jT5uDFU=", "dev": true }, "acorn": { diff --git a/package.json b/package.json index ad2840184b..6bcbf9b4b3 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", "engines": { - "vscode": "^1.34.0" + "vscode": "^1.40.0" }, "license": "SEE LICENSE IN LICENSE.txt", "homepage": "https://github.com/PowerShell/vscode-powershell/blob/master/README.md", @@ -57,7 +57,7 @@ "@types/rewire": "~2.5.28", "@types/semver": "~6.2.0", "@types/sinon": "~7.5.1", - "@types/vscode": "1.34.0", + "@types/vscode": "1.40.0", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.2", "mocha-multi-reporters": "~1.1.7", diff --git a/src/process.ts b/src/process.ts index 3138c6cfdb..0734a571da 100644 --- a/src/process.ts +++ b/src/process.ts @@ -108,12 +108,15 @@ export class PowerShellProcess { // Launch PowerShell in the integrated terminal this.consoleTerminal = - vscode.window.createTerminal( - this.title, - this.exePath, - powerShellArgs); + vscode.window.createTerminal({ + name: this.title, + shellPath: this.exePath, + shellArgs: powerShellArgs, + hideFromUser: !this.sessionSettings.integratedConsole.showOnStartup, + }); if (this.sessionSettings.integratedConsole.showOnStartup) { + // We still need to run this to set the active terminal to the Integrated Console. this.consoleTerminal.show(true); } From fcf48ee47fad549db9f8ade6d187864bdda13b2e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2020 10:46:54 -0800 Subject: [PATCH 065/166] Bump mocha-junit-reporter from 1.23.2 to 1.23.3 (#2429) Bumps [mocha-junit-reporter](https://github.com/michaelleeallen/mocha-junit-reporter) from 1.23.2 to 1.23.3. - [Release notes](https://github.com/michaelleeallen/mocha-junit-reporter/releases) - [Commits](https://github.com/michaelleeallen/mocha-junit-reporter/compare/v1.23.2...v1.23.3) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e9e85c799e..d3ee9fd5cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1260,9 +1260,9 @@ } }, "mocha-junit-reporter": { - "version": "1.23.2", - "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-1.23.2.tgz", - "integrity": "sha512-ro39KUheimNkqdtjk1qXNw4B8b/REkCjlNYAsZ5Eso7tsVIX5BoQzA24vWSnWBdP/KNEKDoMoldzYyCwHuHZlw==", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-1.23.3.tgz", + "integrity": "sha512-ed8LqbRj1RxZfjt/oC9t12sfrWsjZ3gNnbhV1nuj9R/Jb5/P3Xb4duv2eCfCDMYH+fEu0mqca7m4wsiVjsxsvA==", "dev": true, "requires": { "debug": "^2.2.0", diff --git a/package.json b/package.json index 6bcbf9b4b3..0d04a9244b 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@types/sinon": "~7.5.1", "@types/vscode": "1.40.0", "mocha": "~5.2.0", - "mocha-junit-reporter": "~1.23.2", + "mocha-junit-reporter": "~1.23.3", "mocha-multi-reporters": "~1.1.7", "mock-fs": "~4.10.4", "rewire": "~4.0.1", From 13b941c83a5e0fc34fa02cf700b10bb4741cb941 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2020 11:40:04 -0800 Subject: [PATCH 066/166] Bump sinon from 8.0.4 to 8.1.1 (#2440) Bumps [sinon](https://github.com/sinonjs/sinon) from 8.0.4 to 8.1.1. - [Release notes](https://github.com/sinonjs/sinon/releases) - [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md) - [Commits](https://github.com/sinonjs/sinon/compare/v8.0.4...v8.1.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 22 +++++++++++----------- package.json | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index d3ee9fd5cf..56066d98f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,9 +52,9 @@ } }, "@sinonjs/samsam": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-4.2.1.tgz", - "integrity": "sha512-7+5S4C4wpug5pzHS+z/63+XUwsH7dtyYELDafoT1QnfruFh7eFjlDWwZXltUB0GLk6y5eMeAt34Bjx8wJ4KfSA==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-4.2.2.tgz", + "integrity": "sha512-z9o4LZUzSD9Hl22zV38aXNykgFeVj8acqfFabCY6FY83n/6s/XwNJyYYldz6/9lBJanpno9h+oL6HTISkviweA==", "dev": true, "requires": { "@sinonjs/commons": "^1.6.0", @@ -1675,24 +1675,24 @@ "dev": true }, "sinon": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-8.0.4.tgz", - "integrity": "sha512-cFsmgmvsgFb87e7SV7IcekogITlHX2KmlplyI9Pda0FH1Z8Ms/kWbpLs25Idp0m6ZJ3HEEjhaYYXbcTtWWUn4w==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-8.1.1.tgz", + "integrity": "sha512-E+tWr3acRdoe1nXbHMu86SSqA1WGM7Yw3jZRLvlCMnXwTHP8lgFFVn5BnKnF26uc5SfZ3D7pA9sN7S3Y2jG4Ew==", "dev": true, "requires": { "@sinonjs/commons": "^1.7.0", "@sinonjs/formatio": "^4.0.1", - "@sinonjs/samsam": "^4.2.1", - "diff": "^4.0.1", + "@sinonjs/samsam": "^4.2.2", + "diff": "^4.0.2", "lolex": "^5.1.2", "nise": "^3.0.1", "supports-color": "^7.1.0" }, "dependencies": { "diff": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", - "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, "has-flag": { diff --git a/package.json b/package.json index 0d04a9244b..ea5b6f14da 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "mocha-multi-reporters": "~1.1.7", "mock-fs": "~4.10.4", "rewire": "~4.0.1", - "sinon": "~8.0.4", + "sinon": "~8.1.1", "tslint": "~5.20.1", "typescript": "~3.5.3", "vsce": "~1.64.0", From 50a26119f654f3ff444f048e42ce1cb8d15b3a7b Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2020 21:58:50 -0800 Subject: [PATCH 067/166] Bump @types/semver from 6.2.0 to 7.1.0 (#2444) Bumps [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) from 6.2.0 to 7.1.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 11 +++++++---- package.json | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 56066d98f4..9b714481a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -128,10 +128,13 @@ "dev": true }, "@types/semver": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.0.tgz", - "integrity": "sha512-1OzrNb4RuAzIT7wHSsgZRlMBlNsJl+do6UblR7JMW4oB7bbR+uBEYtUh7gEc/jM84GGilh68lSOokyM/zNUlBA==", - "dev": true + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.1.0.tgz", + "integrity": "sha512-pOKLaubrAEMUItGNpgwl0HMFPrSAFic8oSVIvfu1UwcgGNmNyK9gyhBHKmBnUTwwVvpZfkzUC0GaMgnL6P86uA==", + "dev": true, + "requires": { + "@types/node": "*" + } }, "@types/sinon": { "version": "7.5.1", diff --git a/package.json b/package.json index ea5b6f14da..fb743df759 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "@types/node": "~10.11.0", "@types/node-fetch": "~2.5.4", "@types/rewire": "~2.5.28", - "@types/semver": "~6.2.0", + "@types/semver": "~7.1.0", "@types/sinon": "~7.5.1", "@types/vscode": "1.40.0", "mocha": "~5.2.0", From ab94b61a12d61379e14d30148f8895da0541ad47 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Wed, 29 Jan 2020 00:53:13 +0000 Subject: [PATCH 068/166] [Ignore] Add "bergmeister" to poshchan list of people with rebuild rights (#2446) --- .poshchan/settings.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.poshchan/settings.json b/.poshchan/settings.json index 6e080d35d0..7665d98673 100644 --- a/.poshchan/settings.json +++ b/.poshchan/settings.json @@ -7,6 +7,7 @@ "authorized_users": [ "adityapatwardhan", "anmenaga", + "bergmeister", "daxian-dbw", "JamesWTruher", "PaulHigin", From bf0c48b14352b209dfe761ec79cbef2a724db009 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Mon, 3 Feb 2020 17:27:17 +0000 Subject: [PATCH 069/166] Add explorer context menus for 'Run/Debug Pester tests' (#2445) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add explorer context menus for 'Run/Debug Pester tests' * Make context menu work using file from selected tab/explorer menu * 🧹 Cleanup: Make fileUri non-optional --- package.json | 10 ++++++++++ src/features/PesterTests.ts | 12 ++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index fb743df759..5946a116d6 100644 --- a/package.json +++ b/package.json @@ -287,6 +287,16 @@ "when": "false" } ], + "explorer/context": [ + { + "command": "PowerShell.RunPesterTestsFromFile", + "when": "resourceFilename =~ /\\.tests\\.ps1$/i" + }, + { + "command": "PowerShell.DebugPesterTestsFromFile", + "when": "resourceFilename =~ /\\.tests\\.ps1$/i" + } + ], "editor/context": [ { "when": "editorLangId == powershell", diff --git a/src/features/PesterTests.ts b/src/features/PesterTests.ts index ea2c5fea9f..5b81655687 100644 --- a/src/features/PesterTests.ts +++ b/src/features/PesterTests.ts @@ -26,14 +26,14 @@ export class PesterTestsFeature implements IFeature { // File context-menu command - Run Pester Tests this.command = vscode.commands.registerCommand( "PowerShell.RunPesterTestsFromFile", - () => { - this.launchAllTestsInActiveEditor(LaunchType.Run); + (fileUri) => { + this.launchAllTestsInActiveEditor(LaunchType.Run, fileUri); }); // File context-menu command - Debug Pester Tests this.command = vscode.commands.registerCommand( "PowerShell.DebugPesterTestsFromFile", - () => { - this.launchAllTestsInActiveEditor(LaunchType.Debug); + (fileUri) => { + this.launchAllTestsInActiveEditor(LaunchType.Debug, fileUri); }); // This command is provided for usage by PowerShellEditorServices (PSES) only this.command = vscode.commands.registerCommand( @@ -51,8 +51,8 @@ export class PesterTestsFeature implements IFeature { this.languageClient = languageClient; } - private launchAllTestsInActiveEditor(launchType: LaunchType) { - const uriString = vscode.window.activeTextEditor.document.uri.toString(); + private launchAllTestsInActiveEditor(launchType: LaunchType, fileUri: vscode.Uri) { + const uriString = fileUri.toString(); const launchConfig = this.createLaunchConfig(uriString, launchType); launchConfig.args.push("-All"); this.launch(launchConfig); From cc9ce314bc5b638ff593e68af1d085b45a2e837b Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Mon, 3 Feb 2020 09:27:47 -0800 Subject: [PATCH 070/166] Problem matcher support for Context errors. (#2447) --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5946a116d6..3ab9188dc6 100644 --- a/package.json +++ b/package.json @@ -365,9 +365,9 @@ "message": 1 }, { - "regexp": "^\\s+at\\s+[^,]+,\\s*(.*?):\\s+line\\s+(\\d+)$", - "file": 1, - "line": 2 + "regexp": "^\\s+[Aa]t\\s+([^,]+,)?(.+?):(\\s+line\\s+)?(\\d+)(\\s+char:\\d+)?$", + "file": 2, + "line": 4 } ] } From 522e91400235ddcf18c33ec6e17d1af215a0f06b Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 5 Feb 2020 16:12:07 -0800 Subject: [PATCH 071/166] Gracefully fail when trying to debug an Untitled file using Temp debugging because it's not supported (#2458) --- src/features/DebugSession.ts | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/features/DebugSession.ts b/src/features/DebugSession.ts index f38dd885c4..b784a203a5 100644 --- a/src/features/DebugSession.ts +++ b/src/features/DebugSession.ts @@ -145,7 +145,12 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider const generateLaunchConfig = !config.request; const settings = Settings.load(); - let createNewIntegratedConsole = settings.debugging.createTemporaryIntegratedConsole; + + // If the createTemporaryIntegratedConsole field is not specified in the launch config, set the field using + // the value from the corresponding setting. Otherwise, the launch config value overrides the setting. + if (config.createTemporaryIntegratedConsole === undefined) { + config.createTemporaryIntegratedConsole = settings.debugging.createTemporaryIntegratedConsole; + } if (config.request === "attach") { const platformDetails = getPlatformDetails(); @@ -192,7 +197,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider ? currentDocument.uri.toString() : currentDocument.fileName; - if (settings.debugging.createTemporaryIntegratedConsole) { + if (config.createTemporaryIntegratedConsole) { // For a folder-less workspace, vscode.workspace.rootPath will be undefined. // PSES will convert that undefined to a reasonable working dir. config.cwd = @@ -222,6 +227,12 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider } if (currentDocument.isUntitled) { + if (config.createTemporaryIntegratedConsole) { + const msg = "Debugging Untitled files in a temporary console is currently not supported."; + vscode.window.showErrorMessage(msg); + return; + } + if (currentDocument.languageId === "powershell") { if (!generateLaunchConfig) { // Cover the case of existing launch.json but unsaved (Untitled) document. @@ -264,14 +275,6 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider if ((currentDocument !== undefined) && (config.cwd === "${file}")) { config.cwd = currentDocument.fileName; } - - // If the createTemporaryIntegratedConsole field is not specified in the launch config, set the field using - // the value from the corresponding setting. Otherwise, the launch config value overrides the setting. - if (config.createTemporaryIntegratedConsole === undefined) { - config.createTemporaryIntegratedConsole = createNewIntegratedConsole; - } else { - createNewIntegratedConsole = config.createTemporaryIntegratedConsole; - } } // Prevent the Debug Console from opening @@ -282,7 +285,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider const sessionFilePath = utils.getDebugSessionFilePath(); - if (createNewIntegratedConsole) { + if (config.createTemporaryIntegratedConsole) { if (this.tempDebugProcess) { this.tempDebugProcess.dispose(); } From 735d3d06d5d2a4c99573d16388a1fde7ae27b467 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2020 16:12:30 -0800 Subject: [PATCH 072/166] Bump semver from 7.1.1 to 7.1.2 (#2456) Bumps [semver](https://github.com/npm/node-semver) from 7.1.1 to 7.1.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/master/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v7.1.1...v7.1.2) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9b714481a0..2aebd5c89c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1647,9 +1647,9 @@ "dev": true }, "semver": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.1.tgz", - "integrity": "sha512-WfuG+fl6eh3eZ2qAf6goB7nhiCd7NPXhmyFxigB/TOkQyeLP8w8GsVehvtGNtnNmyboz4TgeK40B1Kbql/8c5A==" + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.2.tgz", + "integrity": "sha512-BJs9T/H8sEVHbeigqzIEo57Iu/3DG6c4QoqTfbQB3BPA4zgzAomh/Fk9E7QtjWQ8mx2dgA9YCfSF4y9k9bHNpQ==" }, "shebang-command": { "version": "1.2.0", diff --git a/package.json b/package.json index 3ab9188dc6..50519e27e2 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ ], "dependencies": { "node-fetch": "^2.6.0", - "semver": "^7.1.1", + "semver": "^7.1.2", "vscode-extension-telemetry": "~0.1.2", "vscode-languageclient": "~5.2.1" }, From 67017cb552af5f85862c5897f23052c6796a0189 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2020 16:12:42 -0800 Subject: [PATCH 073/166] Bump @types/mocha from 5.2.7 to 7.0.1 (#2457) Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 5.2.7 to 7.0.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2aebd5c89c..92420a7a0b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -92,9 +92,9 @@ "dev": true }, "@types/mocha": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", - "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.1.tgz", + "integrity": "sha512-L/Nw/2e5KUaprNJoRA33oly+M8X8n0K+FwLTbYqwTcR14wdPWeRkigBLfSFpN/Asf9ENZTMZwLxjtjeYucAA4Q==", "dev": true }, "@types/mock-fs": { diff --git a/package.json b/package.json index 50519e27e2..95972efc86 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ }, "devDependencies": { "@types/glob": "^7.1.1", - "@types/mocha": "~5.2.7", + "@types/mocha": "~7.0.1", "@types/mock-fs": "~4.10.0", "@types/node": "~10.11.0", "@types/node-fetch": "~2.5.4", From bf02f0b91e54f0808014daa06b0476ecdcb0fe62 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Mon, 10 Feb 2020 16:07:48 +0000 Subject: [PATCH 074/166] Update mac Image to 10.14 in CI as 10.13 is going to be deprecated in March (#2465) https://devblogs.microsoft.com/devops/removing-older-images-in-azure-pipelines-hosted-pools/ --- .vsts-ci/azure-pipelines-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vsts-ci/azure-pipelines-ci.yml b/.vsts-ci/azure-pipelines-ci.yml index 7fba9ada74..af8ad3bea5 100644 --- a/.vsts-ci/azure-pipelines-ci.yml +++ b/.vsts-ci/azure-pipelines-ci.yml @@ -41,7 +41,7 @@ jobs: - job: macOS pool: - vmImage: 'macOS-10.13' + vmImage: 'macOS-10.14' steps: - template: templates/ci-general.yml From e4ced23229c83cd53d270cfb2deb6cb630288a53 Mon Sep 17 00:00:00 2001 From: rbleattler <40604784+rbleattler@users.noreply.github.com> Date: Thu, 13 Feb 2020 13:38:33 -0500 Subject: [PATCH 075/166] Fix incorrect cmdlet reference (#2470) Changed 'New-ManifestModule' to 'New-ModuleManifest' --- examples/SampleModule.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/SampleModule.psd1 b/examples/SampleModule.psd1 index 21fd49acb1..61e03079ce 100644 --- a/examples/SampleModule.psd1 +++ b/examples/SampleModule.psd1 @@ -1,5 +1,5 @@ # DO NOT COPY THIS MANIFEST VERBATIM. THIS IS JUST A SAMPLE. -# GENERATE YOUR MANIFEST USING THE New-ManifestModule COMMAND TO +# GENERATE YOUR MANIFEST USING THE New-ModuleManifest COMMAND TO # GUARANTEE YOU GET A UNIQUE GUID FOR YOUR MODULE. @{ # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. From 92c1c75590636f8ea76ec601ece518df33ddce63 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2020 11:48:51 -0800 Subject: [PATCH 076/166] Bump semver from 7.1.2 to 7.1.3 (#2474) Bumps [semver](https://github.com/npm/node-semver) from 7.1.2 to 7.1.3. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/master/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v7.1.2...v7.1.3) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 92420a7a0b..a5d2347afa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1647,9 +1647,9 @@ "dev": true }, "semver": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.2.tgz", - "integrity": "sha512-BJs9T/H8sEVHbeigqzIEo57Iu/3DG6c4QoqTfbQB3BPA4zgzAomh/Fk9E7QtjWQ8mx2dgA9YCfSF4y9k9bHNpQ==" + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.3.tgz", + "integrity": "sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA==" }, "shebang-command": { "version": "1.2.0", diff --git a/package.json b/package.json index 95972efc86..1d39d6a852 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ ], "dependencies": { "node-fetch": "^2.6.0", - "semver": "^7.1.2", + "semver": "^7.1.3", "vscode-extension-telemetry": "~0.1.2", "vscode-languageclient": "~5.2.1" }, From 548375882dde0f951165d7100171b8ce1025afca Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 18 Feb 2020 11:53:05 -0800 Subject: [PATCH 077/166] Close other pwsh's in the VSCode instance (#2469) --- .vscode/tasks.json | 2 +- src/features/UpdatePowerShell.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 647e9e534b..c4f6a47392 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,7 +4,7 @@ "windows": { "options": { "shell": { - "executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", + "executable": "pwsh.exe", "args": [ "-NoProfile", "-ExecutionPolicy", "Bypass", "-Command" ] } } diff --git a/src/features/UpdatePowerShell.ts b/src/features/UpdatePowerShell.ts index ba33673063..d20fa1fb66 100644 --- a/src/features/UpdatePowerShell.ts +++ b/src/features/UpdatePowerShell.ts @@ -116,7 +116,8 @@ export async function InvokePowerShellUpdateCheck( const result = await window.showInformationMessage( `${commonText} Would you like to update the version? ${ - isMacOS ? "(Homebrew is required on macOS)" : "" + isMacOS ? "(Homebrew is required on macOS)" + : "(This will close ALL pwsh terminals running in this Visual Studio Code session)" }`, ...options); // If the user cancels the notification. @@ -151,6 +152,15 @@ export async function InvokePowerShellUpdateCheck( // Stop the Integrated Console session because Windows likes to hold on to files. sessionManager.stop(); + // Close all terminals with the name "pwsh" in the current VS Code session. + // This will encourage folks to not close the instance of VS Code that spawned + // the MSI process. + for (const terminal of window.terminals) { + if (terminal.name === "pwsh") { + terminal.dispose(); + } + } + // Invoke the MSI via cmd. const msi = spawn("msiexec", ["/i", msiDownloadPath]); From 3d92d5d525088effd6e71b43c17eb32eca47517d Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 18 Feb 2020 23:00:30 -0800 Subject: [PATCH 078/166] Skip UpdatePowerShell tests in CI on macOS (#2479) --- src/features/UpdatePowerShell.ts | 2 +- test/features/UpdatePowerShell.test.ts | 32 +++++++++++++++----------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/features/UpdatePowerShell.ts b/src/features/UpdatePowerShell.ts index d20fa1fb66..f5c5e81620 100644 --- a/src/features/UpdatePowerShell.ts +++ b/src/features/UpdatePowerShell.ts @@ -45,7 +45,7 @@ export class GitHubReleaseInformation { if (!response.ok) { const json = await response.json(); - throw json.message || json || "response was not ok."; + throw new Error(json.message || json || "response was not ok."); } // For preview, we grab all the releases and then grab the first prerelease. diff --git a/test/features/UpdatePowerShell.test.ts b/test/features/UpdatePowerShell.test.ts index 20b02b501f..8a96765cee 100644 --- a/test/features/UpdatePowerShell.test.ts +++ b/test/features/UpdatePowerShell.test.ts @@ -5,18 +5,24 @@ import * as assert from "assert"; import { GitHubReleaseInformation } from "../../src/features/UpdatePowerShell"; -suite("UpdatePowerShell tests", () => { - test("Can get the latest version", async () => { - const release: GitHubReleaseInformation = await GitHubReleaseInformation.FetchLatestRelease(false); - assert.strictEqual(release.isPreview, false, "expected to not be preview."); - assert.strictEqual(release.version.prerelease.length === 0, true, "expected to not have preview in version."); - assert.strictEqual(release.assets.length > 0, true, "expected to have assets."); - }); +// Due to Azure DevOps using the same macOS instances, the macOS builds hit +// the GitHub API rate limit often. Let's skip these tests on macOS until +// they are hooked up to only run on release. +if (process.env.TF_BUILD && process.platform === "win32") { + suite("UpdatePowerShell tests", () => { + test("Can get the latest version", async () => { + const release: GitHubReleaseInformation = await GitHubReleaseInformation.FetchLatestRelease(false); + assert.strictEqual(release.isPreview, false, "expected to not be preview."); + assert.strictEqual( + release.version.prerelease.length === 0, true, "expected to not have preview in version."); + assert.strictEqual(release.assets.length > 0, true, "expected to have assets."); + }); - test("Can get the latest preview version", async () => { - const release: GitHubReleaseInformation = await GitHubReleaseInformation.FetchLatestRelease(true); - assert.strictEqual(release.isPreview, true, "expected to be preview."); - assert.strictEqual(release.version.prerelease.length > 0, true, "expected to have preview in version."); - assert.strictEqual(release.assets.length > 0, true, "expected to have assets."); + test("Can get the latest preview version", async () => { + const release: GitHubReleaseInformation = await GitHubReleaseInformation.FetchLatestRelease(true); + assert.strictEqual(release.isPreview, true, "expected to be preview."); + assert.strictEqual(release.version.prerelease.length > 0, true, "expected to have preview in version."); + assert.strictEqual(release.assets.length > 0, true, "expected to have assets."); + }); }); -}); +} From 33654e18b18cc0b4097195097b99b9b0ca9dcf61 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2020 13:15:14 -0800 Subject: [PATCH 079/166] Bump tslint from 5.20.1 to 6.0.0 (#2442) * Bump tslint from 5.20.1 to 6.0.0 Bumps [tslint](https://github.com/palantir/tslint) from 5.20.1 to 6.0.0. - [Release notes](https://github.com/palantir/tslint/releases) - [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/palantir/tslint/compare/5.20.1...6.0.0) Signed-off-by: dependabot-preview[bot] * required tslint change Co-authored-by: Tyler James Leonhardt --- package-lock.json | 34 +++++++++++++++++----------------- package.json | 2 +- src/logging.ts | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index a5d2347afa..33e667428c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,18 +5,18 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", "dev": true, "requires": { - "@babel/highlight": "^7.0.0" + "@babel/highlight": "^7.8.3" } }, "@babel/highlight": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", - "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", + "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", "dev": true, "requires": { "chalk": "^2.0.0", @@ -1552,9 +1552,9 @@ } }, "resolve": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", - "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.0.tgz", + "integrity": "sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -1820,9 +1820,9 @@ "dev": true }, "tslint": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", - "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.0.0.tgz", + "integrity": "sha512-9nLya8GBtlFmmFMW7oXXwoXS1NkrccqTqAtwXzdPV9e2mqSEvCki6iHL/Fbzi5oqbugshzgGPk7KBb2qNP1DSA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -1836,14 +1836,14 @@ "mkdirp": "^0.5.1", "resolve": "^1.3.2", "semver": "^5.3.0", - "tslib": "^1.8.0", + "tslib": "^1.10.0", "tsutils": "^2.29.0" }, "dependencies": { "diff": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", - "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, "semver": { diff --git a/package.json b/package.json index 1d39d6a852..8c0b4b4e69 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "mock-fs": "~4.10.4", "rewire": "~4.0.1", "sinon": "~8.1.1", - "tslint": "~5.20.1", + "tslint": "~6.0.0", "typescript": "~3.5.3", "vsce": "~1.64.0", "vscode-test": "~1.3.0" diff --git a/src/logging.ts b/src/logging.ts index 5faf83df35..50d2b8d74a 100644 --- a/src/logging.ts +++ b/src/logging.ts @@ -116,7 +116,7 @@ export class Logger implements ILogger { public async writeAndShowErrorWithActions( message: string, - actions: Array<{ prompt: string; action: () => Promise }>) { + actions: { prompt: string; action: () => Promise }[]) { this.writeError(message); const fullActions = [ From b31a23d6eccd0429a01f9d45a4e9dfb30ed62c4d Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Wed, 19 Feb 2020 15:00:03 -0800 Subject: [PATCH 080/166] [Ignore] Refactor the startup arguments method to use async/await (#2482) --- src/process.ts | 230 ++++++++++++++++++++++++------------------------- 1 file changed, 115 insertions(+), 115 deletions(-) diff --git a/src/process.ts b/src/process.ts index 0734a571da..ba945aaa49 100644 --- a/src/process.ts +++ b/src/process.ts @@ -22,134 +22,111 @@ export class PowerShellProcess { private consoleTerminal: vscode.Terminal = undefined; private consoleCloseSubscription: vscode.Disposable; - private sessionDetails: utils.IEditorServicesSessionDetails; constructor( public exePath: string, private bundledModulesPath: string, private title: string, private log: Logger, - private startArgs: string, + private startPsesArgs: string, private sessionFilePath: string, private sessionSettings: Settings.ISettings) { this.onExited = this.onExitedEmitter.event; } - public start(logFileName: string): Thenable { - - return new Promise( - (resolve, reject) => { - try { - const psesModulePath = - path.resolve( - __dirname, - this.bundledModulesPath, - "PowerShellEditorServices/PowerShellEditorServices.psd1"); - - const editorServicesLogPath = this.log.getLogFilePath(logFileName); - - const featureFlags = - this.sessionSettings.developer.featureFlags !== undefined - ? this.sessionSettings.developer.featureFlags.map((f) => `'${f}'`).join(", ") - : ""; - - this.startArgs += - `-LogPath '${PowerShellProcess.escapeSingleQuotes(editorServicesLogPath)}' ` + - `-SessionDetailsPath '${PowerShellProcess.escapeSingleQuotes(this.sessionFilePath)}' ` + - `-FeatureFlags @(${featureFlags}) `; - - if (this.sessionSettings.integratedConsole.useLegacyReadLine) { - this.startArgs += "-UseLegacyReadLine"; - } - - const powerShellArgs = []; - - const useLoginShell: boolean = - (utils.isMacOS && this.sessionSettings.startAsLoginShell.osx) - || (utils.isLinux && this.sessionSettings.startAsLoginShell.linux); - - if (useLoginShell && this.isLoginShell(this.exePath)) { - // This MUST be the first argument. - powerShellArgs.push("-Login"); - } - - powerShellArgs.push("-NoProfile"); - powerShellArgs.push("-NonInteractive"); - - // Only add ExecutionPolicy param on Windows - if (utils.isWindows) { - powerShellArgs.push("-ExecutionPolicy", "Bypass"); - } - - const startEditorServices = "Import-Module '" + - PowerShellProcess.escapeSingleQuotes(psesModulePath) + - "'; Start-EditorServices " + this.startArgs; - - if (utils.isWindows) { - powerShellArgs.push( - "-Command", - startEditorServices); - } else { - // Use -EncodedCommand for better quote support on non-Windows - powerShellArgs.push( - "-EncodedCommand", - Buffer.from(startEditorServices, "utf16le").toString("base64")); - } - - this.log.write( - "Language server starting --", - " PowerShell executable: " + this.exePath, - " PowerShell args: " + powerShellArgs.join(" "), - " PowerShell Editor Services args: " + startEditorServices); - - // Make sure no old session file exists - utils.deleteSessionFile(this.sessionFilePath); - - // Launch PowerShell in the integrated terminal - this.consoleTerminal = - vscode.window.createTerminal({ - name: this.title, - shellPath: this.exePath, - shellArgs: powerShellArgs, - hideFromUser: !this.sessionSettings.integratedConsole.showOnStartup, - }); - - if (this.sessionSettings.integratedConsole.showOnStartup) { - // We still need to run this to set the active terminal to the Integrated Console. - this.consoleTerminal.show(true); - } - - // Start the language client - utils.waitForSessionFile( - this.sessionFilePath, - (sessionDetails, error) => { - // Clean up the session file - utils.deleteSessionFile(this.sessionFilePath); - - if (error) { - reject(error); - } else { - this.sessionDetails = sessionDetails; - resolve(this.sessionDetails); - } - }); - - this.consoleCloseSubscription = - vscode.window.onDidCloseTerminal( - (terminal) => { - if (terminal === this.consoleTerminal) { - this.log.write("powershell.exe terminated or terminal UI was closed"); - this.onExitedEmitter.fire(); - } - }); - - this.consoleTerminal.processId.then( - (pid) => { this.log.write(`powershell.exe started, pid: ${pid}`); }); - } catch (e) { - reject(e); - } + public async start(logFileName: string): Promise { + const editorServicesLogPath = this.log.getLogFilePath(logFileName); + + const psesModulePath = + path.resolve( + __dirname, + this.bundledModulesPath, + "PowerShellEditorServices/PowerShellEditorServices.psd1"); + + const featureFlags = + this.sessionSettings.developer.featureFlags !== undefined + ? this.sessionSettings.developer.featureFlags.map((f) => `'${f}'`).join(", ") + : ""; + + this.startPsesArgs += + `-LogPath '${PowerShellProcess.escapeSingleQuotes(editorServicesLogPath)}' ` + + `-SessionDetailsPath '${PowerShellProcess.escapeSingleQuotes(this.sessionFilePath)}' ` + + `-FeatureFlags @(${featureFlags}) `; + + if (this.sessionSettings.integratedConsole.useLegacyReadLine) { + this.startPsesArgs += "-UseLegacyReadLine"; + } + + const powerShellArgs = []; + + const useLoginShell: boolean = + (utils.isMacOS && this.sessionSettings.startAsLoginShell.osx) + || (utils.isLinux && this.sessionSettings.startAsLoginShell.linux); + + if (useLoginShell && this.isLoginShell(this.exePath)) { + // This MUST be the first argument. + powerShellArgs.push("-Login"); + } + + powerShellArgs.push("-NoProfile"); + powerShellArgs.push("-NonInteractive"); + + // Only add ExecutionPolicy param on Windows + if (utils.isWindows) { + powerShellArgs.push("-ExecutionPolicy", "Bypass"); + } + + const startEditorServices = "Import-Module '" + + PowerShellProcess.escapeSingleQuotes(psesModulePath) + + "'; Start-EditorServices " + this.startPsesArgs; + + if (utils.isWindows) { + powerShellArgs.push( + "-Command", + startEditorServices); + } else { + // Use -EncodedCommand for better quote support on non-Windows + powerShellArgs.push( + "-EncodedCommand", + Buffer.from(startEditorServices, "utf16le").toString("base64")); + } + + this.log.write( + "Language server starting --", + " PowerShell executable: " + this.exePath, + " PowerShell args: " + powerShellArgs.join(" "), + " PowerShell Editor Services args: " + startEditorServices); + + // Make sure no old session file exists + utils.deleteSessionFile(this.sessionFilePath); + + // Launch PowerShell in the integrated terminal + this.consoleTerminal = + vscode.window.createTerminal({ + name: this.title, + shellPath: this.exePath, + shellArgs: powerShellArgs, + hideFromUser: !this.sessionSettings.integratedConsole.showOnStartup, }); + + if (this.sessionSettings.integratedConsole.showOnStartup) { + // We still need to run this to set the active terminal to the Integrated Console. + this.consoleTerminal.show(true); + } + + // Start the language client + const sessionDetails = await this.waitForSessionFile(); + + // Subscribe a log event for when the terminal closes + this.consoleCloseSubscription = vscode.window.onDidCloseTerminal((terminal) => this.onTerminalClose(terminal)); + + // Log that the PowerShell terminal process has been started + const terminalPid = await this.consoleTerminal.processId; + const pwshName = path.basename(this.exePath); + this.log.write(`${pwshName} started, pid: ${terminalPid}`); + + return sessionDetails; } public showConsole(preserveFocus: boolean) { @@ -188,4 +165,27 @@ export class PowerShellProcess { return true; } + + private waitForSessionFile(): Promise { + return new Promise((resolve, reject) => { + utils.waitForSessionFile(this.sessionFilePath, (sessionDetails, error) => { + utils.deleteSessionFile(this.sessionFilePath); + + if (error) { + return reject(error); + } + + resolve(sessionDetails); + }); + }); + } + + private onTerminalClose(terminal: vscode.Terminal) { + if (terminal !== this.consoleTerminal) { + return; + } + + this.log.write("powershell.exe terminated or terminal UI was closed"); + this.onExitedEmitter.fire(); + } } From 07e3bc1b4811cda03bab787eb7af093753f28c49 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Wed, 19 Feb 2020 15:43:44 -0800 Subject: [PATCH 081/166] [Ignore] Update changelog for 2020.2.0 preview release (#2481) --- CHANGELOG.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 409114b0b0..15c8280cd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,57 @@ # PowerShell Preview Extension Release History +## v2020.2.0 +### Thursday, February 20, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🐛📖 [vscode-PowerShell #2470](https://github.com/PowerShell/vscode-powershell/pull/2470) - + Fix incorrect reference to `New-ManifestModule` in documentation. (Thanks @rbleattler!) +- 🐛📺 [vscode-PowerShell #2469](https://github.com/PowerShell/vscode-powershell/pull/2469) - + Close other open pwsh instances when updating PowerShell. +- 🐛📟 [vscode-PowerShell #2434](https://github.com/powershell/vscode-powershell/pull/2437) - + Use a new VSCode API to hide the integrated terminal from the shell list + until debugging when `showOnStartup` is disabled. +- ✨🐢 [vscode-PowerShell #2445](https://github.com/PowerShell/vscode-powershell/pull/2445) - + Add `Run/Debug Pester tests` context menu options in the VSCode explorer + for Pester test files. (Thanks @bergmeister!) +- 🐛🐢 [vscode-PowerShell #2438](https://github.com/PowerShell/vscode-powershell/pull/2447/) - + Fixes test failures in Pester contexts not showing up in the Problems pane. (Thanks @tillig!) +- 🐛🔍 [vscode-PowerShell #2548](https://github.com/PowerShell/vscode-powershell/pull/2458) - + Show error message instead of hanging when temp debugging is used with an untitled file. +- 👷 [vscode-PowerShell #2465](https://github.com/PowerShell/vscode-powershell/pull/2465) - + Move macOS CI images to 10.14 (Thanks @bergmeister!) + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛📁 [vscode-PowerShell #2421](https://github.com/powershell/powershelleditorservices/pull/1161) - + Fix WorkspacePath so that references work with non-ASCII characters. +- 🐛📟 [vscode-PowerShell #2372](https://github.com/powershell/powershelleditorservices/pull/1162) - + Fix prompt behavior when debugging. +- 🐛🛫 [PowerShellEditorServices #1171](https://github.com/powershell/powershelleditorservices/pull/1171) - + Fix race condition where running multiple profiles caused errors. +- 🐛📟 [vscode-PowerShell #2420](https://github.com/powershell/powershelleditorservices/pull/1173) - + Fix an issue where pasting to a `Get-Credential` prompt in some Windows versions caused a crash. +- 🐛📟 [vscode-PowerShell #1790](https://github.com/powershell/powershelleditorservices/pull/1174) - + Fix an inconsistency where `Read-Host -Prompt 'prompt'` would return `$null` rather than empty string + when given no input. +- 🐛🔗 [PowerShellEditorServices #1177](https://github.com/powershell/powershelleditorservices/pull/1174) - + Fix an issue where untitled files did not work with CodeLens. +- ⚡️⏱️ [PowerShellEditorServices #1172](https://github.com/powershell/powershelleditorservices/pull/1172) - + Improve `async`/`await` and `Task` usage to reduce concurrency overhead and improve performance. +- 🐛📟 [PowerShellEditorServices #1178](https://github.com/powershell/powershelleditorservices/pull/1178) - + Improve PSReadLine experience where no new line is rendered in the console. +- ✨🔍 [PowerShellEditorServices #1119](https://github.com/powershell/powershelleditorservices/pull/1119) - + Enable new debugging APIs added in PowerShell 7, improving performance and fixing issues where + the debugger would hang or be unable to update breakpoints while scripts were running. +- 👷📟 [PowerShellEditorServices #1187](https://github.com/PowerShell/PowerShellEditorServices/pull/1187) - + Upgrade built-in PSReadLine to 2.0.0 GA. +- 🐛👮 [PowerShellEditorServices #1179](https://github.com/PowerShell/PowerShellEditorServices/pull/1179) - + Improve integration with PSScriptAnalyzer, improving performance, + fixing an error when PSScriptAnalyzer is not available, fix CodeActions not appearing on Windows, + fix an issue where the PSModulePath is reset by PSScriptAnalyzer opening new runspaces. +- 🚂 [PowerShellEditorServices #1183](https://github.com/PowerShell/PowerShellEditorServices/pull/1183) - + Close over public APIs not intended for external use and replace with new, async-friendly APIs. + ## v2020.1.0 ### Monday, January 13, 2020 #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) diff --git a/package-lock.json b/package-lock.json index 33e667428c..85125ca1db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "powershell-preview", - "version": "2020.1.0", + "version": "2020.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8c0b4b4e69..fb7d690331 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2020.1.0", + "version": "2020.2.0", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From 95ab062fb8e71a6529d71722b95b6632c7d81067 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Wed, 19 Feb 2020 16:53:19 -0800 Subject: [PATCH 082/166] [Ignore] Add pwsh install step to build (#2483) --- .vsts-ci/templates/release-general.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.vsts-ci/templates/release-general.yml b/.vsts-ci/templates/release-general.yml index cc4b802a24..ebf8c3b53f 100644 --- a/.vsts-ci/templates/release-general.yml +++ b/.vsts-ci/templates/release-general.yml @@ -1,4 +1,19 @@ steps: +- powershell: | + Write-Host "Installing pwsh..." + if (Get-Command pwsh -ErrorAction Ignore) + { + Write-Host "pwsh already installed, skipping" + return + } + $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' + Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -outfile ./install-powershell.ps1 + ./install-powershell.ps1 -Destination $powerShellPath + $vstsCommandString = "vso[task.setvariable variable=PATH]$powerShellPath;$env:PATH" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + displayName: Install PowerShell Core + - pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" displayName: Set Build Name for Non-PR condition: ne(variables['Build.Reason'], 'PullRequest') From 495c7d9b41dc8d96503291d4e7b9bdcb71dfc8d0 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 20 Feb 2020 09:33:23 -0800 Subject: [PATCH 083/166] Remove caption usage from message (#2477) --- src/features/Console.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/Console.ts b/src/features/Console.ts index cd06a4e9ea..39a4861cd0 100644 --- a/src/features/Console.ts +++ b/src/features/Console.ts @@ -114,7 +114,7 @@ function showChoicePrompt( vscode.window .showQuickPick( quickPickItems, - { placeHolder: promptDetails.caption + " - " + promptDetails.message }) + { placeHolder: promptDetails.message }) .then(onItemSelected); } else { const checkboxQuickPickItems = @@ -134,7 +134,7 @@ function showChoicePrompt( resultThenable = showCheckboxQuickPick( checkboxQuickPickItems, - { confirmPlaceHolder: `${promptDetails.caption} - ${promptDetails.message}`}) + { confirmPlaceHolder: promptDetails.message }) .then(onItemsSelected); } From b6fb0c420389c27970f8787318ba13dc5c78d39f Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 20 Feb 2020 10:22:03 -0800 Subject: [PATCH 084/166] Make PSSA look for a file in the workspace root by default (#2484) --- package.json | 2 +- src/settings.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fb7d690331..ad265e8257 100644 --- a/package.json +++ b/package.json @@ -607,7 +607,7 @@ }, "powershell.scriptAnalysis.settingsPath": { "type": "string", - "default": "", + "default": "PSScriptAnalyzerSettings.psd1", "description": "Specifies the path to a PowerShell Script Analyzer settings file. To override the default settings for all projects, enter an absolute path, or enter a path relative to your workspace." }, "powershell.codeFolding.enable": { diff --git a/src/settings.ts b/src/settings.ts index a8e931aaf8..00c561225b 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -124,7 +124,7 @@ export function load(): ISettings { const defaultScriptAnalysisSettings: IScriptAnalysisSettings = { enable: true, - settingsPath: "", + settingsPath: "PSScriptAnalyzerSettings.psd1", }; const defaultDebuggingSettings: IDebuggingSettings = { From c64287a60d035b0fe4eaec703928a494a43acbcf Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 15:14:55 -0800 Subject: [PATCH 085/166] Bump sinon from 8.1.1 to 9.0.0 (#2494) Bumps [sinon](https://github.com/sinonjs/sinon) from 8.1.1 to 9.0.0. - [Release notes](https://github.com/sinonjs/sinon/releases) - [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md) - [Commits](https://github.com/sinonjs/sinon/compare/v8.1.1...v9.0.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 63 ++++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 85125ca1db..4f4100e496 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,31 +33,41 @@ } }, "@sinonjs/commons": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.0.tgz", - "integrity": "sha512-qbk9AP+cZUsKdW1GJsBpxPKFmCJ0T8swwzVje3qFd+AkQb74Q/tiuzrdfFg8AD2g5HH/XbE/I8Uc1KYHVYWfhg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.1.tgz", + "integrity": "sha512-Debi3Baff1Qu1Unc3mjJ96MgpbwTn43S1+9yJ0llWygPwDNu2aaWBD6yc9y/Z8XDRNhx7U+u2UDg2OGQXkclUQ==", "dev": true, "requires": { "type-detect": "4.0.8" } }, + "@sinonjs/fake-timers": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.0.tgz", + "integrity": "sha512-atR1J/jRXvQAb47gfzSK8zavXy7BcpnYq21ALon0U99etu99vsir0trzIO3wpeLtW+LLVY6X7EkfVTbjGSH8Ww==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, "@sinonjs/formatio": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-4.0.1.tgz", - "integrity": "sha512-asIdlLFrla/WZybhm0C8eEzaDNNrzymiTqHMeJl6zPW2881l3uuVRpm0QlRQEjqYWv6CcKMGYME3LbrLJsORBw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-5.0.1.tgz", + "integrity": "sha512-KaiQ5pBf1MpS09MuA0kp6KBQt2JUOQycqVG1NZXvzeaXe5LGFqAKueIS0bw4w0P9r7KuBSVdUk5QjXsUdu2CxQ==", "dev": true, "requires": { "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^4.2.0" + "@sinonjs/samsam": "^5.0.2" } }, "@sinonjs/samsam": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-4.2.2.tgz", - "integrity": "sha512-z9o4LZUzSD9Hl22zV38aXNykgFeVj8acqfFabCY6FY83n/6s/XwNJyYYldz6/9lBJanpno9h+oL6HTISkviweA==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.0.2.tgz", + "integrity": "sha512-p3yrEVB5F/1wI+835n+X8llOGRgV8+jw5BHQ/cJoLBUXXZ5U8Tr5ApwPc4L4av/vjla48kVPoN0t6dykQm+Rvg==", "dev": true, "requires": { "@sinonjs/commons": "^1.6.0", + "@sinonjs/formatio": "^5.0.0", "lodash.get": "^4.4.2", "type-detect": "^4.0.8" } @@ -1158,15 +1168,6 @@ "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, - "lolex": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-5.1.2.tgz", - "integrity": "sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - }, "lru-cache": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", @@ -1321,16 +1322,16 @@ "dev": true }, "nise": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/nise/-/nise-3.0.1.tgz", - "integrity": "sha512-fYcH9y0drBGSoi88kvhpbZEsenX58Yr+wOJ4/Mi1K4cy+iGP/a73gNoyNhu5E9QxPdgTlVChfIaAlnyOy/gHUA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/nise/-/nise-4.0.2.tgz", + "integrity": "sha512-ALDnm0pTTyeGdbg5FCpWGd58Nmp3qO8d8x+dU2Fw8lApeJTEBSjkBZZM4S8t6GpKh+czxkfM/TKxpRMroZzwOg==", "dev": true, "requires": { "@sinonjs/commons": "^1.7.0", - "@sinonjs/formatio": "^4.0.1", + "@sinonjs/fake-timers": "^6.0.0", + "@sinonjs/formatio": "^5.0.1", "@sinonjs/text-encoding": "^0.7.1", "just-extend": "^4.0.2", - "lolex": "^5.0.1", "path-to-regexp": "^1.7.0" } }, @@ -1678,17 +1679,17 @@ "dev": true }, "sinon": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-8.1.1.tgz", - "integrity": "sha512-E+tWr3acRdoe1nXbHMu86SSqA1WGM7Yw3jZRLvlCMnXwTHP8lgFFVn5BnKnF26uc5SfZ3D7pA9sN7S3Y2jG4Ew==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.0.tgz", + "integrity": "sha512-c4bREcvuK5VuEGyMW/Oim9I3Rq49Vzb0aMdxouFaA44QCFpilc5LJOugrX+mkrvikbqCimxuK+4cnHVNnLR41g==", "dev": true, "requires": { "@sinonjs/commons": "^1.7.0", - "@sinonjs/formatio": "^4.0.1", - "@sinonjs/samsam": "^4.2.2", + "@sinonjs/fake-timers": "^6.0.0", + "@sinonjs/formatio": "^5.0.0", + "@sinonjs/samsam": "^5.0.1", "diff": "^4.0.2", - "lolex": "^5.1.2", - "nise": "^3.0.1", + "nise": "^4.0.1", "supports-color": "^7.1.0" }, "dependencies": { diff --git a/package.json b/package.json index ad265e8257..379e200fc8 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "mocha-multi-reporters": "~1.1.7", "mock-fs": "~4.10.4", "rewire": "~4.0.1", - "sinon": "~8.1.1", + "sinon": "~9.0.0", "tslint": "~6.0.0", "typescript": "~3.5.3", "vsce": "~1.64.0", From 17d9a59ffa58a6f3d9e0cf73c92a3b8e2f0748b0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 15:15:01 -0800 Subject: [PATCH 086/166] Bump mock-fs from 4.10.4 to 4.11.0 (#2492) Bumps [mock-fs](https://github.com/tschaub/mock-fs) from 4.10.4 to 4.11.0. - [Release notes](https://github.com/tschaub/mock-fs/releases) - [Changelog](https://github.com/tschaub/mock-fs/blob/master/changelog.md) - [Commits](https://github.com/tschaub/mock-fs/compare/v4.10.4...v4.11.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4f4100e496..237d673ca7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1298,9 +1298,9 @@ } }, "mock-fs": { - "version": "4.10.4", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.4.tgz", - "integrity": "sha512-gDfZDLaPIvtOusbusLinfx6YSe2YpQsDT8qdP41P47dQ/NQggtkHukz7hwqgt8QvMBmAv+Z6DGmXPyb5BWX2nQ==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.11.0.tgz", + "integrity": "sha512-Yp4o3/ZA15wsXqJTT+R+9w2AYIkD1i80Lds47wDbuUhOvQvm+O2EfjFZSz0pMgZZSPHRhGxgcd2+GL4+jZMtdw==", "dev": true }, "ms": { diff --git a/package.json b/package.json index 379e200fc8..01479311b8 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.3", "mocha-multi-reporters": "~1.1.7", - "mock-fs": "~4.10.4", + "mock-fs": "~4.11.0", "rewire": "~4.0.1", "sinon": "~9.0.0", "tslint": "~6.0.0", From 88a332403c96c7b8958a05bd640f70494dbf32ae Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Tue, 25 Feb 2020 16:42:21 -0800 Subject: [PATCH 087/166] Workaround for terminal PID freeze (#2498) * Move terminal PID log to a non-awaited callback * Add logging to startup --- src/process.ts | 16 +++++++++++++--- src/session.ts | 6 +++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/process.ts b/src/process.ts index ba945aaa49..aa957b5dd3 100644 --- a/src/process.ts +++ b/src/process.ts @@ -110,21 +110,25 @@ export class PowerShellProcess { hideFromUser: !this.sessionSettings.integratedConsole.showOnStartup, }); + const pwshName = path.basename(this.exePath); + this.log.write(`${pwshName} started.`); + if (this.sessionSettings.integratedConsole.showOnStartup) { // We still need to run this to set the active terminal to the Integrated Console. this.consoleTerminal.show(true); } // Start the language client + this.log.write("Waiting for session file"); const sessionDetails = await this.waitForSessionFile(); // Subscribe a log event for when the terminal closes + this.log.write("Registering terminal close callback"); this.consoleCloseSubscription = vscode.window.onDidCloseTerminal((terminal) => this.onTerminalClose(terminal)); // Log that the PowerShell terminal process has been started - const terminalPid = await this.consoleTerminal.processId; - const pwshName = path.basename(this.exePath); - this.log.write(`${pwshName} started, pid: ${terminalPid}`); + this.log.write("Registering terminal PID log callback"); + this.consoleTerminal.processId.then((pid) => this.logTerminalPid(pid, pwshName)); return sessionDetails; } @@ -152,6 +156,10 @@ export class PowerShellProcess { } } + private logTerminalPid(pid: number, exeName: string) { + this.log.write(`${exeName} PID: ${pid}`); + } + private isLoginShell(pwshPath: string): boolean { try { // We can't know what version of PowerShell we have without running it @@ -172,9 +180,11 @@ export class PowerShellProcess { utils.deleteSessionFile(this.sessionFilePath); if (error) { + this.log.write("Error occurred retrieving session file"); return reject(error); } + this.log.write("Session file found"); resolve(sessionDetails); }); }); diff --git a/src/session.ts b/src/session.ts index 145ecfbd00..10e4de6a3f 100644 --- a/src/session.ts +++ b/src/session.ts @@ -458,7 +458,11 @@ export class SessionManager implements Middleware { this.log.write("Language server startup failed."); this.setSessionFailure("The language service could not be started: ", error); }, - ); + ) + .catch((error) => { + this.log.write("Language server startup failed."); + this.setSessionFailure("The language server could not be started: ", error); + }); } private promptForRestart() { From fadc48086862f1896ecc7048c2152792e5103689 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Feb 2020 21:15:09 -0800 Subject: [PATCH 088/166] [Ignore] Add new additions to .vscodeignore (#2502) --- .vscodeignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.vscodeignore b/.vscodeignore index 3decb35fad..e38118a072 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -15,3 +15,10 @@ out/test/** test/** sessions/** scripts/Install-VSCode.ps1 +tools/** +.poshchan/** +.github/** +.vsts-ci/** +build.ps1 +tsconfig.json +tslint.json From f1f46caa4abb1d44e6aef607b762b58428821d33 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Thu, 27 Feb 2020 21:15:35 -0800 Subject: [PATCH 089/166] [Ignore] Update vsce to use auto link opt out (#2500) --- package.json | 2 +- vscode-powershell.build.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 01479311b8..5a78cb1e72 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "sinon": "~9.0.0", "tslint": "~6.0.0", "typescript": "~3.5.3", - "vsce": "~1.64.0", + "vsce": "~1.74.0", "vscode-test": "~1.3.0" }, "extensionDependencies": [ diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index bab5a96781..d28de46347 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -187,7 +187,7 @@ task Package UpdateReadme, { } Write-Host "`n### Packaging PowerShell-insiders.vsix`n" -ForegroundColor Green - exec { & node ./node_modules/vsce/out/vsce package } + exec { & node ./node_modules/vsce/out/vsce package --noGitHubIssueLinking } # Change the package to have a static name for automation purposes Move-Item -Force .\$($script:PackageJson.name)-$($script:PackageJson.version).vsix .\PowerShell-insiders.vsix From d431617d6997c75fdce35342323e016f1bbaf271 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Fri, 28 Feb 2020 13:46:53 -0800 Subject: [PATCH 090/166] Enable dotnet global tool pwsh (#2503) --- src/platform.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/platform.ts b/src/platform.ts index b1877501d3..e2c4244694 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -180,13 +180,10 @@ export class PowerShellExeFinder { break; } - // TODO: - // Enable this when the global tool has been updated - // to support proper argument passing. - // Currently it cannot take startup arguments to start PSES with. - // // Look for the .NET global tool - // yield this.findPSCoreDotnetGlobalTool(); + // Some older versions of PowerShell have a bug in this where startup will fail, + // but this is fixed in newer versions + yield this.findPSCoreDotnetGlobalTool(); // Look for PSCore preview yield this.findPSCorePreview(); From 3dff85b849f61b34776517e05fa02297342f6ecc Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Mon, 2 Mar 2020 09:12:32 -0800 Subject: [PATCH 091/166] [Ignore] Update preview changelog (#2509) --- CHANGELOG.md | 32 ++++++++++++++++++++++++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15c8280cd2..f6cf76e15d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,37 @@ # PowerShell Preview Extension Release History +## v2020.3.0 +### Thursday, March 12, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- ✨📺 [vscode-PowerShell #2503](https://github.com/PowerShell/vscode-powershell/pull/2503) - + Pick up the PowerShell dotnet global tool as a PowerShell runtime. +- 🐛🛫 [vscode-PowerShell #2491](https://github.com/PowerShell/vscode-powershell/pull/2498) - + Fix a startup issue where console becomes unresponsive due to the client waiting for the terminal PID from VSCode. +- 🐛👮 [vscode-PowerShell #2190](https://github.com/PowerShell/vscode-powershell/pull/2484) - + Look for `PSScriptAnalyzerSettings.psd1` in the workspace root by default for script analysis, + defaulting back to the default rules when not found. +- 🧰 [vscode-PowerShell #2477](https://github.com/PowerShell/vscode-powershell/pull/2477) - + Stop using the `caption` field on `powerShell/showChoicePrompt` messages, + and instead display only the `message` field. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛📟 [PowerShellEditorServices #1201](https://github.com/PowerShell/PowerShellEditorServices/pull/1201) - + Fix newlines in error formatting. +- 🐛👮 [vscode-PowerShell #2489](https://github.com/PowerShell/PowerShellEditorServices/pull/1206) - + Fix PSScriptAnalyzer not using default rules when no settings file present. +- 🐛📟 [vscode-PowerShell #2291](https://github.com/PowerShell/PowerShellEditorServices/pull/1207) - + Fix `Read-Host` dropping characters. +- 🐛📺 [vscode-PowerShell #2424](https://github.com/PowerShell/PowerShellEditorServices/pull/1209) - + Fix `F8` not working repeatedly in an Interactive Debugging session. +- 🐛🛫 [vscode-PowerShell #2404](https://github.com/PowerShell/PowerShellEditorServices/pull/1208) - + Fix execution policy being set incorrectly at startup on Windows. +- 🐛🧠 [vscode-PowerShell #2364](https://github.com/PowerShell/PowerShellEditorServices/pull/1210) - + Fix intellisense and `F5` not working after debugging. +- 🐛🧰 [vscode-PowerShell #2495](https://github.com/PowerShell/PowerShellEditorServices/pull/1211) - + Fix PowerShellEditorServices.Commands module commands not working due to types being moved. + ## v2020.2.0 ### Thursday, February 20, 2020 #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) diff --git a/package-lock.json b/package-lock.json index 237d673ca7..f642b1daa8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "powershell-preview", - "version": "2020.2.0", + "version": "2020.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5a78cb1e72..5f504e94bc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2020.2.0", + "version": "2020.3.0", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From e86eacb57e4277360417fee9354de5a9257ccfd3 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 2 Mar 2020 10:37:04 -0800 Subject: [PATCH 092/166] [Ignore] Combined Preview Release Changelog (#2511) --- docs/preview_to_stable_changelog.md | 363 ++++++++++++++++++++++++++++ 1 file changed, 363 insertions(+) create mode 100644 docs/preview_to_stable_changelog.md diff --git a/docs/preview_to_stable_changelog.md b/docs/preview_to_stable_changelog.md new file mode 100644 index 0000000000..ec99d3e944 --- /dev/null +++ b/docs/preview_to_stable_changelog.md @@ -0,0 +1,363 @@ +# PowerShell Preview Extension Release History March 2020 + +This document shows the combined changes that were moved from the Preview extension to the stable extension as part of the March 2020 release. + +## Top Features + +- ✨ 📺 [vscode-PowerShell #2335](https://github.com/PowerShell/vscode-powershell/pull/2335) - + Add editor command `PowerShell: Enable/Disable ISE Mode` for ISE emulation in VS Code. +- ✨ 📟 [vscode-PowerShell #2316](https://github.com/PowerShell/vscode-PowerShell/pull/2316) - + Add `powershell.integratedConsole.forceClearScrollbackBuffer` setting to enable `Clear-Host` to clear scrollback buffer. +- 🚂 [PowerShellEditorServices #1056](https://github.com/PowerShell/PowerShellEditorServices/pull/1056) - + Re-architect PowerShell Editor Services to use the Omnisharp LSP platform. +- [PowerShellEditorServices #741](https://github.com/PowerShell/PowerShellEditorServices/pull/741) - + Migrate to netstandard2.0 and PSStandard +- [PowerShellEditorServices #672](https://github.com/PowerShell/PowerShellEditorServices/pull/672) - + PSReadLine integration (Thanks @SeeminglyScience!) + +## v2020.2.0 +### Thursday, February 20, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🐛📖 [vscode-PowerShell #2470](https://github.com/PowerShell/vscode-powershell/pull/2470) - + Fix incorrect reference to `New-ManifestModule` in documentation. (Thanks @rbleattler!) +- 🐛📺 [vscode-PowerShell #2469](https://github.com/PowerShell/vscode-powershell/pull/2469) - + Close other open pwsh instances when updating PowerShell. +- 🐛📟 [vscode-PowerShell #2434](https://github.com/powershell/vscode-powershell/pull/2437) - + Use a new VSCode API to hide the integrated terminal from the shell list + until debugging when `showOnStartup` is disabled. +- ✨🐢 [vscode-PowerShell #2445](https://github.com/PowerShell/vscode-powershell/pull/2445) - + Add `Run/Debug Pester tests` context menu options in the VSCode explorer + for Pester test files. (Thanks @bergmeister!) +- 🐛🐢 [vscode-PowerShell #2438](https://github.com/PowerShell/vscode-powershell/pull/2447/) - + Fixes test failures in Pester contexts not showing up in the Problems pane. (Thanks @tillig!) +- 🐛🔍 [vscode-PowerShell #2548](https://github.com/PowerShell/vscode-powershell/pull/2458) - + Show error message instead of hanging when temp debugging is used with an untitled file. +- 👷 [vscode-PowerShell #2465](https://github.com/PowerShell/vscode-powershell/pull/2465) - + Move macOS CI images to 10.14 (Thanks @bergmeister!) + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛📁 [vscode-PowerShell #2421](https://github.com/powershell/powershelleditorservices/pull/1161) - + Fix WorkspacePath so that references work with non-ASCII characters. +- 🐛📟 [vscode-PowerShell #2372](https://github.com/powershell/powershelleditorservices/pull/1162) - + Fix prompt behavior when debugging. +- 🐛🛫 [PowerShellEditorServices #1171](https://github.com/powershell/powershelleditorservices/pull/1171) - + Fix race condition where running multiple profiles caused errors. +- 🐛📟 [vscode-PowerShell #2420](https://github.com/powershell/powershelleditorservices/pull/1173) - + Fix an issue where pasting to a `Get-Credential` prompt in some Windows versions caused a crash. +- 🐛📟 [vscode-PowerShell #1790](https://github.com/powershell/powershelleditorservices/pull/1174) - + Fix an inconsistency where `Read-Host -Prompt 'prompt'` would return `$null` rather than empty string + when given no input. +- 🐛🔗 [PowerShellEditorServices #1177](https://github.com/powershell/powershelleditorservices/pull/1174) - + Fix an issue where untitled files did not work with CodeLens. +- ⚡️⏱️ [PowerShellEditorServices #1172](https://github.com/powershell/powershelleditorservices/pull/1172) - + Improve `async`/`await` and `Task` usage to reduce concurrency overhead and improve performance. +- 🐛📟 [PowerShellEditorServices #1178](https://github.com/powershell/powershelleditorservices/pull/1178) - + Improve PSReadLine experience where no new line is rendered in the console. +- ✨🔍 [PowerShellEditorServices #1119](https://github.com/powershell/powershelleditorservices/pull/1119) - + Enable new debugging APIs added in PowerShell 7, improving performance and fixing issues where + the debugger would hang or be unable to update breakpoints while scripts were running. +- 👷📟 [PowerShellEditorServices #1187](https://github.com/PowerShell/PowerShellEditorServices/pull/1187) - + Upgrade built-in PSReadLine to 2.0.0 GA. +- 🐛👮 [PowerShellEditorServices #1179](https://github.com/PowerShell/PowerShellEditorServices/pull/1179) - + Improve integration with PSScriptAnalyzer, improving performance, + fixing an error when PSScriptAnalyzer is not available, fix CodeActions not appearing on Windows, + fix an issue where the PSModulePath is reset by PSScriptAnalyzer opening new runspaces. +- 🚂 [PowerShellEditorServices #1183](https://github.com/PowerShell/PowerShellEditorServices/pull/1183) - + Close over public APIs not intended for external use and replace with new, async-friendly APIs. + +## v2020.1.0 +### Monday, January 13, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🛫 ✨ [vscode-powershell #2384](https://github.com/PowerShell/vscode-PowerShell/pull/2400) - + Add -Login startup option. +- 🛫 🐛 [vscode-powershell #2380](https://github.com/PowerShell/vscode-PowerShell/pull/2399) - + Make PowerShell names case insensitive for configuration. +- 🛫 📺 ✨ [vscode-powershell #2370](https://github.com/PowerShell/vscode-PowerShell/pull/2398) - + Add configuration to enable/disable banner. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 📺 [vscode-powershell #2405](https://github.com/PowerShell/PowerShellEditorServices/pull/1152) - + Add tooltip to completions ParameterValue. +- 🛫 🐛 [vscode-powershell #2393](https://github.com/PowerShell/PowerShellEditorServices/pull/1151) - + Probe netfx dir for deps. +- 🚂 ⏱️ 🐛 [vscode-powershell #2352](https://github.com/PowerShell/PowerShellEditorServices/pull/1149) - + Fix lock up that occurs when WinForms is executed on the pipeline thread. +- 💭 🐛 [vscode-powershell #2402](https://github.com/PowerShell/PowerShellEditorServices/pull/1150) - + Fix temp debugging after it broke bringing in $psEditor. +- 🧠 🐛 [vscode-powershell #2324](https://github.com/PowerShell/PowerShellEditorServices/pull/1143) - + Fix unicode character uri bug. +- 🛫 📺 ✨ [vscode-powershell #2370](https://github.com/PowerShell/PowerShellEditorServices/pull/1141) - + Make startup banner simpler. +- [vscode-powershell #2386](https://github.com/PowerShell/PowerShellEditorServices/pull/1140) - + Fix uncaught exception when SafeToString returns null. (Thanks @jborean93!) +- 🔗 🐛 [vscode-powershell #2374](https://github.com/PowerShell/PowerShellEditorServices/pull/1139) - + Simplify logic of determining Reference definition. +- 🛫 🐛 [vscode-powershell #2379](https://github.com/PowerShell/PowerShellEditorServices/pull/1138) - + Use -Option AllScope to fix Windows PowerShell error. + +## v2019.12.0 + +### Wednesday, December 11, 2019 + +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- ✨ 📺 [vscode-PowerShell #2335](https://github.com/PowerShell/vscode-powershell/pull/2335) - + Add editor command `PowerShell: Enable/Disable ISE Mode` for ISE emulation in VS Code. +- ⚡️ 🛫 [vscode-PowerShell #2348](https://github.com/PowerShell/vscode-PowerShell/pull/2348) - + Start EditorServices without start script. +- ✨ 📟 [vscode-PowerShell #2316](https://github.com/PowerShell/vscode-PowerShell/pull/2316) - + Add `powershell.integratedConsole.forceClearScrollbackBuffer` setting to enable `Clear-Host` to clear scrollback buffer. +- 🐛 📺 [vscode-PowerShell #2325](https://github.com/PowerShell/vscode-PowerShell/pull/2325) - + Fix update PowerShell feature on windows. +- 🔧 📁 🐛 [vscode-powershell #2099](https://github.com/PowerShell/vscode-PowerShell/pull/2304) - + Use `powerShellDefaultVersion` everywhere and stop using `powerShellExePath`. +- 🐛 📺 [vscode-PowerShell #2294](https://github.com/PowerShell/vscode-PowerShell/pull/2294) - + Buttons show up for untitled files. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 👷 📟 [PowerShellEditorServices #1129](https://github.com/PowerShell/PowerShellEditorServices/pull/1129) - + Update PSReadLine to 2.0.0-rc1 in modules.json. +- 🛫 🐛 ⚡️ [vscode-powershell #2292](https://github.com/PowerShell/PowerShellEditorServices/pull/1118) - + Isolate PSES dependencies from PowerShell on load + make PSES a pure binary module. +- ✨ 📟 [PowerShellEditorServices #1108](https://github.com/PowerShell/PowerShellEditorServices/pull/1108) - + Clear the terminal via the LSP message `editor/clearTerminal`. +- 🔍 🐛 [vscode-powershell #2319](https://github.com/PowerShell/PowerShellEditorServices/pull/1117) - + Run one invocation per SetBreakpoints request. (Thanks @SeeminglyScience!) +- 🐛 [PowerShellEditorServices #1114](https://github.com/PowerShell/PowerShellEditorServices/pull/1114) - + Fix `Import-EditorCommand -Module`. (Thanks @sk82jack!) +- 🐛 🔍 [PowerShellEditorServices #1112](https://github.com/PowerShell/PowerShellEditorServices/pull/1112) - + Fix breakpoint setting deadlock. +- 🔗 🐛 [vscode-powershell #2306](https://github.com/PowerShell/PowerShellEditorServices/pull/1110) - + Fix references on Windows due to bad WorkspacePath. +- ✨ 👷 [PowerShellEditorServices #993](https://github.com/PowerShell/PowerShellEditorServices/pull/993) - + Add devcontainer support for building in container. (Thanks @bergmeister!) +- 🛫 🐛 [vscode-powershell #2311](https://github.com/PowerShell/PowerShellEditorServices/pull/1107) - + Protect against no RootUri (no open workspace). +- 🐛 📟 [vscode-powershell #2274](https://github.com/PowerShell/PowerShellEditorServices/pull/1092) - + Fix '@' appearing in console. +- 👮‍ 🐛 [vscode-powershell #2288](https://github.com/PowerShell/PowerShellEditorServices/pull/1094) - + Use RootUri.LocalPath for workspace path. +- 👮‍ 🔗 🐛 [vscode-powershell #2290](https://github.com/PowerShell/PowerShellEditorServices/pull/1098) - + Fix diagnostics not showing in untitled files and now also show CodeLens. +- 🔍 🐛 [vscode-powershell #1850](https://github.com/PowerShell/PowerShellEditorServices/pull/1097) - + Fixes no prompt showing up when debugging. +- 🚂 📺 🐛 [vscode-powershell #2284](https://github.com/PowerShell/PowerShellEditorServices/pull/1096) - + Fix running indicator by ignoring PSRL aborts. + +## v2019.11.0 +### Friday, November 1, 2019 + +##### Special Note +In this release of the preview extension, +we've merged significant architectural work into PowerShell Editor Services. +After several months of work, PSES now uses the Omnisharp LSP library +to handle Language Server Protocol interaction instead of rolling its own, +allowing PSES to concentrate on being a good PowerShell backend. +We hope you'll see increased performance and stability in this release. +As always, [please let us know if you find any issues](https://github.com/PowerShell/vscode-powershell/issues/new/choose). + +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🔧 [vscode-PowerShell #2262](https://github.com/PowerShell/vscode-PowerShell/pull/2262) - + Introduce `powershell.integratedConsole.useLegacyReadline` setting disable PSReadLine. +- 🚂 [vscode-PowerShell #2226](https://github.com/PowerShell/vscode-PowerShell/pull/2226) - + Changes needed for Omnisharp migration of PowerShellEditorServices. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛 [PowerShellEditorServices #1080](https://github.com/PowerShell/PowerShellEditorServices/pull/1080) - + Remove extra newline in GetComment feature. +- 🐛 [PowerShellEditorServices #1079](https://github.com/PowerShell/PowerShellEditorServices/pull/1079) - + Fix duplicate diagnostics caused by DidChange handler. +- 🔧 [PowerShellEditorServices #1076](https://github.com/PowerShell/PowerShellEditorServices/pull/1076) - + Graduate PSReadLine feature and add UseLegacyReadLine. +- ⚙️ [PowerShellEditorServices #1075](https://github.com/PowerShell/PowerShellEditorServices/pull/1075) - + Lock OmniSharp dependencies to v0.14.0. (Thanks @mholo65!) +- 🐛 [PowerShellEditorServices #1073](https://github.com/PowerShell/PowerShellEditorServices/pull/1073) - + Fix prerelease version discovery and fix omnisharp change. +- 🐛 [PowerShellEditorServices #1065](https://github.com/PowerShell/PowerShellEditorServices/pull/1065) - + Fix TEMP debugging. +- 🐛 [vscode-powershell #1753](https://github.com/PowerShell/PowerShellEditorServices/pull/1072) - + Override PSRL ReadKey on Windows as well. +- 🚂 [PowerShellEditorServices #1056](https://github.com/PowerShell/PowerShellEditorServices/pull/1056) - + Re-architect PowerShell Editor Services to use the Omnisharp LSP platform. + +## v2019.5.0 +### Wednesday, May 22, 2019 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- ✨ [vscode-PowerShell #1945](https://github.com/PowerShell/vscode-PowerShell/pull/1945) - + Edit snippets to support $TM_SELECTED_TEXT (Thanks @travis-c-lagrone!) +- 👷 [vscode-PowerShell #1942](https://github.com/PowerShell/vscode-PowerShell/pull/1942) - + Stop supporting 6.0 +- ✨ [vscode-PowerShell #1928](https://github.com/PowerShell/vscode-PowerShell/pull/1928) - + Add RunCode command for CodeLens providers +- 🐛 [vscode-PowerShell #1927](https://github.com/PowerShell/vscode-PowerShell/pull/1927) - + Fix change session by moving to async/await promise +- 🐛 [vscode-PowerShell #1925](https://github.com/PowerShell/vscode-PowerShell/pull/1925) - + Fix error in HtmlContentView.ShowContent when no JS/CSS provided (Thanks @rkeithhill!) +- 📖 [vscode-PowerShell #1900](https://github.com/PowerShell/vscode-PowerShell/pull/1900) - + Small update to Azure Data Studio marketplace README (Thanks @SQLvariant!) +- 💻 [vscode-PowerShell #1871](https://github.com/PowerShell/vscode-PowerShell/pull/1871) - + Change CI to use Azure Pipelines +- 🐛 [vscode-PowerShell #1867](https://github.com/PowerShell/vscode-PowerShell/pull/1867) - + Change whitespace settings to camelCase +- 🐛 [vscode-PowerShell #1852](https://github.com/PowerShell/vscode-PowerShell/pull/1852) - + Turn `powershell.codeformatting.useCorrectCasing` setting off by default until PSScriptAnalyzer issues are fixed (Thanks @bergmeister!) +- 🐛 [vscode-powershell #1822](https://github.com/PowerShell/vscode-PowerShell/pull/1838) - + Set featureFlag default to null so that it can be resolved by settings +- 🐛 [vscode-PowerShell #1837](https://github.com/PowerShell/vscode-PowerShell/pull/1837) - + Don't use -EncodedCommand to start PowerShell on Windows +- 🐛 [vscode-PowerShell #1825](https://github.com/PowerShell/vscode-PowerShell/pull/1825) - + Switch to current lowercase names for powershell and mdlint extensions (Thanks @rkeithhill!) +- 👷 [vscode-PowerShell #1823](https://github.com/PowerShell/vscode-PowerShell/pull/1823) - + Update to official TSLint extension in extensions.json, old version deprecated (Thanks @rkeithhill!) + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🚨 [PowerShellEditorServices #944](https://github.com/PowerShell/PowerShellEditorServices/pull/944) - + Add integration testing module with simple tests to verify PSES starts and stops +- 🐛 [PowerShellEditorServices #954](https://github.com/PowerShell/PowerShellEditorServices/pull/955) - + Ensure NamedPipeServerStream is assigned in Windows PowerShell +- ✨ [PowerShellEditorServices #952](https://github.com/PowerShell/PowerShellEditorServices/pull/952) - + Update to PSReadLine 2.0.0-beta4 +- ✨ [PowerShellEditorServices #877](https://github.com/PowerShell/PowerShellEditorServices/pull/877) - + Add filtering for CodeLens and References (Thanks @glennsarti!) +- 👷 [PowerShellEditorServices #878](https://github.com/PowerShell/PowerShellEditorServices/pull/878) - + Remove native named pipes implementation +- 🐛 [PowerShellEditorServices #946](https://github.com/PowerShell/PowerShellEditorServices/pull/946) - + Rename to use async +- 👷 [PowerShellEditorServices #943](https://github.com/PowerShell/PowerShellEditorServices/pull/943) - + Improvements to the log parsing module (Thanks @rkeithhill!) +- 🐛 [PowerShellEditorServices #908](https://github.com/PowerShell/PowerShellEditorServices/pull/908) - + Fix issue with reference code lens not working with UNC paths (Thanks @rkeithhill!) +- 🐛 [vscode-powershell #1571](https://github.com/PowerShell/PowerShellEditorServices/pull/911) - + Fix faulty netfx check +- 🐛 [PowerShellEditorServices #906](https://github.com/PowerShell/PowerShellEditorServices/pull/906) - + Fix New-EditorFile with no folder or no files open +- ✨ [vscode-powershell #1398](https://github.com/PowerShell/PowerShellEditorServices/pull/902) - + Improve path auto-completion (Thanks @rkeithhill!) +- 🐛 [PowerShellEditorServices #910](https://github.com/PowerShell/PowerShellEditorServices/pull/910) - + Fix UseCorrectCasing to be actually configurable via `powershell.codeFormatting.useCorrectCasing` (Thanks @bergmeister!) +- 👷 [PowerShellEditorServices #909](https://github.com/PowerShell/PowerShellEditorServices/pull/909) - + Use global.json to pin .Net Core SDK version and update it from 2.1.402 to 2.1.602 (Thanks @bergmeister!) +- 👷 [PowerShellEditorServices #903](https://github.com/PowerShell/PowerShellEditorServices/pull/903) - + Move temp folder into repo to avoid state that causes build errors from time to time when rebuilding locally (and packages have updated) (Thanks @bergmeister!) +- 💻 [PowerShellEditorServices #904](https://github.com/PowerShell/PowerShellEditorServices/pull/904) - + Add initial credscan configuation ymls for CI +- 🐛 [PowerShellEditorServices #901](https://github.com/PowerShell/PowerShellEditorServices/pull/901) - + Switch to current lowercase names for powershell and mdlint exts (Thanks @rkeithhill!) + +## v2.0.0-preview.3 +### Wednesday, April 10, 2019 +#### [vscode-powershell](https://github.com/powershell/vscode-powershell) + +- [vscode-PowerShell #1838](https://github.com/PowerShell/vscode-PowerShell/pull/1838) - + Set PSReadLine featureFlag default to null so that it can be resolved by settings +- [vscode-PowerShell #1825](https://github.com/PowerShell/vscode-PowerShell/pull/1825) - + Switch to current lowercase names for powershell and mdlint recommended extensions (Thanks @rkeithhill!) +- [vscode-PowerShell #1823](https://github.com/PowerShell/vscode-PowerShell/pull/1823) - + Update to official TSLint ext in extensions.json, old version deprecated (Thanks @rkeithhill!) + +#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) + +- [PowerShellEditorServices #909](https://github.com/PowerShell/PowerShellEditorServices/pull/909) - + Use global.json to pin .Net Core SDK version and update it from 2.1.402 to 2.1.602 (Thanks @bergmeister!) +- [PowerShellEditorServices #903](https://github.com/PowerShell/PowerShellEditorServices/pull/903) - + Move temp folder into repo to avoid state that causes build errors from time to time when rebuilding locally (and packages have updated) (Thanks @bergmeister!) + +## v2.0.0-preview.2 +### Friday, March 29, 2019 + +### Highlights + +* `Write-Progress` work in the integrated console ⏰ +* Support for [PSScriptAnalyzer 1.18](https://github.com/PowerShell/PSScriptAnalyzer/releases/tag/1.18.0) 📝 +* The ability to debug any runspace in any process 🔎 +* PSReadLine enabled by default on Windows 🎨 +* (Bug fix!) You can open untitled workspaces/folders again! 🐛☠️ + +There are a lot more goodies in this version. Checkout the changelog below! + +#### [vscode-powershell](https://github.com/powershell/vscode-powershell) + +- [vscode-PowerShell #1794](https://github.com/PowerShell/vscode-PowerShell/pull/1794) - + Make PSReadLine default on Windows +- [vscode-PowerShell #1741](https://github.com/PowerShell/vscode-PowerShell/pull/1741) - + Update build to clear node modules directory (Thanks @corbob!) + +#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) + +- [PowerShellEditorServices #858](https://github.com/PowerShell/PowerShellEditorServices/pull/858) - + Fix XUnit warnings that better assertion operators should be used. (Thanks @bergmeister!) +- [PowerShellEditorServices #859](https://github.com/PowerShell/PowerShellEditorServices/pull/859) - + Upgrade PowerShellStandard.Library, PowerShell.SDK, NET.Test.SDK and Serilog NuGet packages to latest released version and enable AppVeyor build on any branch (Thanks @bergmeister!) + +## v2.0.0-preview.1 +### Wednesday, January 23, 2019 + +#### Preview builds of the PowerShell extension are now available in VSCode + +We are excited to announce the PowerShell Preview extension in the VSCode marketplace! +The PowerShell Preview extension allows users on Windows PowerShell 5.1 and PowerShell Core 6 to get and test the latest updates +to the PowerShell extension and comes with some exciting features. + +The PowerShell Preview extension is a substitute for the PowerShell extension so +both the PowerShell extension and the PowerShell Preview extension should not be enabled at the same time. + +By having a preview channel, in addition to our existing stable channel, we can get new features out faster and get feedback faster from you, the users. + +##### How to Get/Use the PowerShell Preview extension + +If you dont already have VSCode, start [here](https://code.visualstudio.com/Docs/setup/setup-overview). + +Once you have VSCode open, click `Clt+Shift+X` to open the extensions marketplace. +Next, type `PowerShell Preview` in the search bar. +Click `Install` on the `PowerShell Preview` page. +Finally, click `Reload` in order to refresh VSCode. + +If you already have the PowerShell extension, please disable it to use the Powershell Preview extension. +To disable the PowerShell extension, find it in the Extensions sidebar view, specifically under the list of Enabled extensions, +Right-click on the PowerShell extension and select `Disable`. +Please note that it is important to only have either the PowerShell extension or the PowerShell Preview extension enabled at one time. +![How to Disable](https://github.com/PowerShell/powershell.github.io/blob/master/PowerShell-Blog/Images/disable-extension.jpg) + +#### What the first preview contains + +The v2.0.0-preview.1 version of the extension is built on .NET Standard +(enabling support for both Windows PowerShell and PowerShell Core from one assembly) + +It also contains PSReadLine support in the integrated console for Windows behind a feature flag. +PSReadLine provides a consistent and rich interactive experience, +including syntax coloring and multi-line editing and history, in the PowerShell console, in Cloud Shell, +and now in VSCode terminal. For more information on the benefits of PSReadLine, +check out their [documentation](https://docs.microsoft.com/en-us/powershell/module/psreadline/about/about_psreadline?view=powershell-6). + +HUGE thanks to @SeeminglyScience for all his amazing work getting PSReadLine working in PowerShell Editor Services! + +#### Breaking Changes + +As stated above, this version of the PowerShell extension only works with Windows PowerShell versions 5.1 and PowerShell Core 6. + +#### [vscode-powershell](https://github.com/powershell/vscode-powershell) + +- [vscode-PowerShell #1587](https://github.com/PowerShell/vscode-PowerShell/pull/1587) - + Removed ShowOnlineHelp Command (Thanks @corbob!) + +#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) + +- [PowerShellEditorServices #792](https://github.com/PowerShell/PowerShellEditorServices/pull/792) - + Add Async suffix to async methods (Thanks @dee-see!) +- [PowerShellEditorServices #775](https://github.com/PowerShell/PowerShellEditorServices/pull/775) - + Removed ShowOnlineHelp Message (Thanks @corbob!) +- [PowerShellEditorServices #769](https://github.com/PowerShell/PowerShellEditorServices/pull/769) - + Set Runspaces to use STA when running in Windows PowerShell +- [PowerShellEditorServices #741](https://github.com/PowerShell/PowerShellEditorServices/pull/741) - + Migrate to netstandard2.0 and PSStandard +- [PowerShellEditorServices #672](https://github.com/PowerShell/PowerShellEditorServices/pull/672) - + PSReadLine integration (Thanks @SeeminglyScience!) From 7ac3631da622a78a0fd342bd4e65f861896569e7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 16:30:12 -0800 Subject: [PATCH 093/166] Bump @types/sinon from 7.5.1 to 7.5.2 (#2515) Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 7.5.1 to 7.5.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 26 ++++++++++++++++---------- package.json | 2 +- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index f642b1daa8..e9ffaabcd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -147,9 +147,9 @@ } }, "@types/sinon": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.1.tgz", - "integrity": "sha512-EZQUP3hSZQyTQRfiLqelC9NMWd1kqLcmQE0dMiklxBkgi84T+cHOhnKpgk4NnOWpGX863yE6+IaGnOXUNFqDnQ==", + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.2.tgz", + "integrity": "sha512-T+m89VdXj/eidZyejvmoP9jivXgBDdkOSBVQjU9kF349NEx10QdPNGxHeZUaj1IlJ32/ewdyXJjnJxyxJroYwg==", "dev": true }, "@types/vscode": { @@ -976,9 +976,9 @@ }, "dependencies": { "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -1932,9 +1932,9 @@ "dev": true }, "vsce": { - "version": "1.64.0", - "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.64.0.tgz", - "integrity": "sha512-t3R7QTe2nAXQZs2kD+nA8GjdlX8pAQlnzxaNTG2976i5cyQ8r+ZsMNa/f9PDt7bhjcQM+u/fL+LkNuw+hwoy2A==", + "version": "1.74.0", + "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.74.0.tgz", + "integrity": "sha512-8zWM9bZBNn9my40kkxAxdY4nhb9ADfazXsyDgx1thbRaLPbmPTlmqQ55vCAyWYFEi6XbJv8w599vzVUqsU1gHg==", "dev": true, "requires": { "azure-devops-node-api": "^7.2.0", @@ -1944,7 +1944,7 @@ "denodeify": "^1.2.1", "didyoumean": "^1.2.1", "glob": "^7.0.6", - "lodash": "^4.17.10", + "lodash": "^4.17.15", "markdown-it": "^8.3.1", "mime": "^1.3.4", "minimatch": "^3.0.3", @@ -1959,6 +1959,12 @@ "yazl": "^2.2.2" }, "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", diff --git a/package.json b/package.json index 5f504e94bc..db613ca9e1 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@types/node-fetch": "~2.5.4", "@types/rewire": "~2.5.28", "@types/semver": "~7.1.0", - "@types/sinon": "~7.5.1", + "@types/sinon": "~7.5.2", "@types/vscode": "1.40.0", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.3", From 23be380df47f46a0e066f9ad59a543107bd608dc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 16:44:13 -0800 Subject: [PATCH 094/166] Bump @types/node-fetch from 2.5.4 to 2.5.5 (#2514) Bumps [@types/node-fetch](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node-fetch) from 2.5.4 to 2.5.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node-fetch) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 56 +++++++++++++++++++++++++++++++++++++++++++---- package.json | 2 +- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e9ffaabcd3..499bb710b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -123,12 +123,13 @@ "dev": true }, "@types/node-fetch": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.4.tgz", - "integrity": "sha512-Oz6id++2qAOFuOlE1j0ouk1dzl3mmI1+qINPNBhi9nt/gVOz0G+13Ao6qjhdF0Ys+eOkhu6JnFmt38bR3H0POQ==", + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.5.tgz", + "integrity": "sha512-IWwjsyYjGw+em3xTvWVQi5MgYKbRs0du57klfTaZkv/B24AEQ/p/IopNeqIYNy3EsfHOpg8ieQSDomPcsYMHpA==", "dev": true, "requires": { - "@types/node": "*" + "@types/node": "*", + "form-data": "^3.0.0" } }, "@types/rewire": { @@ -270,6 +271,12 @@ } } }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, "azure-devops-node-api": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-7.2.0.tgz", @@ -497,6 +504,15 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, "commander": { "version": "2.15.1", "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", @@ -586,6 +602,12 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, "denodeify": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/denodeify/-/denodeify-1.2.1.tgz", @@ -888,6 +910,17 @@ "write": "^0.2.1" } }, + "form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1214,6 +1247,21 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true }, + "mime-db": { + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "dev": true, + "requires": { + "mime-db": "1.43.0" + } + }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", diff --git a/package.json b/package.json index db613ca9e1..eb2c070601 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@types/mocha": "~7.0.1", "@types/mock-fs": "~4.10.0", "@types/node": "~10.11.0", - "@types/node-fetch": "~2.5.4", + "@types/node-fetch": "~2.5.5", "@types/rewire": "~2.5.28", "@types/semver": "~7.1.0", "@types/sinon": "~7.5.2", From 051d9eb08443a36cc700ef3285d359adbfc981e5 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 2 Mar 2020 17:47:11 -0800 Subject: [PATCH 095/166] [Ignore] Add CommentHelp CL item (#2517) --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6cf76e15d..ca7d0bfc84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ Fix intellisense and `F5` not working after debugging. - 🐛🧰 [vscode-PowerShell #2495](https://github.com/PowerShell/PowerShellEditorServices/pull/1211) - Fix PowerShellEditorServices.Commands module commands not working due to types being moved. +- 🐛👮 [vscode-PowerShell #2516](https://github.com/PowerShell/PowerShellEditorServices/pull/1216) - + Fix CommentHelp for when a function has other problems with it. ## v2020.2.0 ### Thursday, February 20, 2020 From 94f362490be029017ecf24d820a03e6a1e1c6bac Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 5 Mar 2020 18:07:40 -0800 Subject: [PATCH 096/166] Add "files" and "search" to configurationSection (#2524) --- src/session.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/session.ts b/src/session.ts index 10e4de6a3f..9251d298f2 100644 --- a/src/session.ts +++ b/src/session.ts @@ -495,7 +495,8 @@ export class SessionManager implements Middleware { const clientOptions: LanguageClientOptions = { documentSelector: this.documentSelector, synchronize: { - configurationSection: utils.PowerShellLanguageId, + // backend uses "files" and "search" to ignore references. + configurationSection: [ utils.PowerShellLanguageId, "files", "search" ], // fileEvents: vscode.workspace.createFileSystemWatcher('**/.eslintrc') }, errorHandler: { From ead1513aab0cd1f91b2c317a4d254452dd6bac53 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Mon, 9 Mar 2020 14:41:44 -0700 Subject: [PATCH 097/166] [Ignore] Log errors with session file (#2540) --- src/process.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/process.ts b/src/process.ts index aa957b5dd3..d77fe8b8b8 100644 --- a/src/process.ts +++ b/src/process.ts @@ -180,7 +180,7 @@ export class PowerShellProcess { utils.deleteSessionFile(this.sessionFilePath); if (error) { - this.log.write("Error occurred retrieving session file"); + this.log.write(`Error occurred retrieving session file:\n${error}`); return reject(error); } From ea82375ab0b50399b46bd1c5aef6a5e612c57f19 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 18:28:13 -0700 Subject: [PATCH 098/166] Bump @types/mocha from 7.0.1 to 7.0.2 (#2541) Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 7.0.1 to 7.0.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 499bb710b6..0208970ec5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -102,9 +102,9 @@ "dev": true }, "@types/mocha": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.1.tgz", - "integrity": "sha512-L/Nw/2e5KUaprNJoRA33oly+M8X8n0K+FwLTbYqwTcR14wdPWeRkigBLfSFpN/Asf9ENZTMZwLxjtjeYucAA4Q==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", + "integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==", "dev": true }, "@types/mock-fs": { diff --git a/package.json b/package.json index eb2c070601..262b1bbd90 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ }, "devDependencies": { "@types/glob": "^7.1.1", - "@types/mocha": "~7.0.1", + "@types/mocha": "~7.0.2", "@types/mock-fs": "~4.10.0", "@types/node": "~10.11.0", "@types/node-fetch": "~2.5.5", From 9051b99789ebb585c5bb92064ecc2278504fff6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 12 Mar 2020 20:03:57 +0100 Subject: [PATCH 099/166] Run single Pester test (#2441) * Run single test * Add options for code lens and verbosity * Rename Pester options to enableLegacyCodeLens and outputVerbosity * change to use Co-authored-by: Tyler Leonhardt --- InvokePesterStub.ps1 | 86 ++++++++++++++++++++++++++++++++----- package.json | 15 +++++++ src/features/PesterTests.ts | 6 +++ src/settings.ts | 13 ++++++ 4 files changed, 109 insertions(+), 11 deletions(-) diff --git a/InvokePesterStub.ps1 b/InvokePesterStub.ps1 index 8b6f204cce..d9aa31a132 100755 --- a/InvokePesterStub.ps1 +++ b/InvokePesterStub.ps1 @@ -47,36 +47,100 @@ param( # If specified, executes all the tests in the specified test script. [Parameter()] [switch] - $All + $All, + + [Parameter()] + [switch] $MinimumVersion5, + + [Parameter(Mandatory)] + [string] $Output ) $pesterModule = Microsoft.PowerShell.Core\Get-Module Pester +# add one line, so the subsequent output is not shifted to the side +Write-Output '' if (!$pesterModule) { Write-Output "Importing Pester module..." - $pesterModule = Microsoft.PowerShell.Core\Import-Module Pester -ErrorAction Ignore -PassThru + $minimumVersion = if ($MinimumVersion5) { "5.0.0" } else { "0.0.0" } + $versionMessage = " version $minimumVersion" + $pesterModule = Microsoft.PowerShell.Core\Import-Module Pester -ErrorAction Ignore -PassThru -MinimumVersion $minimumVersion if (!$pesterModule) { # If we still don't have an imported Pester module, that is (most likely) because Pester is not installed. - Write-Warning "Failed to import the Pester module. You must install Pester to run or debug Pester tests." - Write-Warning "You can install Pester by executing: Install-Module Pester -Scope CurrentUser -Force" + Write-Warning "Failed to import Pester$(if ($MinimumVersion5){ $versionMessage }). You must install Pester module to run or debug Pester tests." + Write-Warning "You can install Pester by executing: Install-Module Pester $(if ($MinimumVersion5) {"-MinimumVersion 5.0.0" }) -Scope CurrentUser -Force" return } } -if ($All) { - Pester\Invoke-Pester -Script $ScriptPath -PesterOption @{IncludeVSCodeMarker=$true} +$pester4Output = switch ($Output) { + "None" { "None" } + "Minimal" { "Fails" } + default { "All" } } -elseif ($TestName) { - Pester\Invoke-Pester -Script $ScriptPath -PesterOption @{IncludeVSCodeMarker=$true} -TestName $TestName + +if ($MinimumVersion5 -and $pesterModule.Version -lt "5.0.0") { + Write-Warning "Pester 5.0.0 or newer is required because setting PowerShell > Pester: Enable Legacy Code Lens is disabled, but Pester $($pesterModule.Version) is loaded. Some of the code lense features might not work as expected." +} + + +if ($All) { + if ($pesterModule.Version -ge '5.0.0') { + $configuration = @{ + Run = @{ + Path = $ScriptPath + } + } + # only override this if user asks us to do it, to allow Pester to pick up + # $PesterPreference from caller context and merge it with the configuration + # we provide below, this way user can specify his output (and other) settings + # using the standard [PesterConfiguration] object, and we can avoid providing + # settings for everything + if ("FromPreference" -ne $Output) { + $configuration.Add('Output', @{ Verbosity = $Output }) + } + Pester\Invoke-Pester -Configuration $configuration | Out-Null + } + else { + Pester\Invoke-Pester -Script $ScriptPath -PesterOption @{IncludeVSCodeMarker=$true} -Show $pester4Output + } } elseif (($LineNumber -match '\d+') -and ($pesterModule.Version -ge '4.6.0')) { - Pester\Invoke-Pester -Script $ScriptPath -PesterOption (New-PesterOption -ScriptBlockFilter @{ - IncludeVSCodeMarker=$true; Line=$LineNumber; Path=$ScriptPath}) + if ($pesterModule.Version -ge '5.0.0') { + $configuration = @{ + Run = @{ + Path = $ScriptPath + } + Filter = @{ + Line = "${ScriptPath}:$LineNumber" + } + } + if ("FromPreference" -ne $Output) { + $configuration.Add('Output', @{ Verbosity = $Output }) + } + Pester\Invoke-Pester -Configuration $configuration | Out-Null + } + else { + Pester\Invoke-Pester -Script $ScriptPath -PesterOption (New-PesterOption -ScriptBlockFilter @{ + IncludeVSCodeMarker=$true; Line=$LineNumber; Path=$ScriptPath}) -Show $pester4Output + } +} +elseif ($TestName) { + if ($pesterModule.Version -ge '5.0.0') { + throw "Running tests by test name is unsafe. This should not trigger for Pester 5." + } + else { + Pester\Invoke-Pester -Script $ScriptPath -PesterOption @{IncludeVSCodeMarker=$true} -TestName $TestName -Show $pester4Output + } } else { + if ($pesterModule.Version -ge '5.0.0') { + throw "Running tests by expandable string is unsafe. This should not trigger for Pester 5." + } + # We get here when the TestName expression is of type ExpandableStringExpressionAst. # PSES will not attempt to "evaluate" the expression so it returns null for the TestName. Write-Warning "The Describe block's TestName cannot be evaluated. EXECUTING ALL TESTS instead." Write-Warning "To avoid this, install Pester >= 4.6.0 or remove any expressions in the TestName." - Pester\Invoke-Pester -Script $ScriptPath -PesterOption @{IncludeVSCodeMarker=$true} + Pester\Invoke-Pester -Script $ScriptPath -PesterOption @{IncludeVSCodeMarker=$true} -Show $pester4Output } diff --git a/package.json b/package.json index 262b1bbd90..13ddff1b49 100644 --- a/package.json +++ b/package.json @@ -760,6 +760,21 @@ "type": "array", "default": null, "description": "An array of strings that enable experimental features in the PowerShell extension." + }, + "powershell.pester.enableLegacyCodeLens": { + "type": "boolean", + "default": true, + "description": "Enable code lense that is compatible with Pester 4. Disabling this will show 'Run Tests' on all It, Describe and Context blocks, and will correctly work only with Pester 5 and newer." + }, + "powershell.pester.outputVerbosity": { + "type": "string", + "enum": [ + "FromPreference", + "Normal", + "Minimal" + ], + "default": "FromPreference", + "description": "Defines the verbosity of output to be used. For Pester 5 and newer the default value FromPreference, will use the Output settings from the $PesterPreference defined in the caller context, and will default to Normal if there is none. For Pester 4 the FromPreference and Normal options map to All, and Minimal option maps to Fails." } } }, diff --git a/src/features/PesterTests.ts b/src/features/PesterTests.ts index 5b81655687..de53100992 100644 --- a/src/features/PesterTests.ts +++ b/src/features/PesterTests.ts @@ -109,6 +109,12 @@ export class PesterTestsFeature implements IFeature { launchConfig.args.push("-TestName", `'${testName}'`); } + if (!settings.pester.useLegacyCodeLens) { + launchConfig.args.push("-MinimumVersion5"); + } + + launchConfig.args.push("-Output", `'${settings.pester.outputVerbosity}'`); + return launchConfig; } diff --git a/src/settings.ts b/src/settings.ts index 00c561225b..9c81b2cc27 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -94,6 +94,7 @@ export interface ISettings { integratedConsole?: IIntegratedConsoleSettings; bugReporting?: IBugReportingSettings; sideBar?: ISideBarSettings; + pester?: IPesterSettings; } export interface IStartAsLoginShellSettings { @@ -113,6 +114,11 @@ export interface ISideBarSettings { CommandExplorerVisibility?: boolean; } +export interface IPesterSettings { + useLegacyCodeLens?: boolean; + outputVerbosity?: string; +} + export function load(): ISettings { const configuration: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration( @@ -177,6 +183,11 @@ export function load(): ISettings { CommandExplorerVisibility: true, }; + const defaultPesterSettings: IPesterSettings = { + useLegacyCodeLens: true, + outputVerbosity: "FromPreference", + }; + return { startAutomatically: configuration.get("startAutomatically", true), @@ -212,6 +223,8 @@ export function load(): ISettings { configuration.get("bugReporting", defaultBugReportingSettings), sideBar: configuration.get("sideBar", defaultSideBarSettings), + pester: + configuration.get("pester", defaultPesterSettings), startAsLoginShell: // tslint:disable-next-line // We follow the same convention as VS Code - https://github.com/microsoft/vscode/blob/ff00badd955d6cfcb8eab5f25f3edc86b762f49f/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts#L105-L107 From 4845153d24a43c39b0e0a2c4198e9e118d6b1adc Mon Sep 17 00:00:00 2001 From: Mattias Karlsson Date: Thu, 12 Mar 2020 21:14:12 +0100 Subject: [PATCH 100/166] ms-vscode.csharp to ms-dotnettools.csharp (#2533) --- docs/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 4f0155c252..45a305e8b8 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -262,7 +262,7 @@ EditorConfig.EditorConfig@0.12.4 jchannon.csharpextensions@1.3.0 k--kato.docomment@0.1.2 ms-vscode.cpptools@0.18.1 -ms-vscode.csharp@1.16.1 +ms-dotnettools.csharp@1.12.13 ms-vscode.PowerShell@2.0.0 twxs.cmake@0.0.17 vscodevim.vim@0.16.5 From 1e734c7bdda0e323c27fc84104f637349d2dbab2 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 12 Mar 2020 15:40:38 -0700 Subject: [PATCH 101/166] Changelog for v2020.3.0-preview (#2553) * Changelog for v2020.3.0-preview * Apply suggestions from code review Co-Authored-By: Robert Holt Co-authored-by: Robert Holt --- CHANGELOG.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca7d0bfc84..f88b3679c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,46 @@ # PowerShell Preview Extension Release History +## v2020.3.0-preview +### Thursday, March 12, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🐛👷‍♀️ [vscode-powershell #2533](https://github.com/PowerShell/vscode-powershell/pull/2533) - + Change source repository's recommended extension from ms-vscode.csharp to ms-dotnettools.csharp. (Thanks @devlead!) + +- ✨🐢 [vscode-powershell #2441](https://github.com/PowerShell/vscode-powershell/pull/2441) - + Run a single Pester test. (Thanks @nohwnd!) +- 🐛🔧 [vscode-powershell #2524](https://github.com/PowerShell/vscode-powershell/pull/2524) - + Add `files.exclude` and `search.exclude` to configurations sent through to exclude them from PSES functionality + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- ✨🧠 [PowerShellEditorServices #1232](https://github.com/PowerShell/PowerShellEditorServices/pull/1232) - + Only resolve completion items from commands. +- ✨🐢 [PowerShellEditorServices #1167](https://github.com/PowerShell/PowerShellEditorServices/pull/1167) - + Run a single test in Pester v5. (Thanks @nohwnd!) +- 🐛🔍 [vscode-powershell #2534](https://github.com/PowerShell/PowerShellEditorServices/pull/1230) - + Ensure that errors are written to the console when debugging. +- 🐛🔍 [vscode-powershell #2525](https://github.com/PowerShell/PowerShellEditorServices/pull/1229) - + Don't warn users when using `Clear-Host` in temp sessions. +- ✨💎 [PowerShellEditorServices #1228](https://github.com/PowerShell/PowerShellEditorServices/pull/1228) - + Add better logging for formatter and refactor it into 1 class. +- 🐛🚂 [vscode-powershell #2397](https://github.com/PowerShell/PowerShellEditorServices/pull/1227) - + Use Assembly.LoadFile for dependency loading in WinPS. +- ✨🛫 [PowerShellEditorServices #1222](https://github.com/PowerShell/PowerShellEditorServices/pull/1222) - + Make initial logging work in constrained language mode, allowing the desired user-facing error to present. +- 🐛🛫 [PowerShellEditorServices #1225](https://github.com/PowerShell/PowerShellEditorServices/pull/1225) - + Sign Clear-Host.ps1. +- 🐛🛫 [PowerShellEditorServices #1219](https://github.com/PowerShell/PowerShellEditorServices/pull/1219) - + Ensure log directory is created. +- 🐛👷‍♀️ [PowerShellEditorServices #1223](https://github.com/PowerShell/PowerShellEditorServices/pull/1223) - + Change Ms-vscode.csharp to ms-dotnettools.csharp. (Thanks @devlead!) +- 🐛🔧 [PowerShellEditorServices #1220](https://github.com/PowerShell/PowerShellEditorServices/pull/1220) - + Fix typo in settings. +- ✨🔧 [PowerShellEditorServices #1218](https://github.com/PowerShell/PowerShellEditorServices/pull/1218) - + Switch to better document selecting for vim extension. +- 🐛🧠 [PowerShellEditorServices #1217](https://github.com/PowerShell/PowerShellEditorServices/pull/1217) - + Make session-state lock task-reentrant to fix Untitled file debugging. + ## v2020.3.0 ### Thursday, March 12, 2020 #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) From 5e391ab610870d0b5db513290e8dc15574c7d431 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2020 12:18:23 -0700 Subject: [PATCH 102/166] Bump sinon from 9.0.0 to 9.0.1 (#2563) Bumps [sinon](https://github.com/sinonjs/sinon) from 9.0.0 to 9.0.1. - [Release notes](https://github.com/sinonjs/sinon/releases) - [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md) - [Commits](https://github.com/sinonjs/sinon/compare/v9.0.0...v9.0.1) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 30 ++++++++++++++---------------- package.json | 2 +- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0208970ec5..517bd24c35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,13 +61,12 @@ } }, "@sinonjs/samsam": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.0.2.tgz", - "integrity": "sha512-p3yrEVB5F/1wI+835n+X8llOGRgV8+jw5BHQ/cJoLBUXXZ5U8Tr5ApwPc4L4av/vjla48kVPoN0t6dykQm+Rvg==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.0.3.tgz", + "integrity": "sha512-QucHkc2uMJ0pFGjJUDP3F9dq5dx8QIaqISl9QgwLOh6P9yv877uONPGXh/OH/0zmM3tW1JjuJltAZV2l7zU+uQ==", "dev": true, "requires": { "@sinonjs/commons": "^1.6.0", - "@sinonjs/formatio": "^5.0.0", "lodash.get": "^4.4.2", "type-detect": "^4.0.8" } @@ -1165,9 +1164,9 @@ "dev": true }, "just-extend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", - "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.0.tgz", + "integrity": "sha512-ApcjaOdVTJ7y4r08xI5wIqpvwS48Q0PBG4DJROcEkH1f8MdAiNFyFxz3xoL0LWAVwjrwPYZdVHHxhRHcx/uGLA==", "dev": true }, "levn": { @@ -1370,14 +1369,13 @@ "dev": true }, "nise": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/nise/-/nise-4.0.2.tgz", - "integrity": "sha512-ALDnm0pTTyeGdbg5FCpWGd58Nmp3qO8d8x+dU2Fw8lApeJTEBSjkBZZM4S8t6GpKh+czxkfM/TKxpRMroZzwOg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nise/-/nise-4.0.3.tgz", + "integrity": "sha512-EGlhjm7/4KvmmE6B/UFsKh7eHykRl9VH+au8dduHLCyWUO/hr7+N+WtTvDUwc9zHuM1IaIJs/0lQ6Ag1jDkQSg==", "dev": true, "requires": { "@sinonjs/commons": "^1.7.0", "@sinonjs/fake-timers": "^6.0.0", - "@sinonjs/formatio": "^5.0.1", "@sinonjs/text-encoding": "^0.7.1", "just-extend": "^4.0.2", "path-to-regexp": "^1.7.0" @@ -1727,15 +1725,15 @@ "dev": true }, "sinon": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.0.tgz", - "integrity": "sha512-c4bREcvuK5VuEGyMW/Oim9I3Rq49Vzb0aMdxouFaA44QCFpilc5LJOugrX+mkrvikbqCimxuK+4cnHVNnLR41g==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.1.tgz", + "integrity": "sha512-iTTyiQo5T94jrOx7X7QLBZyucUJ2WvL9J13+96HMfm2CGoJYbIPqRfl6wgNcqmzk0DI28jeGx5bUTXizkrqBmg==", "dev": true, "requires": { "@sinonjs/commons": "^1.7.0", "@sinonjs/fake-timers": "^6.0.0", - "@sinonjs/formatio": "^5.0.0", - "@sinonjs/samsam": "^5.0.1", + "@sinonjs/formatio": "^5.0.1", + "@sinonjs/samsam": "^5.0.3", "diff": "^4.0.2", "nise": "^4.0.1", "supports-color": "^7.1.0" diff --git a/package.json b/package.json index 13ddff1b49..a6f6dce8c1 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "mocha-multi-reporters": "~1.1.7", "mock-fs": "~4.11.0", "rewire": "~4.0.1", - "sinon": "~9.0.0", + "sinon": "~9.0.1", "tslint": "~6.0.0", "typescript": "~3.5.3", "vsce": "~1.74.0", From 08caebfbae5e0f4eb6b0b67ba18333cfe07b70b7 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 23 Mar 2020 17:15:55 -0700 Subject: [PATCH 103/166] [ignore] terms Misc better language in CL (#2582) --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f88b3679c5..ce1283dc50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -92,7 +92,7 @@ - 🐛🐢 [vscode-PowerShell #2438](https://github.com/PowerShell/vscode-powershell/pull/2447/) - Fixes test failures in Pester contexts not showing up in the Problems pane. (Thanks @tillig!) - 🐛🔍 [vscode-PowerShell #2548](https://github.com/PowerShell/vscode-powershell/pull/2458) - - Show error message instead of hanging when temp debugging is used with an untitled file. + Show error message instead of not responding when temp debugging is used with an untitled file. - 👷 [vscode-PowerShell #2465](https://github.com/PowerShell/vscode-powershell/pull/2465) - Move macOS CI images to 10.14 (Thanks @bergmeister!) @@ -117,7 +117,7 @@ Improve PSReadLine experience where no new line is rendered in the console. - ✨🔍 [PowerShellEditorServices #1119](https://github.com/powershell/powershelleditorservices/pull/1119) - Enable new debugging APIs added in PowerShell 7, improving performance and fixing issues where - the debugger would hang or be unable to update breakpoints while scripts were running. + the debugger would stop responding or be unable to update breakpoints while scripts were running. - 👷📟 [PowerShellEditorServices #1187](https://github.com/PowerShell/PowerShellEditorServices/pull/1187) - Upgrade built-in PSReadLine to 2.0.0 GA. - 🐛👮 [PowerShellEditorServices #1179](https://github.com/PowerShell/PowerShellEditorServices/pull/1179) - @@ -1072,7 +1072,7 @@ As stated above, this version of the PowerShell extension only works with Window Handle exception case when finding references of a symbol - [PowerShell/vscode-powershell #942](https://github.com/PowerShell/vscode-powershell/issues/942) - - Temporary debugging session now does not hang when running "PowerShell Interactive Session" debugging configuration + Temporary debugging session now does not stop responding when running "PowerShell Interactive Session" debugging configuration - [PowerShell/vscode-powershell #917](https://github.com/PowerShell/vscode-powershell/issues/917) - Added PowerShell.InvokeRegisteredEditorCommand command to be used from HTML preview views for invoking editor commands registered in PowerShell. Thanks to [Kamil Kosek](https://github.com/kamilkosek)! @@ -1308,7 +1308,7 @@ Special thanks to [Doug Finke](https://github.com/dfinke) for the contribution! the CodeLens feature. - [#851](https://github.com/PowerShell/vscode-powershell/issues/851) - - Fixed an issue where the language server would hang when typing out a describe + Fixed an issue where the language server would stop responding when typing out a describe block. - [#852](https://github.com/PowerShell/vscode-powershell/issues/852) - From fe6ac240ccb7b3f54bc8edf6e2188f7f9c5b32db Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2020 09:48:54 -0700 Subject: [PATCH 104/166] Bump rewire from 4.0.1 to 5.0.0 (#2562) Bumps [rewire](https://github.com/jhnns/rewire) from 4.0.1 to 5.0.0. - [Release notes](https://github.com/jhnns/rewire/releases) - [Changelog](https://github.com/jhnns/rewire/blob/master/CHANGELOG.md) - [Commits](https://github.com/jhnns/rewire/compare/v4.0.1...v5.0.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 951 +++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 518 insertions(+), 435 deletions(-) diff --git a/package-lock.json b/package-lock.json index 517bd24c35..18468dea74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -77,6 +77,12 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, "@types/events": { "version": "3.0.0", "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/@types/events/-/@types/events-3.0.0.tgz", @@ -159,27 +165,16 @@ "dev": true }, "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", "dev": true }, "acorn-jsx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", - "dev": true, - "requires": { - "acorn": "^3.0.4" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", - "dev": true - } - } + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true }, "agent-base": { "version": "4.3.0", @@ -191,28 +186,33 @@ } }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", + "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", - "dev": true - }, "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } }, "ansi-regex": { "version": "3.0.0", @@ -221,10 +221,31 @@ "dev": true }, "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + }, + "dependencies": { + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } }, "applicationinsights": { "version": "1.4.0", @@ -246,6 +267,12 @@ "sprintf-js": "~1.0.2" } }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async-hook-jl": { "version": "1.7.6", "resolved": "https://registry.npmjs.org/async-hook-jl/-/async-hook-jl-1.7.6.tgz", @@ -288,53 +315,6 @@ "underscore": "1.8.3" } }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -369,31 +349,16 @@ "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", "dev": true }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", - "dev": true, - "requires": { - "callsites": "^0.2.0" - } - }, "callsites": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, "chalk": { @@ -419,9 +384,9 @@ } }, "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "charenc": { @@ -444,19 +409,13 @@ "parse5": "^3.0.1" } }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "dev": true - }, "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "requires": { - "restore-cursor": "^2.0.0" + "restore-cursor": "^3.1.0" } }, "cli-width": { @@ -482,12 +441,6 @@ } } }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -524,18 +477,6 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, "continuation-local-storage": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/continuation-local-storage/-/continuation-local-storage-3.2.1.tgz", @@ -545,21 +486,25 @@ "emitter-listener": "^1.1.1" } }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "lru-cache": "^4.0.1", + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "crypt": { @@ -646,9 +591,9 @@ "dev": true }, "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" @@ -697,6 +642,12 @@ "shimmer": "^1.2.0" } }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", @@ -725,83 +676,122 @@ "dev": true }, "eslint": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", - "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", "dev": true, "requires": { - "ajv": "^5.3.0", - "babel-code-frame": "^6.22.0", + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", "chalk": "^2.1.0", - "concat-stream": "^1.6.0", - "cross-spawn": "^5.1.0", - "debug": "^3.1.0", - "doctrine": "^2.1.0", - "eslint-scope": "^3.7.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^3.5.4", - "esquery": "^1.0.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", + "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.0.1", - "ignore": "^3.3.3", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^3.0.6", - "is-resolvable": "^1.0.0", - "js-yaml": "^3.9.1", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.17.4", - "minimatch": "^3.0.2", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", + "optionator": "^0.8.3", "progress": "^2.0.0", - "regexpp": "^1.0.1", - "require-uncached": "^1.0.3", - "semver": "^5.3.0", - "strip-ansi": "^4.0.0", - "strip-json-comments": "~2.0.1", - "table": "4.0.2", - "text-table": "~0.2.0" + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" }, "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } } } }, "eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", "dev": true, "requires": { "esrecurse": "^4.1.0", "estraverse": "^4.1.1" } }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", "dev": true }, "espree": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", "dev": true, "requires": { - "acorn": "^5.5.0", - "acorn-jsx": "^3.0.0" + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" } }, "esprima": { @@ -811,9 +801,9 @@ "dev": true }, "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.1.0.tgz", + "integrity": "sha512-MxYW9xKmROWF672KqjO75sszsA8Mxhw06YFeS5VHlB98KDHbOSurm3ArsjO60Eaf3QmGMCP1yn+0JQkNLo/97Q==", "dev": true, "requires": { "estraverse": "^4.0.0" @@ -829,9 +819,9 @@ } }, "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, "esutils": { @@ -841,26 +831,26 @@ "dev": true }, "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", "tmp": "^0.0.33" } }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", "dev": true }, "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "fast-levenshtein": { @@ -879,36 +869,40 @@ } }, "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "requires": { "escape-string-regexp": "^1.0.5" } }, "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" + "flat-cache": "^2.0.1" } }, "flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", "dev": true, "requires": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" } }, + "flatted": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", + "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", + "dev": true + }, "form-data": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", @@ -946,17 +940,23 @@ "path-is-absolute": "^1.0.0" } }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } }, - "graceful-fs": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", - "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==", - "dev": true + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } }, "growl": { "version": "1.10.5", @@ -964,23 +964,6 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - } - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1050,11 +1033,21 @@ } }, "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -1078,25 +1071,78 @@ "dev": true }, "inquirer": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", "dev": true, "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", "cli-width": "^2.0.0", - "external-editor": "^2.0.4", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rx-lite": "^4.0.8", - "rx-lite-aggregates": "^4.0.8", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "is-buffer": { @@ -1105,42 +1151,39 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - }, "js-yaml": { "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", @@ -1152,9 +1195,9 @@ } }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stable-stringify-without-jsonify": { @@ -1200,16 +1243,6 @@ "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, "markdown-it": { "version": "8.4.2", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", @@ -1262,9 +1295,9 @@ } }, "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, "minimatch": { @@ -1368,6 +1401,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "nise": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/nise/-/nise-4.0.3.tgz", @@ -1395,12 +1434,6 @@ "boolbase": "~1.0.0" } }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1411,26 +1444,26 @@ } }, "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", "dev": true, "requires": { - "mimic-fn": "^1.0.0" + "mimic-fn": "^2.1.0" } }, "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "requires": { "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", + "fast-levenshtein": "~2.0.6", "levn": "~0.3.0", "prelude-ls": "~1.1.2", "type-check": "~0.3.2", - "wordwrap": "~1.0.0" + "word-wrap": "~1.2.3" } }, "os": { @@ -1461,6 +1494,15 @@ "os-tmpdir": "^1.0.0" } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parse-semver": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/parse-semver/-/parse-semver-1.1.1.tgz", @@ -1493,10 +1535,10 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, "path-parse": { @@ -1528,34 +1570,22 @@ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", "dev": true }, - "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", - "dev": true - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "read": { @@ -1567,37 +1597,12 @@ "mute-stream": "~0.0.4" } }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, "regexpp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", - "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, - "require-uncached": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - } - }, "resolve": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.0.tgz", @@ -1608,28 +1613,28 @@ } }, "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "requires": { - "onetime": "^2.0.0", + "onetime": "^5.1.0", "signal-exit": "^3.0.2" } }, "rewire": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/rewire/-/rewire-4.0.1.tgz", - "integrity": "sha512-+7RQ/BYwTieHVXetpKhT11UbfF6v1kGhKFrtZN7UDL2PybMsSt/rpLWeEUGF5Ndsl1D5BxiCB14VDJyoX+noYw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/rewire/-/rewire-5.0.0.tgz", + "integrity": "sha512-1zfitNyp9RH5UDyGGLe9/1N0bMlPQ0WrX0Tmg11kMHBpqwPJI4gfPpP7YngFyLbFmhXh19SToAG0sKKEFcOIJA==", "dev": true, "requires": { - "eslint": "^4.19.1" + "eslint": "^6.8.0" } }, "rimraf": { @@ -1658,27 +1663,21 @@ } }, "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", + "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", "dev": true, "requires": { "is-promise": "^2.1.0" } }, - "rx-lite": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", - "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", - "dev": true - }, - "rx-lite-aggregates": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", - "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "rxjs": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", + "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", "dev": true, "requires": { - "rx-lite": "*" + "tslib": "^1.9.0" } }, "safe-buffer": { @@ -1763,12 +1762,31 @@ } }, "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } } }, "sprintf-js": { @@ -1783,13 +1801,31 @@ "integrity": "sha1-0ZLJ/06moiyUxN1FkXHj8AzqEoU=" }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } } }, "string_decoder": { @@ -1811,9 +1847,9 @@ } }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", "dev": true }, "supports-color": { @@ -1826,17 +1862,55 @@ } }, "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { - "ajv": "^5.2.3", - "ajv-keywords": "^2.1.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "text-table": { @@ -1931,6 +2005,12 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, "typed-rest-client": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.2.0.tgz", @@ -1941,12 +2021,6 @@ "underscore": "1.8.3" } }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, "typescript": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", @@ -1965,6 +2039,15 @@ "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", "dev": true }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "url-join": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz", @@ -1977,6 +2060,12 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true + }, "vsce": { "version": "1.74.0", "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.74.0.tgz", @@ -2091,10 +2180,10 @@ "isexe": "^2.0.0" } }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, "wrappy": { @@ -2104,9 +2193,9 @@ "dev": true }, "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, "requires": { "mkdirp": "^0.5.1" @@ -2118,12 +2207,6 @@ "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", "dev": true }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, "yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", diff --git a/package.json b/package.json index a6f6dce8c1..e6c718b499 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "mocha-junit-reporter": "~1.23.3", "mocha-multi-reporters": "~1.1.7", "mock-fs": "~4.11.0", - "rewire": "~4.0.1", + "rewire": "~5.0.0", "sinon": "~9.0.1", "tslint": "~6.0.0", "typescript": "~3.5.3", From 39c0fe6ff075ab3ec5fd87469ff44718d6f1636d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2020 09:49:01 -0700 Subject: [PATCH 105/166] Bump tslint from 6.0.0 to 6.1.0 (#2561) Bumps [tslint](https://github.com/palantir/tslint) from 6.0.0 to 6.1.0. - [Release notes](https://github.com/palantir/tslint/releases) - [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/palantir/tslint/compare/6.0.0...6.1.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18468dea74..677c26ca0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1604,9 +1604,9 @@ "dev": true }, "resolve": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.0.tgz", - "integrity": "sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==", + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", + "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -1935,15 +1935,15 @@ } }, "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", "dev": true }, "tslint": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.0.0.tgz", - "integrity": "sha512-9nLya8GBtlFmmFMW7oXXwoXS1NkrccqTqAtwXzdPV9e2mqSEvCki6iHL/Fbzi5oqbugshzgGPk7KBb2qNP1DSA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.0.tgz", + "integrity": "sha512-fXjYd/61vU6da04E505OZQGb2VCN2Mq3doeWcOIryuG+eqdmFUXTYVwdhnbEu2k46LNLgUYt9bI5icQze/j0bQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", diff --git a/package.json b/package.json index e6c718b499..f7668393f8 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "mock-fs": "~4.11.0", "rewire": "~5.0.0", "sinon": "~9.0.1", - "tslint": "~6.0.0", + "tslint": "~6.1.0", "typescript": "~3.5.3", "vsce": "~1.74.0", "vscode-test": "~1.3.0" From d95496fb92637173c5d0e965c372452691fd4dd9 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 26 Mar 2020 09:31:06 -0700 Subject: [PATCH 106/166] [Ignore] Update troubleshooting.md (#2586) --- docs/troubleshooting.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 45a305e8b8..0d0fb5f853 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -173,6 +173,8 @@ Logs provide context for what was happening when the issue occurred. (Ctrl+Shift+P) with `PowerShell: Open PowerShell Extension Logs Folder`. +> NOTE: Don't forget to also attach the [Language Server Protocol payload logs](#provide-language-server-protocol-payload-logs)! + - You can attach your logs to an issue by zipping them and drag/dropping them onto your open issue description in the browser. @@ -182,9 +184,6 @@ Logs provide context for what was happening when the issue occurred. #### Provide Language Server Protocol payload logs -> NOTE: This currently only applies to the PowerShell Preview extension and only if you have version -> 2019.11.0 or higher. - The PowerShell extension works mostly from sending and receiving messages from [PowerShell Editor Services](httos://github.com/PowerShell/PowerShellEditorServices). In some cases, getting to the bottom of a bug will require looking at the payloads of these messages. To do this: From bd2c36a9fbc5bffdd85bd469ac9175774054567b Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 26 Mar 2020 13:05:26 -0700 Subject: [PATCH 107/166] Update version to v2020.3.1-preview and update changelog (#2588) --- CHANGELOG.md | 14 +++++++++++++- package.json | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce1283dc50..8e7bd06d99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,24 @@ # PowerShell Preview Extension Release History +## v2020.3.1-preview +### Thursday, March 26, 2020 +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛🧠 [vscode-powershell #2584](https://github.com/PowerShell/PowerShellEditorServices/pull/1243) - + Refactor GetCommandSynopsisAsync method to make sure cmdlets with module prefixes work. +- 🐛⚡️🧠📚 [vscode-powershell #2556](https://github.com/PowerShell/PowerShellEditorServices/pull/1238) - + Add cancellation for `textDocument/completion`, `textDocument/codeAction`, `textDocument/folding`. +- ✨👮 [vscode-powershell #2572](https://github.com/PowerShell/PowerShellEditorServices/pull/1241) - + Only run diagnostics on PowerShell files. +- ⚡️🧠 [PowerShellEditorServices #1237](https://github.com/PowerShell/PowerShellEditorServices/pull/1237) - + Optimize when we run GetCommandInfoAsync to use the pipeline less for Intellisense. + ## v2020.3.0-preview ### Thursday, March 12, 2020 #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - 🐛👷‍♀️ [vscode-powershell #2533](https://github.com/PowerShell/vscode-powershell/pull/2533) - Change source repository's recommended extension from ms-vscode.csharp to ms-dotnettools.csharp. (Thanks @devlead!) - - ✨🐢 [vscode-powershell #2441](https://github.com/PowerShell/vscode-powershell/pull/2441) - Run a single Pester test. (Thanks @nohwnd!) - 🐛🔧 [vscode-powershell #2524](https://github.com/PowerShell/vscode-powershell/pull/2524) - diff --git a/package.json b/package.json index f7668393f8..b8ae40b9c8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2020.3.0", + "version": "2020.3.1", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From b856a072df26c9f6e080a90501f880b5c5aa2fa9 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 31 Mar 2020 16:23:57 -0700 Subject: [PATCH 108/166] Rev version to v2020.3.2 update CHANGELOG (#2597) * Rev version to v2020.3.2 and update CHANGELOG * actually rev version --- CHANGELOG.md | 9 +++++++++ package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e7bd06d99..02ba209df3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # PowerShell Preview Extension Release History +## v2020.3.2-preview +### Tuesday, March 31, 2020 +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- ✨📟 [PowerShellEditorServices #1245](https://github.com/PowerShell/PowerShellEditorServices/pull/1245) - + Better PSReadLine version filter check to include 2.1.0+ prereleases. +- 🐛⚡️🧠🔗 [PowerShellEditorServices #1248](https://github.com/PowerShell/PowerShellEditorServices/pull/1248) - + Fix cancellation for completions and add `textDocument/hover` cancellation support. + ## v2020.3.1-preview ### Thursday, March 26, 2020 #### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) diff --git a/package.json b/package.json index b8ae40b9c8..af18bc8a8f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2020.3.1", + "version": "2020.3.2", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From cc33e821d49bbebb364c88af7b9c911ea5a9a674 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 2 Apr 2020 13:08:00 -0700 Subject: [PATCH 109/166] Ability to specify PSES branch and fork in CI build (#2604) * Specify PSES Branch * added fork info * add log * typo Co-authored-by: Robert Holt --- .vsts-ci/templates/ci-general.yml | 8 +++++++- tools/releaseBuild/setVstsVariables.ps1 | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index d37ef417c5..df1616c08d 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -3,8 +3,14 @@ steps: - pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" displayName: Set Build Name for Non-PR condition: ne(variables['Build.Reason'], 'PullRequest') + - task: PowerShell@2 + displayName: 'Set environment variables for VSTS (Phase 1)' + inputs: + targetType: filePath + filePath: ./tools/releaseBuild/setVstsVariables.ps1 - pwsh: | - git clone https://github.com/PowerShell/PowerShellEditorServices.git ../PowerShellEditorServices + Write-Host "Cloning '$env:PSES_BRANCH' branch from '$env:PSES_FORK/PowerShellEditorServices'" + git clone --single-branch --branch $env:PSES_BRANCH https://github.com/$env:PSES_FORK/PowerShellEditorServices.git ../PowerShellEditorServices Install-Module InvokeBuild -Scope CurrentUser -Force Install-Module PlatyPS -Scope CurrentUser -Force # Build diff --git a/tools/releaseBuild/setVstsVariables.ps1 b/tools/releaseBuild/setVstsVariables.ps1 index dc42416c73..ace8d35f0b 100644 --- a/tools/releaseBuild/setVstsVariables.ps1 +++ b/tools/releaseBuild/setVstsVariables.ps1 @@ -1,5 +1,6 @@ $vstsVariables = @{ PSES_BRANCH = 'master' + PSES_FORK = 'PowerShell' } # Use VSTS's API to set an env vars From 01ac85765b89468d3d7d33d2748ffc53267c601a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Tue, 7 Apr 2020 16:14:11 +0200 Subject: [PATCH 110/166] Fix Pester code lense (#2606) * Fix renamed setting * Fall through when legacy option is disablebd but Pester 5 is not found --- InvokePesterStub.ps1 | 19 ++++++++++++------- package.json | 4 ++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/InvokePesterStub.ps1 b/InvokePesterStub.ps1 index d9aa31a132..cdb6cb1216 100755 --- a/InvokePesterStub.ps1 +++ b/InvokePesterStub.ps1 @@ -59,15 +59,20 @@ param( $pesterModule = Microsoft.PowerShell.Core\Get-Module Pester # add one line, so the subsequent output is not shifted to the side Write-Output '' + if (!$pesterModule) { Write-Output "Importing Pester module..." - $minimumVersion = if ($MinimumVersion5) { "5.0.0" } else { "0.0.0" } - $versionMessage = " version $minimumVersion" - $pesterModule = Microsoft.PowerShell.Core\Import-Module Pester -ErrorAction Ignore -PassThru -MinimumVersion $minimumVersion + if ($MinimumVersion5) { + $pesterModule = Microsoft.PowerShell.Core\Import-Module Pester -ErrorAction Ignore -PassThru -MinimumVersion 5.0.0 + } + + if (!$pesterModule) { + $pesterModule = Microsoft.PowerShell.Core\Import-Module Pester -ErrorAction Ignore -PassThru + } + if (!$pesterModule) { - # If we still don't have an imported Pester module, that is (most likely) because Pester is not installed. - Write-Warning "Failed to import Pester$(if ($MinimumVersion5){ $versionMessage }). You must install Pester module to run or debug Pester tests." - Write-Warning "You can install Pester by executing: Install-Module Pester $(if ($MinimumVersion5) {"-MinimumVersion 5.0.0" }) -Scope CurrentUser -Force" + Write-Warning "Failed to import Pester. You must install Pester module to run or debug Pester tests." + Write-Warning "$(if ($MinimumVersion5) {"Recommended version to install is Pester 5.0.0 or newer. "})You can install Pester by executing: Install-Module Pester$(if ($MinimumVersion5) {" -MinimumVersion 5.0.0" }) -Scope CurrentUser -Force" return } } @@ -79,7 +84,7 @@ $pester4Output = switch ($Output) { } if ($MinimumVersion5 -and $pesterModule.Version -lt "5.0.0") { - Write-Warning "Pester 5.0.0 or newer is required because setting PowerShell > Pester: Enable Legacy Code Lens is disabled, but Pester $($pesterModule.Version) is loaded. Some of the code lense features might not work as expected." + Write-Warning "Pester 5.0.0 or newer is required because setting PowerShell > Pester: Use Legacy Code Lens is disabled, but Pester $($pesterModule.Version) is loaded. Some of the code lense features might not work as expected." } diff --git a/package.json b/package.json index af18bc8a8f..56535d3417 100644 --- a/package.json +++ b/package.json @@ -761,10 +761,10 @@ "default": null, "description": "An array of strings that enable experimental features in the PowerShell extension." }, - "powershell.pester.enableLegacyCodeLens": { + "powershell.pester.useLegacyCodeLens": { "type": "boolean", "default": true, - "description": "Enable code lense that is compatible with Pester 4. Disabling this will show 'Run Tests' on all It, Describe and Context blocks, and will correctly work only with Pester 5 and newer." + "description": "Use code lense that is compatible with Pester 4. Disabling this will show 'Run Tests' on all It, Describe and Context blocks, and will correctly work only with Pester 5 and newer." }, "powershell.pester.outputVerbosity": { "type": "string", From b7e723bbffae21d90eaff47f543ea9f8ce597498 Mon Sep 17 00:00:00 2001 From: Frederik Hjorslev Date: Wed, 8 Apr 2020 22:05:02 +0200 Subject: [PATCH 111/166] Fix link in TOC: link to 'Exchange Online Connection' returns 404 (#2618) --- docs/community_snippets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/community_snippets.md b/docs/community_snippets.md index 4238659367..7d8816d09b 100644 --- a/docs/community_snippets.md +++ b/docs/community_snippets.md @@ -23,7 +23,7 @@ _To contribute, check out our [guide here](#contributing)._ | [DataTable](#datatable) | _Creates a DataTable_ | | [DateTimeWriteVerbose](#datetimewriteverbose) | _Write-Verbose with the time and date pre-pended to your message by @ThmsRynr_ | | [Error-Terminating](#error-terminating) | _Create a full terminating error by @omniomi_ | -| [Exchange Online Connection](exchange-online-connection) | _Create a connection to Exchange Online by @vmsilvamolina_ | +| [Exchange Online Connection](#exchange-online-connection) | _Create a connection to Exchange Online by @vmsilvamolina_ | | [HTML header](#html-header) | _Add HTML header with the style tag by @vmsilvamolina_ | | [MaxColumnLengthinDataTable](#maxcolumnlengthindatatable) | _Gets the max length of string columns in datatables_ | | [New Azure Resource Group](#new-azure-resource-group) | _Create an Azure Resource group by @vmsilvamolina_ | From cb82e76aa6bcaf60cbfc8c06e0aff8375ca14f10 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 8 Apr 2020 13:05:18 -0700 Subject: [PATCH 112/166] Use PowerShell Daily in CI (#2617) --- .vsts-ci/templates/ci-general.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index df1616c08d..c3b24a7397 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -1,5 +1,19 @@ steps: # Setup + - powershell: | + Write-Host "Installing PowerShell Daily..." + + # Use `AGENT_TEMPDIRECTORY` to make sure the downloaded PowerShell is cleaned up. + $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' + Invoke-WebRequest -Uri https://aka.ms/install-powershell.ps1 -OutFile ./install-powershell.ps1 + + ./install-powershell.ps1 -Destination $powerShellPath -Daily + + # Using `prependpath` to update the PATH just for this build. + Write-Host "##vso[task.prependpath]$powerShellPath" + displayName: Install PowerShell Daily + - pwsh: '$PSVersionTable' + displayName: Display PowerShell version information - pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" displayName: Set Build Name for Non-PR condition: ne(variables['Build.Reason'], 'PullRequest') From fe984b626995aea8d69c98f39c33d3271dfff59a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2020 13:14:58 -0700 Subject: [PATCH 113/166] Bump @types/sinon from 7.5.2 to 9.0.0 (#2612) Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 7.5.2 to 9.0.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 17 +++++++++++++---- package.json | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 677c26ca0e..fb0044d160 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "powershell-preview", - "version": "2020.3.0", + "version": "2020.3.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -153,9 +153,18 @@ } }, "@types/sinon": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.2.tgz", - "integrity": "sha512-T+m89VdXj/eidZyejvmoP9jivXgBDdkOSBVQjU9kF349NEx10QdPNGxHeZUaj1IlJ32/ewdyXJjnJxyxJroYwg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-9.0.0.tgz", + "integrity": "sha512-v2TkYHkts4VXshMkcmot/H+ERZ2SevKa10saGaJPGCJ8vh3lKrC4u663zYEeRZxep+VbG6YRDtQ6gVqw9dYzPA==", + "dev": true, + "requires": { + "@types/sinonjs__fake-timers": "*" + } + }, + "@types/sinonjs__fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.1.tgz", + "integrity": "sha512-yYezQwGWty8ziyYLdZjwxyMb0CZR49h8JALHGrxjQHWlqGgc8kLdHEgWrgL0uZ29DMvEVBDnHU2Wg36zKSIUtA==", "dev": true }, "@types/vscode": { diff --git a/package.json b/package.json index 56535d3417..c032fb263e 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@types/node-fetch": "~2.5.5", "@types/rewire": "~2.5.28", "@types/semver": "~7.1.0", - "@types/sinon": "~7.5.2", + "@types/sinon": "~9.0.0", "@types/vscode": "1.40.0", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.3", From 2f0524008d053b2e6587987f62a5b5bc88a28ed7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2020 13:15:23 -0700 Subject: [PATCH 114/166] Bump vsce from 1.74.0 to 1.75.0 (#2611) Bumps [vsce](https://github.com/Microsoft/vsce) from 1.74.0 to 1.75.0. - [Release notes](https://github.com/Microsoft/vsce/releases) - [Commits](https://github.com/Microsoft/vsce/compare/v1.74.0...v1.75.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 82 +++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 45 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb0044d160..44eac4bdc7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -587,12 +587,6 @@ "resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.3.2.tgz", "integrity": "sha512-2hBlg1BtBT+nd04MGGGZinDv5gOTRQOCzdgk+KRQZ20XJ/uepC0B0rwWLQtz6Tk6InXymWqsk1sMC975cPEReA==" }, - "didyoumean": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.1.tgz", - "integrity": "sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=", - "dev": true - }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -997,19 +991,6 @@ "entities": "^1.1.1", "inherits": "^2.0.1", "readable-stream": "^3.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } } }, "http-proxy-agent": { @@ -1221,6 +1202,12 @@ "integrity": "sha512-ApcjaOdVTJ7y4r08xI5wIqpvwS48Q0PBG4DJROcEkH1f8MdAiNFyFxz3xoL0LWAVwjrwPYZdVHHxhRHcx/uGLA==", "dev": true }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -1253,16 +1240,24 @@ "dev": true }, "markdown-it": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", - "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", + "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", "dev": true, "requires": { "argparse": "^1.0.7", - "entities": "~1.1.1", + "entities": "~2.0.0", "linkify-it": "^2.0.0", "mdurl": "^1.0.1", "uc.micro": "^1.0.5" + }, + "dependencies": { + "entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", + "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==", + "dev": true + } } }, "md5": { @@ -1399,9 +1394,9 @@ "dev": true }, "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, "natural-compare": { @@ -1606,6 +1601,17 @@ "mute-stream": "~0.0.4" } }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", @@ -1690,9 +1696,9 @@ } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", "dev": true }, "safer-buffer": { @@ -1838,12 +1844,12 @@ } }, "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" } }, "strip-ansi": { @@ -2076,9 +2082,9 @@ "dev": true }, "vsce": { - "version": "1.74.0", - "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.74.0.tgz", - "integrity": "sha512-8zWM9bZBNn9my40kkxAxdY4nhb9ADfazXsyDgx1thbRaLPbmPTlmqQ55vCAyWYFEi6XbJv8w599vzVUqsU1gHg==", + "version": "1.75.0", + "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.75.0.tgz", + "integrity": "sha512-qyAQTmolxKWc9bV1z0yBTSH4WEIWhDueBJMKB0GUFD6lM4MiaU1zJ9BtzekUORZu094YeNSKz0RmVVuxfqPq0g==", "dev": true, "requires": { "azure-devops-node-api": "^7.2.0", @@ -2086,10 +2092,10 @@ "cheerio": "^1.0.0-rc.1", "commander": "^2.8.1", "denodeify": "^1.2.1", - "didyoumean": "^1.2.1", "glob": "^7.0.6", + "leven": "^3.1.0", "lodash": "^4.17.15", - "markdown-it": "^8.3.1", + "markdown-it": "^10.0.0", "mime": "^1.3.4", "minimatch": "^3.0.3", "osenv": "^0.1.3", diff --git a/package.json b/package.json index c032fb263e..50bdc7129e 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "sinon": "~9.0.1", "tslint": "~6.1.0", "typescript": "~3.5.3", - "vsce": "~1.74.0", + "vsce": "~1.75.0", "vscode-test": "~1.3.0" }, "extensionDependencies": [ From 5112e09f73d8ec95b6fda580bdb9b764efc6dfe2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2020 13:21:29 -0700 Subject: [PATCH 115/166] Bump tslint from 6.1.0 to 6.1.1 (#2613) Bumps [tslint](https://github.com/palantir/tslint) from 6.1.0 to 6.1.1. - [Release notes](https://github.com/palantir/tslint/releases) - [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/palantir/tslint/compare/6.1.0...6.1.1) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 23 +++++++++++++++++++---- package.json | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 44eac4bdc7..f996698f9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1956,9 +1956,9 @@ "dev": true }, "tslint": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.0.tgz", - "integrity": "sha512-fXjYd/61vU6da04E505OZQGb2VCN2Mq3doeWcOIryuG+eqdmFUXTYVwdhnbEu2k46LNLgUYt9bI5icQze/j0bQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.1.tgz", + "integrity": "sha512-kd6AQ/IgPRpLn6g5TozqzPdGNZ0q0jtXW4//hRcj10qLYBaa3mTUU2y2MCG+RXZm8Zx+KZi0eA+YCrMyNlF4UA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -1969,7 +1969,7 @@ "glob": "^7.1.1", "js-yaml": "^3.13.1", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", + "mkdirp": "^0.5.3", "resolve": "^1.3.2", "semver": "^5.3.0", "tslib": "^1.10.0", @@ -1982,6 +1982,21 @@ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", diff --git a/package.json b/package.json index 50bdc7129e..7b3ab67700 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "mock-fs": "~4.11.0", "rewire": "~5.0.0", "sinon": "~9.0.1", - "tslint": "~6.1.0", + "tslint": "~6.1.1", "typescript": "~3.5.3", "vsce": "~1.75.0", "vscode-test": "~1.3.0" From a3f959a8a0650ca5105c8810953eb541b5156227 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 8 Apr 2020 13:56:04 -0700 Subject: [PATCH 116/166] Rev version to v2020.4.0-preview and update CL (#2621) --- CHANGELOG.md | 18 ++++++++++++++++++ package.json | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02ba209df3..67a0e53602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # PowerShell Preview Extension Release History +## v2020.4.0-preview +### Wednesday, April 08, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- ✨👷 [vscode-powershell #2617](https://github.com/PowerShell/vscode-powershell/pull/2617) - + Use PowerShell Daily in CI. +- 🐛📖 [vscode-powershell #2618](https://github.com/PowerShell/vscode-powershell/pull/2618) - + Fix link to 'Exchange Online Connection' in community snippets ToC. (Thanks @hjorslev!) +- 🐛🐢 [vscode-powershell #2606](https://github.com/PowerShell/vscode-powershell/pull/2606) - + Fix Pester CodeLens setting which allows Pester v4 scripts to work again. (Thanks @nohwnd!) + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- ✨👷 [PowerShellEditorServices #1252](https://github.com/PowerShell/PowerShellEditorServices/pull/1252) - + Use PowerShell Daily in CI. +- 🐛⚡️🧠🔗 [PowerShellEditorServices #1251](https://github.com/PowerShell/PowerShellEditorServices/pull/1251) - + Add cancellation to SignatureHelp request and cache results for cmdlets on `Get-Command` and `Get-Help`. + ## v2020.3.2-preview ### Tuesday, March 31, 2020 #### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) diff --git a/package.json b/package.json index 7b3ab67700..f8e01b92a7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2020.3.2", + "version": "2020.4.0", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From 0764663b2149e3bded21901807263304b9030601 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 9 Apr 2020 16:25:28 -0700 Subject: [PATCH 117/166] Rev version to v2020.4.1 and update CHANGELOG (#2625) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67a0e53602..2531b52f2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # PowerShell Preview Extension Release History +## v2020.4.1-preview +### Wednesday, April 09, 2020 +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- ✨📟 [PowerShellEditorServices #1255](https://github.com/PowerShell/PowerShellEditorServices/pull/1255) - + Move PSReadLine invocation into cmdlets to get closer to supporting ConstrainedLanguage mode. Also removes hard coded PSReadLine assembly version. + ## v2020.4.0-preview ### Wednesday, April 08, 2020 #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) diff --git a/package.json b/package.json index f8e01b92a7..b2091e63fc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2020.4.0", + "version": "2020.4.1", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From fa6e23ada8c67d77ffcbfa0d8dcb37033c39474d Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 13 Apr 2020 12:06:29 -0700 Subject: [PATCH 118/166] Rev version to v2020.4.2-preview and update CHANGELOG (#2630) --- CHANGELOG.md | 7 +++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2531b52f2e..af08563344 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # PowerShell Preview Extension Release History +## v2020.4.2-preview +### Monday, April 13, 2020 +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛📟 [PowerShellEditorServices #1258](https://github.com/PowerShell/PowerShellEditorServices/pull/1258) - + No more warning about PowerShellEditorServices module being imported with unapproved verb. + ## v2020.4.1-preview ### Wednesday, April 09, 2020 #### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) diff --git a/package-lock.json b/package-lock.json index f996698f9d..68815aec90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "powershell-preview", - "version": "2020.3.2", + "version": "2020.4.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b2091e63fc..832ebcab69 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2020.4.1", + "version": "2020.4.2", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From 321a8cf8b26d3200d0f4d8993d8122a0ceb36f53 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 14 Apr 2020 14:13:33 -0700 Subject: [PATCH 119/166] [ignore] try adding config file for other issue templates --- .github/ISSUE_TEMPLATE/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..61eb5ad720 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Editor Syntax Colorization bug report 🌈 + url: https://github.com/PowerShell/EditorSyntax/issues/new + about: Editor syntax colorization bugs are tracked in a separate GitHub repo. + - name: Script analysis or formatting bug report 🚦🖌️ + url: https://github.com/PowerShell/PSScriptAnalyzer/issues/new/choose + about: Script analysis and formatting are provided by PSScriptAnalyzer. Before submitting an issue, check to see whether the issue lies with PSScriptAnalyzer or with the VSCode PowerShell extension. From 84ab63880d90ff6a951e22d314d8e226b8fd6076 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 14 Apr 2020 14:14:15 -0700 Subject: [PATCH 120/166] [ignore] remote this because we link to PSSA --- .../Bug_Report_PSScriptAnalyzer.md | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/Bug_Report_PSScriptAnalyzer.md diff --git a/.github/ISSUE_TEMPLATE/Bug_Report_PSScriptAnalyzer.md b/.github/ISSUE_TEMPLATE/Bug_Report_PSScriptAnalyzer.md deleted file mode 100644 index 9e9979da97..0000000000 --- a/.github/ISSUE_TEMPLATE/Bug_Report_PSScriptAnalyzer.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Script analysis or formatting bug report 🚦🖌️ -about: Script analysis and formatting are provided by PSScriptAnalyzer. Before submitting a script analysis or formatting issue, check to see whether the issue lies with PSScriptAnalyzer or with the VSCode PowerShell extension. - ---- - - From 53086772d5ec3bc6b8a93b53739df2937226022f Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 14 Apr 2020 14:14:30 -0700 Subject: [PATCH 121/166] [ignore] remote this because we link to EditorSyntax --- .github/ISSUE_TEMPLATE/Bug_Report_Syntax_Colorization.md | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/Bug_Report_Syntax_Colorization.md diff --git a/.github/ISSUE_TEMPLATE/Bug_Report_Syntax_Colorization.md b/.github/ISSUE_TEMPLATE/Bug_Report_Syntax_Colorization.md deleted file mode 100644 index aecbb51dc7..0000000000 --- a/.github/ISSUE_TEMPLATE/Bug_Report_Syntax_Colorization.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: Editor Syntax Colorization bug report 🌈 -about: Editor syntax colorization bugs are tracked in a separate GitHub repo. - ---- - -* Please submit editor syntax colorization issues with PowerShell scripts - to the [EditorSyntax](https://github.com/powershell/editorSyntax/issues) repo on GitHub. From d5d1602dcd608fef3886146829ef03ebd6c484e8 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 14 Apr 2020 14:32:18 -0700 Subject: [PATCH 122/166] [Ignore] add general questions --- .github/ISSUE_TEMPLATE/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 61eb5ad720..5acadf6e2c 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -6,3 +6,6 @@ contact_links: - name: Script analysis or formatting bug report 🚦🖌️ url: https://github.com/PowerShell/PSScriptAnalyzer/issues/new/choose about: Script analysis and formatting are provided by PSScriptAnalyzer. Before submitting an issue, check to see whether the issue lies with PSScriptAnalyzer or with the VSCode PowerShell extension. + - name: General question? + url: https://aka.ms/psdiscord + about: "You can also ask general Visual Studio Code questions in the #vscode channel of the PowerShell community Discord. Slack is also available at https://aka.ms/psslack" From cf2d9feebceab1d1a074aa101dd3d9e6c148325a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2020 09:34:28 -0700 Subject: [PATCH 123/166] Bump sinon from 9.0.1 to 9.0.2 (#2633) Bumps [sinon](https://github.com/sinonjs/sinon) from 9.0.1 to 9.0.2. - [Release notes](https://github.com/sinonjs/sinon/releases) - [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md) - [Commits](https://github.com/sinonjs/sinon/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 36 +++++++++++++++++------------------- package.json | 2 +- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 68815aec90..2950d6ef6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,18 +33,18 @@ } }, "@sinonjs/commons": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.1.tgz", - "integrity": "sha512-Debi3Baff1Qu1Unc3mjJ96MgpbwTn43S1+9yJ0llWygPwDNu2aaWBD6yc9y/Z8XDRNhx7U+u2UDg2OGQXkclUQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.2.tgz", + "integrity": "sha512-+DUO6pnp3udV/v2VfUWgaY5BIE1IfT7lLfeDzPVeMT1XKkaAp9LgSI9x5RtrFQoZ9Oi0PgXQQHPaoKu7dCjVxw==", "dev": true, "requires": { "type-detect": "4.0.8" } }, "@sinonjs/fake-timers": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.0.tgz", - "integrity": "sha512-atR1J/jRXvQAb47gfzSK8zavXy7BcpnYq21ALon0U99etu99vsir0trzIO3wpeLtW+LLVY6X7EkfVTbjGSH8Ww==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", + "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", "dev": true, "requires": { "@sinonjs/commons": "^1.7.0" @@ -1168,6 +1168,12 @@ "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1558,14 +1564,6 @@ "dev": true, "requires": { "isarray": "0.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - } } }, "pend": { @@ -1739,13 +1737,13 @@ "dev": true }, "sinon": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.1.tgz", - "integrity": "sha512-iTTyiQo5T94jrOx7X7QLBZyucUJ2WvL9J13+96HMfm2CGoJYbIPqRfl6wgNcqmzk0DI28jeGx5bUTXizkrqBmg==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.2.tgz", + "integrity": "sha512-0uF8Q/QHkizNUmbK3LRFqx5cpTttEVXudywY9Uwzy8bTfZUhljZ7ARzSxnRHWYWtVTeh4Cw+tTb3iU21FQVO9A==", "dev": true, "requires": { - "@sinonjs/commons": "^1.7.0", - "@sinonjs/fake-timers": "^6.0.0", + "@sinonjs/commons": "^1.7.2", + "@sinonjs/fake-timers": "^6.0.1", "@sinonjs/formatio": "^5.0.1", "@sinonjs/samsam": "^5.0.3", "diff": "^4.0.2", diff --git a/package.json b/package.json index 832ebcab69..11b4bb74f7 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "mocha-multi-reporters": "~1.1.7", "mock-fs": "~4.11.0", "rewire": "~5.0.0", - "sinon": "~9.0.1", + "sinon": "~9.0.2", "tslint": "~6.1.1", "typescript": "~3.5.3", "vsce": "~1.75.0", From c5195c80274d4ff0933ab51d60e82319ad90d89e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2020 09:34:35 -0700 Subject: [PATCH 124/166] Bump semver from 7.1.3 to 7.2.3 (#2632) Bumps [semver](https://github.com/npm/node-semver) from 7.1.3 to 7.2.3. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/master/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v7.1.3...v7.2.3) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2950d6ef6a..58a1cd2ba6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1706,9 +1706,9 @@ "dev": true }, "semver": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.3.tgz", - "integrity": "sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA==" + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.2.3.tgz", + "integrity": "sha512-utbW9Z7ZxVvwiIWkdOMLOR9G/NFXh2aRucghkVrEMJWuC++r3lCkBC3LwqBinyHzGMAJxY5tn6VakZGHObq5ig==" }, "shebang-command": { "version": "1.2.0", diff --git a/package.json b/package.json index 11b4bb74f7..b38ad7a612 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ ], "dependencies": { "node-fetch": "^2.6.0", - "semver": "^7.1.3", + "semver": "^7.2.3", "vscode-extension-telemetry": "~0.1.2", "vscode-languageclient": "~5.2.1" }, From aee7746b561ab4b55d29aa58f839c400f39fa394 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2020 09:34:41 -0700 Subject: [PATCH 125/166] Bump @types/node-fetch from 2.5.5 to 2.5.6 (#2631) Bumps [@types/node-fetch](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node-fetch) from 2.5.5 to 2.5.6. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node-fetch) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 58a1cd2ba6..0b2e4ac05b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -128,9 +128,9 @@ "dev": true }, "@types/node-fetch": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.5.tgz", - "integrity": "sha512-IWwjsyYjGw+em3xTvWVQi5MgYKbRs0du57klfTaZkv/B24AEQ/p/IopNeqIYNy3EsfHOpg8ieQSDomPcsYMHpA==", + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.6.tgz", + "integrity": "sha512-2w0NTwMWF1d3NJMK0Uiq2UNN8htVCyOWOD0jIPjPgC5Ph/YP4dVhs9YxxcMcuLuwAslz0dVEcZQUaqkLs3IzOQ==", "dev": true, "requires": { "@types/node": "*", diff --git a/package.json b/package.json index b38ad7a612..0d5ed91185 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@types/mocha": "~7.0.2", "@types/mock-fs": "~4.10.0", "@types/node": "~10.11.0", - "@types/node-fetch": "~2.5.5", + "@types/node-fetch": "~2.5.6", "@types/rewire": "~2.5.28", "@types/semver": "~7.1.0", "@types/sinon": "~9.0.0", From 26d3821a5a0f60afa3eaddcd7b4290d02108bb0e Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 15 Apr 2020 16:04:05 -0700 Subject: [PATCH 126/166] [Ignore] rev version to v2020.4.3-preview and Update CL (#2635) --- CHANGELOG.md | 45 ++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af08563344..9cadaf4b6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,12 @@ -# PowerShell Preview Extension Release History +# PowerShell Extension Release History + +## v2020.4.0 +### Thursday, April 15, 2020 + +- ⚡️🧠 Better performance of overall but especially IntelliSense. +- 🐛📟 Errors show up properly on screen in PowerShell Integrated Console. +- ✨🐢 Run a single test in Pester v5 by setting `"powershell.pester.useLegacyCodeLens": false`. +- 🐛🔧 Ignore files specified in `files.exclude` and `search.exclude` in reference/CodeLens search. ## v2020.4.2-preview ### Monday, April 13, 2020 @@ -96,6 +104,41 @@ ## v2020.3.0 ### Thursday, March 12, 2020 + +#### Release of preview work to stable branch + +This release, coinciding with the [GA release of PowerShell 7](https://devblogs.microsoft.com/powershell/announcing-PowerShell-7-0/), +brings a year of work on the PowerShell extension into the stable release. +The timing of this release is deliberate, since some of the new features +depend on additions and bugfixes in PowerShell 7, +while others have a much better experience in PowerShell 7 +thanks to many improvements shipping with it. + +Some changes that come to the stable channel in this release include: + +- [Integration of PSReadLine into the Integrated Console](https://github.com/PowerShell/vscode-PowerShell/issues/535), + enabling syntax highlighting, a better (and more configurable) completion experience, + multiline editing and searchable history in the PowerShell Integrated Console +- Performance and reliability improvements gained + by [replacing](https://github.com/PowerShell/PowerShellEditorServices/pull/1056) + a hand-rolled Language Server Protocol stack + with the LSP server library from the Omnisharp project +- An [ISE compatibility mode](https://github.com/PowerShell/vscode-powershell/pull/2335) + setting to toggle a more ISE-like user experience +- Debugging improvements in PowerShell 7, + [using its new debugging APIs](https://github.com/PowerShell/PowerShellEditorServices/pull/1119) +- [End of support for PowerShell v3/v4 and .NET 4.5.2](https://github.com/PowerShell/vscode-PowerShell/issues/1310) + +After this release, the stable/preview channels will now function as originally intended, +where the preview channel will be the beta release +for features to come out in the following stable release. + +You may also notice that the history of the changelog has changed. +For a full list of changes between this release and the previous stable release, +see [here](https://github.com/PowerShell/vscode-powershell/blob/master/docs/preview_to_stable_changelog.md). +You can find the changelog from the old stable fork +[here](https://github.com/PowerShell/vscode-powershell/blob/legacy/1.x/CHANGELOG.md). + #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - ✨📺 [vscode-PowerShell #2503](https://github.com/PowerShell/vscode-powershell/pull/2503) - diff --git a/package.json b/package.json index 0d5ed91185..f428a91059 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2020.4.2", + "version": "2020.4.3", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From 13e5ea58584c6222ea67e17f21feea89165a94d6 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 20 Apr 2020 11:54:53 -0700 Subject: [PATCH 127/166] [Ignore] update other link in Install-VSCode script --- scripts/Install-VSCode.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Install-VSCode.ps1 b/scripts/Install-VSCode.ps1 index ac3759161a..cacb817cb8 100644 --- a/scripts/Install-VSCode.ps1 +++ b/scripts/Install-VSCode.ps1 @@ -57,7 +57,7 @@ Please contribute improvements to this script on GitHub! - https://github.com/PowerShell/vscode-powershell/blob/develop/scripts/Install-VSCode.ps1 + https://github.com/PowerShell/vscode-powershell/blob/master/scripts/Install-VSCode.ps1 .PARAMETER Architecture A validated string defining the bit version to download. Values can be either 64-bit or 32-bit. From c6ccc68f1b11739445a6e9eb6edde78e450eb459 Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Mon, 20 Apr 2020 13:46:29 -0600 Subject: [PATCH 128/166] Add workspace file to load both vscode-powershell and PSES (#2645) --- extension-dev.code-workspace | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 extension-dev.code-workspace diff --git a/extension-dev.code-workspace b/extension-dev.code-workspace new file mode 100644 index 0000000000..a43b119daa --- /dev/null +++ b/extension-dev.code-workspace @@ -0,0 +1,16 @@ +{ + "folders": [ + { + "path": "." + }, + { + "path": "..\\PowerShellEditorServices" + } + ], + "settings": { + "files.associations": { + "**/snippets/*.json": "jsonc" + }, + "typescript.tsdk": "./node_modules/typescript/lib" + } +} From 79d731334950d079b038c984a4ab4a9910d26feb Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Mon, 20 Apr 2020 16:41:26 -0600 Subject: [PATCH 129/166] Display preview state and version info in PSIC startup banner (#2644) * Display preview status and version info in the PSIC startup banner * Use the existing this.HostVersion for version info * Pass in displayName to SessionMgr, adjust banner whitespace * Add some leading whitespace to startup banner * Go with whitespace option #5 - less is more :-) --- src/main.ts | 1 + src/session.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 02a152f5ef..fc2272f16d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -136,6 +136,7 @@ export function activate(context: vscode.ExtensionContext): void { requiredEditorServicesVersion, logger, documentSelector, + PackageJSON.displayName, PackageJSON.version, telemetryReporter); diff --git a/src/session.ts b/src/session.ts index 9251d298f2..a65484ecc1 100644 --- a/src/session.ts +++ b/src/session.ts @@ -35,6 +35,7 @@ export enum SessionStatus { } export class SessionManager implements Middleware { + public HostName: string; public HostVersion: string; public PowerShellExeDetails: IPowerShellExeDetails; private ShowSessionMenuCommandName = "PowerShell.ShowSessionMenu"; @@ -68,11 +69,13 @@ export class SessionManager implements Middleware { private requiredEditorServicesVersion: string, private log: Logger, private documentSelector: DocumentSelector, + private hostName: string, private version: string, private reporter: TelemetryReporter) { this.platformDetails = getPlatformDetails(); + this.HostName = hostName; this.HostVersion = version; this.telemetryReporter = reporter; @@ -81,7 +84,7 @@ export class SessionManager implements Middleware { this.log.write( `Visual Studio Code v${vscode.version} ${procBitness}`, - `PowerShell Extension v${this.HostVersion}`, + `${this.HostName} Extension v${this.HostVersion}`, `Operating System: ${OperatingSystem[this.platformDetails.operatingSystem]} ${osBitness}`); // Fix the host version so that PowerShell can consume it. @@ -191,6 +194,10 @@ export class SessionManager implements Middleware { if (this.sessionSettings.integratedConsole.suppressStartupBanner) { this.editorServicesArgs += "-StartupBanner '' "; + } else { + const startupBanner = `=====> ${this.HostName} Integrated Console v${this.HostVersion} <===== +`; + this.editorServicesArgs += `-StartupBanner "${startupBanner}" `; } if (this.sessionSettings.developer.editorServicesWaitForDebugger) { From 7dadd34d1a4c68d83190eea37e3f24bd8b682ee5 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 22 Apr 2020 19:51:30 -0700 Subject: [PATCH 130/166] Clean up WaitForSessionFile logic and support increasing timeout with warning (#2653) * Add better sessionfile wait logic with setting * clean up logic * move into process.ts to use vscode api * use timeout seconds Co-authored-by: Tyler Leonhardt (POWERSHELL) --- package-lock.json | 2 +- package.json | 5 +++++ src/process.ts | 42 +++++++++++++++++++++++++++++++----------- src/settings.ts | 2 ++ src/utils.ts | 20 -------------------- 5 files changed, 39 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0b2e4ac05b..4d50a31ae2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "powershell-preview", - "version": "2020.4.2", + "version": "2020.4.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f428a91059..7b707cde72 100644 --- a/package.json +++ b/package.json @@ -761,6 +761,11 @@ "default": null, "description": "An array of strings that enable experimental features in the PowerShell extension." }, + "powershell.developer.waitForSessionFileTimeoutSeconds": { + "type": "number", + "default": 240, + "description": "When the PowerShell extension is starting up, it checks for a session file in order to connect to the language server. This setting determines how long until checking for the session file times out. (default is 240 seconds or 4 minutes)" + }, "powershell.pester.useLegacyCodeLens": { "type": "boolean", "default": true, diff --git a/src/process.ts b/src/process.ts index d77fe8b8b8..80b849ef48 100644 --- a/src/process.ts +++ b/src/process.ts @@ -17,6 +17,10 @@ export class PowerShellProcess { return pspath.replace(new RegExp("'", "g"), "''"); } + // This is used to warn the user that the extension is taking longer than expected to startup. + // After the 15th try we've hit 30 seconds and should warn. + private static warnUserThreshold = 15; + public onExited: vscode.Event; private onExitedEmitter = new vscode.EventEmitter(); @@ -174,20 +178,36 @@ export class PowerShellProcess { return true; } - private waitForSessionFile(): Promise { - return new Promise((resolve, reject) => { - utils.waitForSessionFile(this.sessionFilePath, (sessionDetails, error) => { - utils.deleteSessionFile(this.sessionFilePath); + private sleep(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); + } - if (error) { - this.log.write(`Error occurred retrieving session file:\n${error}`); - return reject(error); - } + private async waitForSessionFile(): Promise { + // Determine how many tries by dividing by 2000 thus checking every 2 seconds. + const numOfTries = this.sessionSettings.developer.waitForSessionFileTimeoutSeconds / 2; + const warnAt = numOfTries - PowerShellProcess.warnUserThreshold; + // Check every 2 seconds + for (let i = numOfTries; i > 0; i--) { + if (utils.checkIfFileExists(this.sessionFilePath)) { this.log.write("Session file found"); - resolve(sessionDetails); - }); - }); + const sessionDetails = utils.readSessionFile(this.sessionFilePath); + utils.deleteSessionFile(this.sessionFilePath); + return sessionDetails; + } + + if (warnAt === i) { + vscode.window.showWarningMessage(`Loading the PowerShell extension is taking longer than expected. + If you're using privilege enforcement software, this can affect start up performance.`); + } + + // Wait a bit and try again + await this.sleep(2000); + } + + const err = "Timed out waiting for session file to appear."; + this.log.write(err); + throw new Error(err); } private onTerminalClose(terminal: vscode.Terminal) { diff --git a/src/settings.ts b/src/settings.ts index 9c81b2cc27..267134f84f 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -72,6 +72,7 @@ export interface IDeveloperSettings { bundledModulesPath?: string; editorServicesLogLevel?: string; editorServicesWaitForDebugger?: boolean; + waitForSessionFileTimeoutSeconds?: number; } export interface ISettings { @@ -142,6 +143,7 @@ export function load(): ISettings { bundledModulesPath: "../../../PowerShellEditorServices/module", editorServicesLogLevel: "Normal", editorServicesWaitForDebugger: false, + waitForSessionFileTimeoutSeconds: 240, }; const defaultCodeFoldingSettings: ICodeFoldingSettings = { diff --git a/src/utils.ts b/src/utils.ts index 57527cf529..bf3c107a66 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -45,7 +45,6 @@ export interface IEditorServicesSessionDetails { } export type IReadSessionFileCallback = (details: IEditorServicesSessionDetails) => void; -export type IWaitForSessionFileCallback = (details: IEditorServicesSessionDetails, error: string) => void; const sessionsFolder = path.resolve(__dirname, "..", "..", "sessions/"); const sessionFilePathPrefix = path.resolve(sessionsFolder, "PSES-VSCode-" + process.env.VSCODE_PID); @@ -69,25 +68,6 @@ export function writeSessionFile(sessionFilePath: string, sessionDetails: IEdito writeStream.close(); } -export function waitForSessionFile(sessionFilePath: string, callback: IWaitForSessionFileCallback) { - - function innerTryFunc(remainingTries: number, delayMilliseconds: number) { - if (remainingTries === 0) { - callback(undefined, "Timed out waiting for session file to appear."); - } else if (!checkIfFileExists(sessionFilePath)) { - // Wait a bit and try again - setTimeout( - () => { innerTryFunc(remainingTries - 1, delayMilliseconds); }, - delayMilliseconds); - } else { - // Session file was found, load and return it - callback(readSessionFile(sessionFilePath), undefined); - } - } - - // Try once every 2 seconds, 60 times - making two full minutes - innerTryFunc(60, 2000); -} export function readSessionFile(sessionFilePath: string): IEditorServicesSessionDetails { const fileContents = fs.readFileSync(sessionFilePath, "utf-8"); From 5cb23faa86f4137ae86ab3111b85f5842a023b0d Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Mon, 27 Apr 2020 23:23:32 +0100 Subject: [PATCH 131/166] Remove broken 'Select PSScriptAnalyzer Rules' command (#2659) * Remove broken 'Select PSScriptAnalyzer Rules' command * remove code that backed the feature Co-authored-by: Christoph Bergmeister --- package.json | 5 --- src/features/SelectPSSARules.ts | 70 --------------------------------- src/main.ts | 2 - 3 files changed, 77 deletions(-) delete mode 100644 src/features/SelectPSSARules.ts diff --git a/package.json b/package.json index 7b707cde72..b872c979ee 100644 --- a/package.json +++ b/package.json @@ -236,11 +236,6 @@ "title": "Show Session Menu", "category": "PowerShell" }, - { - "command": "PowerShell.SelectPSSARules", - "title": "Select PSScriptAnalyzer Rules", - "category": "PowerShell" - }, { "command": "PowerShell.ShowSessionConsole", "title": "Show Integrated Console", diff --git a/src/features/SelectPSSARules.ts b/src/features/SelectPSSARules.ts deleted file mode 100644 index 3c2682529e..0000000000 --- a/src/features/SelectPSSARules.ts +++ /dev/null @@ -1,70 +0,0 @@ -/*--------------------------------------------------------- - * Copyright (C) Microsoft Corporation. All rights reserved. - *--------------------------------------------------------*/ - -import vscode = require("vscode"); -import { LanguageClient, RequestType } from "vscode-languageclient"; -import { ICheckboxQuickPickItem, showCheckboxQuickPick } from "../controls/checkboxQuickPick"; -import { IFeature } from "../feature"; -import { Logger } from "../logging"; - -export const GetPSSARulesRequestType = new RequestType("powerShell/getPSSARules"); -export const SetPSSARulesRequestType = new RequestType("powerShell/setPSSARules"); - -class RuleInfo { - public name: string; - public isEnabled: boolean; -} - -export class SelectPSSARulesFeature implements IFeature { - - private command: vscode.Disposable; - private languageClient: LanguageClient; - - constructor(private log: Logger) { - this.command = vscode.commands.registerCommand("PowerShell.SelectPSSARules", () => { - if (this.languageClient === undefined) { - this.log.writeAndShowError(`<${SelectPSSARulesFeature.name}>: ` + - "Unable to instantiate; language client undefined."); - return; - } - - this.languageClient.sendRequest(GetPSSARulesRequestType, null).then((returnedRules) => { - if (returnedRules == null) { - vscode.window.showWarningMessage( - "PowerShell extension uses PSScriptAnalyzer settings file - Cannot update rules."); - return; - } - - const options: ICheckboxQuickPickItem[] = - returnedRules.map((rule: RuleInfo): ICheckboxQuickPickItem => { - return { label: rule.name, isSelected: rule.isEnabled }; - }); - - showCheckboxQuickPick(options) - .then((updatedOptions: ICheckboxQuickPickItem[]) => { - if (updatedOptions === undefined) { - return; - } - - this.languageClient.sendRequest( - SetPSSARulesRequestType, - { - filepath: vscode.window.activeTextEditor.document.uri.toString(), - ruleInfos: updatedOptions.map((option: ICheckboxQuickPickItem): RuleInfo => { - return { name: option.label, isEnabled: option.isSelected }; - }), - }); - }); - }); - }); - } - - public dispose(): void { - this.command.dispose(); - } - - public setLanguageClient(languageclient: LanguageClient): void { - this.languageClient = languageclient; - } -} diff --git a/src/main.ts b/src/main.ts index fc2272f16d..e9343927e4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -29,7 +29,6 @@ import { OpenInISEFeature } from "./features/OpenInISE"; import { PesterTestsFeature } from "./features/PesterTests"; import { RemoteFilesFeature } from "./features/RemoteFiles"; import { RunCodeFeature } from "./features/RunCode"; -import { SelectPSSARulesFeature } from "./features/SelectPSSARules"; import { ShowHelpFeature } from "./features/ShowHelp"; import { Logger, LogLevel } from "./logging"; import { SessionManager } from "./session"; @@ -154,7 +153,6 @@ export function activate(context: vscode.ExtensionContext): void { new PesterTestsFeature(sessionManager), new RunCodeFeature(sessionManager), new ExtensionCommandsFeature(logger), - new SelectPSSARulesFeature(logger), new CodeActionsFeature(logger), new NewFileOrProjectFeature(), new RemoteFilesFeature(), From f3629cd4ac00395dc7709b2d06bb1ad2120d331d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2020 21:25:33 -0700 Subject: [PATCH 132/166] Bump mock-fs from 4.11.0 to 4.12.0 (#2662) Bumps [mock-fs](https://github.com/tschaub/mock-fs) from 4.11.0 to 4.12.0. - [Release notes](https://github.com/tschaub/mock-fs/releases) - [Changelog](https://github.com/tschaub/mock-fs/blob/master/changelog.md) - [Commits](https://github.com/tschaub/mock-fs/compare/v4.11.0...v4.12.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4d50a31ae2..6fdafdfe44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1388,9 +1388,9 @@ } }, "mock-fs": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.11.0.tgz", - "integrity": "sha512-Yp4o3/ZA15wsXqJTT+R+9w2AYIkD1i80Lds47wDbuUhOvQvm+O2EfjFZSz0pMgZZSPHRhGxgcd2+GL4+jZMtdw==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.12.0.tgz", + "integrity": "sha512-/P/HtrlvBxY4o/PzXY9cCNBrdylDNxg7gnrv2sMNxj+UJ2m8jSpl0/A6fuJeNAWr99ZvGWH8XCbE0vmnM5KupQ==", "dev": true }, "ms": { diff --git a/package.json b/package.json index b872c979ee..40bbfee917 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.3", "mocha-multi-reporters": "~1.1.7", - "mock-fs": "~4.11.0", + "mock-fs": "~4.12.0", "rewire": "~5.0.0", "sinon": "~9.0.2", "tslint": "~6.1.1", From 53d49c1127d04a76c326435b8d150d90d1ec0b8e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2020 21:35:25 -0700 Subject: [PATCH 133/166] Bump tslint from 6.1.1 to 6.1.2 (#2663) Bumps [tslint](https://github.com/palantir/tslint) from 6.1.1 to 6.1.2. - [Release notes](https://github.com/palantir/tslint/releases) - [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/palantir/tslint/compare/6.1.1...6.1.2) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6fdafdfe44..04309b26e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1617,9 +1617,9 @@ "dev": true }, "resolve": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", - "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -1954,9 +1954,9 @@ "dev": true }, "tslint": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.1.tgz", - "integrity": "sha512-kd6AQ/IgPRpLn6g5TozqzPdGNZ0q0jtXW4//hRcj10qLYBaa3mTUU2y2MCG+RXZm8Zx+KZi0eA+YCrMyNlF4UA==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.2.tgz", + "integrity": "sha512-UyNrLdK3E0fQG/xWNqAFAC5ugtFyPO4JJR1KyyfQAyzR8W0fTRrC91A8Wej4BntFzcvETdCSDa/4PnNYJQLYiA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", diff --git a/package.json b/package.json index 40bbfee917..4b32a6f56c 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "mock-fs": "~4.12.0", "rewire": "~5.0.0", "sinon": "~9.0.2", - "tslint": "~6.1.1", + "tslint": "~6.1.2", "typescript": "~3.5.3", "vsce": "~1.75.0", "vscode-test": "~1.3.0" From 56688bfb6d82c9d404b4dfbda56cfbcecd6147ad Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2020 10:04:24 -0700 Subject: [PATCH 134/166] Bump vscode-extension-telemetry from 0.1.2 to 0.1.3 (#2664) Bumps [vscode-extension-telemetry](https://github.com/Microsoft/vscode-extension-telemetry) from 0.1.2 to 0.1.3. - [Release notes](https://github.com/Microsoft/vscode-extension-telemetry/releases) - [Commits](https://github.com/Microsoft/vscode-extension-telemetry/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 40 ++++++++++++++++++++-------------------- package.json | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 04309b26e1..eb6a3a53e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -257,14 +257,14 @@ } }, "applicationinsights": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-1.4.0.tgz", - "integrity": "sha512-TV8MYb0Kw9uE2cdu4V/UvTKdOABkX2+Fga9iDz0zqV7FLrNXfmAugWZmmdTx4JoynYkln3d5CUHY3oVSUEbfFw==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-1.7.4.tgz", + "integrity": "sha512-XFLsNlcanpjFhHNvVWEfcm6hr7lu9znnb6Le1Lk5RE03YUV9X2B2n2MfM4kJZRrUdV+C0hdHxvWyv+vWoLfY7A==", "requires": { "cls-hooked": "^4.2.2", "continuation-local-storage": "^3.2.1", "diagnostic-channel": "0.2.0", - "diagnostic-channel-publishers": "^0.3.2" + "diagnostic-channel-publishers": "^0.3.3" } }, "argparse": { @@ -300,9 +300,9 @@ }, "dependencies": { "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" } } }, @@ -444,9 +444,9 @@ }, "dependencies": { "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" } } }, @@ -576,16 +576,16 @@ }, "dependencies": { "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" } } }, "diagnostic-channel-publishers": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.3.2.tgz", - "integrity": "sha512-2hBlg1BtBT+nd04MGGGZinDv5gOTRQOCzdgk+KRQZ20XJ/uepC0B0rwWLQtz6Tk6InXymWqsk1sMC975cPEReA==" + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.3.3.tgz", + "integrity": "sha512-qIocRYU5TrGUkBlDDxaziAK1+squ8Yf2Ls4HldL3xxb/jzmWO2Enux7CvevNKYmF2kDXZ9HiRqwjPsjk8L+i2Q==" }, "diff": { "version": "3.5.0", @@ -2146,11 +2146,11 @@ } }, "vscode-extension-telemetry": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.2.tgz", - "integrity": "sha512-FSbaZKlIH3VKvBJsKw7v5bESWHXzltji2rtjaJeJglpQH4tfClzwHMzlMXUZGiblV++djEzb1gW8mb5E+wxFsg==", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.3.tgz", + "integrity": "sha512-2P4/TrxwMRQJPpcsSpreI7JVftmy+kbatONGVY65x4fJfbaHTBTm6jNgkG0Xifv6Th1o25KvaVZUTjN7VWlxBA==", "requires": { - "applicationinsights": "1.4.0" + "applicationinsights": "1.7.4" } }, "vscode-jsonrpc": { diff --git a/package.json b/package.json index 4b32a6f56c..d679066102 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "dependencies": { "node-fetch": "^2.6.0", "semver": "^7.2.3", - "vscode-extension-telemetry": "~0.1.2", + "vscode-extension-telemetry": "~0.1.3", "vscode-languageclient": "~5.2.1" }, "devDependencies": { From 45bc46637755a98717488928498995748af9be1e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2020 10:06:00 -0700 Subject: [PATCH 135/166] Bump @types/node-fetch from 2.5.6 to 2.5.7 (#2665) Bumps [@types/node-fetch](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node-fetch) from 2.5.6 to 2.5.7. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node-fetch) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 20 ++++++++++---------- package.json | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb6a3a53e5..9a25d542c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -128,9 +128,9 @@ "dev": true }, "@types/node-fetch": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.6.tgz", - "integrity": "sha512-2w0NTwMWF1d3NJMK0Uiq2UNN8htVCyOWOD0jIPjPgC5Ph/YP4dVhs9YxxcMcuLuwAslz0dVEcZQUaqkLs3IzOQ==", + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.7.tgz", + "integrity": "sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw==", "dev": true, "requires": { "@types/node": "*", @@ -1290,18 +1290,18 @@ "dev": true }, "mime-db": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", - "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", "dev": true }, "mime-types": { - "version": "2.1.26", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", - "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "dev": true, "requires": { - "mime-db": "1.43.0" + "mime-db": "1.44.0" } }, "mimic-fn": { diff --git a/package.json b/package.json index d679066102..8d8efe20c3 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@types/mocha": "~7.0.2", "@types/mock-fs": "~4.10.0", "@types/node": "~10.11.0", - "@types/node-fetch": "~2.5.6", + "@types/node-fetch": "~2.5.7", "@types/rewire": "~2.5.28", "@types/semver": "~7.1.0", "@types/sinon": "~9.0.0", From 7a3861fbdd7a0736fa2ac4acf73906dbb85b48ee Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 28 Apr 2020 12:05:40 -0700 Subject: [PATCH 136/166] Add setting for the PackageManagement update feature (#2651) Co-authored-by: Tyler Leonhardt (POWERSHELL) --- package.json | 5 +++++ src/settings.ts | 3 +++ 2 files changed, 8 insertions(+) diff --git a/package.json b/package.json index 8d8efe20c3..5023f2f4ef 100644 --- a/package.json +++ b/package.json @@ -555,6 +555,11 @@ "description": "Specifies whether you should be prompted to update your version of PowerShell.", "default": true }, + "powershell.promptToUpdatePackageManagement": { + "type": "boolean", + "description": "Specifies whether you should be prompted to update your version of PackageManagement if it's under 1.4.6.", + "default": true + }, "powershell.startAsLoginShell.osx": { "type": "boolean", "default": true, diff --git a/src/settings.ts b/src/settings.ts index 267134f84f..fdaacab742 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -81,6 +81,7 @@ export interface ISettings { // This setting is no longer used but is here to assist in cleaning up the users settings. powerShellExePath?: string; promptToUpdatePowerShell?: boolean; + promptToUpdatePackageManagement?: boolean; bundledModulesPath?: string; startAsLoginShell?: IStartAsLoginShellSettings; startAutomatically?: boolean; @@ -201,6 +202,8 @@ export function load(): ISettings { configuration.get("powerShellExePath", undefined), promptToUpdatePowerShell: configuration.get("promptToUpdatePowerShell", true), + promptToUpdatePackageManagement: + configuration.get("promptToUpdatePackageManagement", true), bundledModulesPath: "../../modules", useX86Host: From 986c910277702955646e61615f9309c36d57c1ac Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2020 12:05:50 -0700 Subject: [PATCH 137/166] Bump semver from 7.2.3 to 7.3.2 (#2650) Bumps [semver](https://github.com/npm/node-semver) from 7.2.3 to 7.3.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/master/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v7.2.3...v7.3.2) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9a25d542c8..35a050b373 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1706,9 +1706,9 @@ "dev": true }, "semver": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.2.3.tgz", - "integrity": "sha512-utbW9Z7ZxVvwiIWkdOMLOR9G/NFXh2aRucghkVrEMJWuC++r3lCkBC3LwqBinyHzGMAJxY5tn6VakZGHObq5ig==" + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==" }, "shebang-command": { "version": "1.2.0", diff --git a/package.json b/package.json index 5023f2f4ef..bf9acc85ea 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ ], "dependencies": { "node-fetch": "^2.6.0", - "semver": "^7.2.3", + "semver": "^7.3.2", "vscode-extension-telemetry": "~0.1.3", "vscode-languageclient": "~5.2.1" }, From fc1030d5390e9cc225b9e3cedf65fe75f74ef586 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 28 Apr 2020 12:53:54 -0700 Subject: [PATCH 138/166] update cl for v2020.4.3-preview (#2668) --- CHANGELOG.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cadaf4b6a..1506972410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # PowerShell Extension Release History +## v2020.4.3-preview +### Tuesday, April 28, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🛫 ✨ [vscode-powershell #2651](https://github.com/PowerShell/vscode-powershell/pull/2651) - + Add setting for the PackageManagement update feature. +- 👮‍ 🐛 [vscode-powershell #2659](https://github.com/PowerShell/vscode-powershell/pull/2659) - + Remove broken 'Select PSScriptAnalyzer Rules' command. (Thanks @bergmeister!) +- 🛫 ✨ [vscode-powershell #2526](https://github.com/PowerShell/vscode-powershell/pull/2653) - + Clean up WaitForSessionFile logic and support increasing timeout with warning. +- 📟 ✨ [vscode-powershell #2644](https://github.com/PowerShell/vscode-powershell/pull/2644) - + Display preview state and version info in PSIC startup banner. (Thanks @rkeithhill!) +- 👷 ✨ [vscode-powershell #2645](https://github.com/PowerShell/vscode-powershell/pull/2645) - + Add workspace file to load both vscode-powershell and PSES. (Thanks @rkeithhill!) + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 📟 🐛 [PowerShellEditorServices #1272](https://github.com/PowerShell/PowerShellEditorServices/pull/1272) - + Allow progress colors to be settable and gettable from the internal host. +- 🛫 ✨ [PowerShellEditorServices #1239](https://github.com/PowerShell/PowerShellEditorServices/pull/1239) - + Prompt to update PackageManagement when using an old version. +- 🛫 ✨ [PowerShellEditorServices #1269](https://github.com/PowerShell/PowerShellEditorServices/pull/1269) - + Support ConstrainedLanguage mode. +- 📺 ✨ [PowerShellEditorServices #1268](https://github.com/PowerShell/PowerShellEditorServices/pull/1268) - + Refactor GetCommandHandler to not use dynamic. +- 🔍 🐛 [vscode-powershell #2654](https://github.com/PowerShell/PowerShellEditorServices/pull/1270) - + Fix interpolation in Log points, switch to double quotes. (Thanks @rkeithhill!) +- [PowerShellEditorServices #1267](https://github.com/PowerShell/PowerShellEditorServices/pull/1267) - + Update module manifest to match current module. +- 📟 🐛 [vscode-powershell #2637](https://github.com/PowerShell/PowerShellEditorServices/pull/1264) - + Leverage internal HostUI to check if VT100 is supported. +- 📟 🐛 [vscode-powershell #2637](https://github.com/PowerShell/PowerShellEditorServices/pull/1263) - + Use stable builds of PSReadLine for the PowerShell extension and preview builds for the PowerShell Preview extension. +- 💎 ✨ [vscode-powershell #2543](https://github.com/PowerShell/PowerShellEditorServices/pull/1262) - + Allow formatting when ScriptAnalysis setting is set to disabled. + ## v2020.4.0 ### Thursday, April 15, 2020 From 89b5c64893ed0e509c960b11b6dcf101ff60e305 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Fri, 1 May 2020 13:50:00 -0700 Subject: [PATCH 139/166] [Ignore] use forward slash for code-workspace --- extension-dev.code-workspace | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/extension-dev.code-workspace b/extension-dev.code-workspace index a43b119daa..edcd3d2b4e 100644 --- a/extension-dev.code-workspace +++ b/extension-dev.code-workspace @@ -1,12 +1,12 @@ { - "folders": [ - { - "path": "." - }, - { - "path": "..\\PowerShellEditorServices" - } - ], + "folders": [ + { + "path": "." + }, + { + "path": "../PowerShellEditorServices" + } + ], "settings": { "files.associations": { "**/snippets/*.json": "jsonc" From 8436c5ab4e74db43d1016be847babf8b484327b8 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Fri, 1 May 2020 13:59:48 -0700 Subject: [PATCH 140/166] Use in-memory debug adapter instead of spinning up new process (#2672) * user in-memory debug adapter instead of spinning up new process * Rob's feedback --- package-lock.json | 6 +- package.json | 8 +- src/debugAdapter.ts | 227 ++++++++++++++++------------------- src/features/DebugSession.ts | 31 +++-- src/main.ts | 2 +- 5 files changed, 135 insertions(+), 139 deletions(-) diff --git a/package-lock.json b/package-lock.json index 35a050b373..d83d45af3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -168,9 +168,9 @@ "dev": true }, "@types/vscode": { - "version": "1.40.0", - "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/@types/vscode/-/@types/vscode-1.40.0.tgz", - "integrity": "sha1-R9GenjLaUSyYb1ef5q+8jT5uDFU=", + "version": "1.43.0", + "resolved": "https://botbuilder.myget.org/F/botframework-cli/npm/@types/vscode/-/@types/vscode-1.43.0.tgz", + "integrity": "sha1-IiduYANMaTszEX8QaP+qwOiVIts=", "dev": true }, "acorn": { diff --git a/package.json b/package.json index bf9acc85ea..20e798f7f5 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", "engines": { - "vscode": "^1.40.0" + "vscode": "^1.43.0" }, "license": "SEE LICENSE IN LICENSE.txt", "homepage": "https://github.com/PowerShell/vscode-powershell/blob/master/README.md", @@ -28,7 +28,7 @@ "main": "./out/src/main", "activationEvents": [ "onDebugInitialConfigurations", - "onDebugResolve:powershell", + "onDebugResolve:PowerShell", "onLanguage:powershell", "onCommand:PowerShell.NewProjectFromTemplate", "onCommand:PowerShell.OpenExamplesFolder", @@ -57,7 +57,7 @@ "@types/rewire": "~2.5.28", "@types/semver": "~7.1.0", "@types/sinon": "~9.0.0", - "@types/vscode": "1.40.0", + "@types/vscode": "1.43.0", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.3", "mocha-multi-reporters": "~1.1.7", @@ -377,8 +377,6 @@ { "type": "PowerShell", "label": "PowerShell", - "program": "./out/src/debugAdapter.js", - "runtime": "node", "variables": { "PickPSHostProcess": "PowerShell.PickPSHostProcess", "PickRunspace": "PowerShell.PickRunspace", diff --git a/src/debugAdapter.ts b/src/debugAdapter.ts index 1e7d0e6a41..b621db963a 100644 --- a/src/debugAdapter.ts +++ b/src/debugAdapter.ts @@ -2,136 +2,117 @@ * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ -import fs = require("fs"); -import net = require("net"); -import os = require("os"); -import path = require("path"); +import { connect, Socket } from "net"; +import { DebugAdapter, Event, DebugProtocolMessage, EventEmitter } from "vscode"; import { Logger } from "./logging"; -import utils = require("./utils"); - -// NOTE: The purpose of this file is to serve as a bridge between -// VS Code's debug adapter client (which communicates via stdio) and -// PowerShell Editor Services' debug service (which communicates via -// named pipes or a network protocol). It is purely a naive data -// relay between the two transports. - -const logBasePath = path.resolve(__dirname, "../../logs"); - -const debugAdapterLogWriter = - fs.createWriteStream( - path.resolve( - logBasePath, - "DebugAdapter.log")); - -// Pause the stdin buffer until we're connected to the -// debug server -process.stdin.pause(); - -const debugSessionFilePath = utils.getDebugSessionFilePath(); -debugAdapterLogWriter.write("Session file path: " + debugSessionFilePath + ", pid: " + process.pid + " \r\n"); - -function startDebugging() { - // Read the details of the current session to learn - // the connection details for the debug service - const sessionDetails = utils.readSessionFile(debugSessionFilePath); - - // TODO: store session details into an in-memory store that can be shared between - // the debug adapter and client extension - // and then clean up the session details file. - - // Establish connection before setting up the session - debugAdapterLogWriter.write("Connecting to pipe: " + sessionDetails.debugServicePipeName + "\r\n"); - - let isConnected = false; - const debugServiceSocket = net.connect(sessionDetails.debugServicePipeName); - - // Write any errors to the log file - debugServiceSocket.on( - "error", - (e) => { - debugAdapterLogWriter.write("Socket ERROR: " + e + "\r\n"); - debugAdapterLogWriter.close(); - debugServiceSocket.destroy(); - process.exit(0); + +export class NamedPipeDebugAdapter implements DebugAdapter { + private static readonly TWO_CRLF = '\r\n\r\n'; + private static readonly HEADER_LINESEPARATOR = /\r?\n/; // allow for non-RFC 2822 conforming line separators + private static readonly HEADER_FIELDSEPARATOR = /: */; + + private readonly _logger: Logger; + private readonly _namedPipe: string; + + private _rawData = Buffer.allocUnsafe(0); + private _contentLength = -1; + private _isConnected: boolean = false; + private _debugMessageQueue: DebugProtocolMessage[] = []; + + private _debugServiceSocket: Socket; + + // The event that VS Code-proper will listen for. + private _sendMessage: EventEmitter = new EventEmitter(); + onDidSendMessage: Event = this._sendMessage.event; + + constructor(namedPipe: string, logger: Logger) { + this._namedPipe = namedPipe; + this._logger = logger; + } + + public start(): void { + this._debugServiceSocket = connect(this._namedPipe); + + this._debugServiceSocket.on("error", (e) => { + this._logger.writeError("Error on Debug Adapter: " + e); + this.dispose(); }); - // Route any output from the socket through stdout - debugServiceSocket.on( - "data", - (data: Buffer) => process.stdout.write(data)); - - // Wait for the connection to complete - debugServiceSocket.on( - "connect", - () => { - isConnected = true; - debugAdapterLogWriter.write("Connected to socket!\r\n\r\n"); - - // When data comes on stdin, route it through the socket - process.stdin.on( - "data", - (data: Buffer) => debugServiceSocket.write(data)); - - // Resume the stdin stream - process.stdin.resume(); - }); - - // When the socket closes, end the session - debugServiceSocket.on( - "close", - () => { - debugAdapterLogWriter.write("Socket closed, shutting down."); - debugAdapterLogWriter.close(); - isConnected = false; - - // Close after a short delay to give the client time - // to finish up - setTimeout(() => { - process.exit(0); - }, 2000); - }, - ); - - process.on( - "exit", - (e) => { - if (debugAdapterLogWriter) { - debugAdapterLogWriter.write("Debug adapter process is exiting..."); + // Route any output from the socket through to VS Code. + this._debugServiceSocket.on("data", (data: Buffer) => this.handleData(data)); + + // Wait for the connection to complete. + this._debugServiceSocket.on("connect", () => { + while(this._debugMessageQueue.length) { + this.writeMessageToDebugAdapter(this._debugMessageQueue.shift()); } - }, - ); -} -function waitForSessionFile(triesRemaining: number) { + this._isConnected = true; + this._logger.writeVerbose("Connected to socket!"); + }); - debugAdapterLogWriter.write(`Waiting for session file, tries remaining: ${triesRemaining}...\r\n`); + // When the socket closes, end the session. + this._debugServiceSocket.on("close", () => { this.dispose(); }); + } - if (triesRemaining > 0) { - if (utils.checkIfFileExists(debugSessionFilePath)) { - debugAdapterLogWriter.write(`Session file present, connecting to debug adapter...\r\n\r\n`); - startDebugging(); - } else { - // Wait for a second and try again - setTimeout( - () => waitForSessionFile(triesRemaining - 1), - 1000); + public handleMessage(message: DebugProtocolMessage): void { + if (!this._isConnected) { + this._debugMessageQueue.push(message); + return; } - } else { - debugAdapterLogWriter.write(`Timed out waiting for session file!\r\n`); - const errorJson = - JSON.stringify({ - type: "response", - request_seq: 1, - command: "initialize", - success: false, - message: "Timed out waiting for the PowerShell extension to start.", - }); - - process.stdout.write( - `Content-Length: ${Buffer.byteLength(errorJson, "utf8")}\r\n\r\n${errorJson}`, - "utf8"); + + this.writeMessageToDebugAdapter(message); } -} -// Wait for the session file to appear -waitForSessionFile(30); + public dispose() { + this._debugServiceSocket.destroy(); + this._sendMessage.dispose(); + } + + private writeMessageToDebugAdapter(message: DebugProtocolMessage): void { + const msg = JSON.stringify(message); + const messageWrapped = `Content-Length: ${Buffer.byteLength(msg, "utf8")}${NamedPipeDebugAdapter.TWO_CRLF}${msg}`; + this._logger.writeDiagnostic(`SENDING TO DEBUG ADAPTER: ${messageWrapped}`); + this._debugServiceSocket.write(messageWrapped, "utf8"); + } + + // Shamelessly stolen from VS Code's implementation with slight modification by using public types and our logger: + // https://github.com/microsoft/vscode/blob/ff1b513fbca1acad4467dfd768997e9e0b9c5735/src/vs/workbench/contrib/debug/node/debugAdapter.ts#L55-L92 + private handleData(data: Buffer): void { + this._rawData = Buffer.concat([this._rawData, data]); + + while (true) { + if (this._contentLength >= 0) { + if (this._rawData.length >= this._contentLength) { + const message = this._rawData.toString('utf8', 0, this._contentLength); + this._rawData = this._rawData.slice(this._contentLength); + this._contentLength = -1; + if (message.length > 0) { + try { + this._logger.writeDiagnostic(`RECEIVED FROM DEBUG ADAPTER: ${message}`); + this._sendMessage.fire(JSON.parse(message) as DebugProtocolMessage); + } catch (e) { + this._logger.writeError("Error firing event in VS Code: ", (e.message || e), message); + } + } + continue; // there may be more complete messages to process + } + } else { + const idx = this._rawData.indexOf(NamedPipeDebugAdapter.TWO_CRLF); + if (idx !== -1) { + const header = this._rawData.toString('utf8', 0, idx); + const lines = header.split(NamedPipeDebugAdapter.HEADER_LINESEPARATOR); + for (const h of lines) { + const kvPair = h.split(NamedPipeDebugAdapter.HEADER_FIELDSEPARATOR); + if (kvPair[0] === 'Content-Length') { + this._contentLength = Number(kvPair[1]); + } + } + this._rawData = this._rawData.slice(idx + NamedPipeDebugAdapter.TWO_CRLF.length); + continue; + } + } + break; + } + } +} diff --git a/src/features/DebugSession.ts b/src/features/DebugSession.ts index b784a203a5..b82596ae4c 100644 --- a/src/features/DebugSession.ts +++ b/src/features/DebugSession.ts @@ -12,19 +12,38 @@ import { PowerShellProcess} from "../process"; import { SessionManager, SessionStatus } from "../session"; import Settings = require("../settings"); import utils = require("../utils"); +import { NamedPipeDebugAdapter } from "../debugAdapter"; +import { Logger } from "../logging"; export const StartDebuggerNotificationType = new NotificationType("powerShell/startDebugger"); -export class DebugSessionFeature implements IFeature, DebugConfigurationProvider { +export class DebugSessionFeature implements IFeature, DebugConfigurationProvider, vscode.DebugAdapterDescriptorFactory { private sessionCount: number = 1; private command: vscode.Disposable; private tempDebugProcess: PowerShellProcess; + private tempSessionDetails: utils.IEditorServicesSessionDetails; - constructor(context: ExtensionContext, private sessionManager: SessionManager) { + constructor(context: ExtensionContext, private sessionManager: SessionManager, private logger: Logger) { // Register a debug configuration provider context.subscriptions.push(vscode.debug.registerDebugConfigurationProvider("PowerShell", this)); + context.subscriptions.push(vscode.debug.registerDebugAdapterDescriptorFactory("PowerShell", this)) + } + + createDebugAdapterDescriptor(session: vscode.DebugSession, executable: vscode.DebugAdapterExecutable): vscode.ProviderResult { + const sessionDetails = session.configuration.createTemporaryIntegratedConsole + ? this.tempSessionDetails + : this.sessionManager.getSessionDetails(); + + // Establish connection before setting up the session + this.logger.writeVerbose(`Connecting to pipe: ${sessionDetails.debugServicePipeName}`); + this.logger.writeVerbose(`Debug configuration: ${JSON.stringify(session.configuration)}`); + + const debugAdapter = new NamedPipeDebugAdapter(sessionDetails.debugServicePipeName, this.logger); + debugAdapter.start(); + + return new vscode.DebugAdapterInlineImplementation(debugAdapter); } public dispose() { @@ -295,11 +314,9 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider sessionFilePath, settings); - this.tempDebugProcess - .start(`DebugSession-${this.sessionCount++}`) - .then((sessionDetails) => { - utils.writeSessionFile(sessionFilePath, sessionDetails); - }); + this.tempSessionDetails = await this.tempDebugProcess.start(`DebugSession-${this.sessionCount++}`); + utils.writeSessionFile(sessionFilePath, this.tempSessionDetails); + } else { utils.writeSessionFile(sessionFilePath, this.sessionManager.getSessionDetails()); } diff --git a/src/main.ts b/src/main.ts index e9343927e4..f5c25465c8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -156,7 +156,7 @@ export function activate(context: vscode.ExtensionContext): void { new CodeActionsFeature(logger), new NewFileOrProjectFeature(), new RemoteFilesFeature(), - new DebugSessionFeature(context, sessionManager), + new DebugSessionFeature(context, sessionManager, logger), new PickPSHostProcessFeature(), new SpecifyScriptArgsFeature(context), new HelpCompletionFeature(logger), From d8e3cebc18d912d44edf5401f374db94569254c1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 15:17:52 -0700 Subject: [PATCH 141/166] Bump vscode-extension-telemetry from 0.1.3 to 0.1.5 (#2678) Bumps [vscode-extension-telemetry](https://github.com/Microsoft/vscode-extension-telemetry) from 0.1.3 to 0.1.5. - [Release notes](https://github.com/Microsoft/vscode-extension-telemetry/releases) - [Commits](https://github.com/Microsoft/vscode-extension-telemetry/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index d83d45af3f..b813b4de5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -583,9 +583,9 @@ } }, "diagnostic-channel-publishers": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.3.3.tgz", - "integrity": "sha512-qIocRYU5TrGUkBlDDxaziAK1+squ8Yf2Ls4HldL3xxb/jzmWO2Enux7CvevNKYmF2kDXZ9HiRqwjPsjk8L+i2Q==" + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.3.4.tgz", + "integrity": "sha512-SZ1zMfFiEabf4Qx0Og9V1gMsRoqz3O+5ENkVcNOfI+SMJ3QhQsdEoKX99r0zvreagXot2parPxmrwwUM/ja8ug==" }, "diff": { "version": "3.5.0", @@ -2146,9 +2146,9 @@ } }, "vscode-extension-telemetry": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.3.tgz", - "integrity": "sha512-2P4/TrxwMRQJPpcsSpreI7JVftmy+kbatONGVY65x4fJfbaHTBTm6jNgkG0Xifv6Th1o25KvaVZUTjN7VWlxBA==", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.5.tgz", + "integrity": "sha512-/qTvBV6IJxavF16EWJKbjVRm5YLByAOMg+YRii8y1uyQKl2Ea/SIwyC5/Pxh3NQKHrahp2zL2U6ZW3Z023NjkA==", "requires": { "applicationinsights": "1.7.4" } diff --git a/package.json b/package.json index 20e798f7f5..d5c0ccf51d 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "dependencies": { "node-fetch": "^2.6.0", "semver": "^7.3.2", - "vscode-extension-telemetry": "~0.1.3", + "vscode-extension-telemetry": "~0.1.5", "vscode-languageclient": "~5.2.1" }, "devDependencies": { From 60e5648ca4dcee64f18ba56cd3520a6d7a666ba2 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Mon, 4 May 2020 23:34:31 +0100 Subject: [PATCH 142/166] PSSA 1.19.0 settings (#2674) * PSSA 1.19.0 settings support * add whitespaceBetweenParameters and change default pipeline indentation to None * add None option and set default Co-authored-by: Christoph Bergmeister --- package.json | 21 ++++++++++++++++----- src/settings.ts | 13 +++++++++---- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index d5c0ccf51d..5ead2b8299 100644 --- a/package.json +++ b/package.json @@ -654,10 +654,11 @@ "enum": [ "IncreaseIndentationForFirstPipeline", "IncreaseIndentationAfterEveryPipeline", - "NoIndentation" + "NoIndentation", + "None" ], - "default": "NoIndentation", - "description": "Multi-line pipeline style settings." + "default": "None", + "description": "Multi-line pipeline style settings (default: None)." }, "powershell.codeFormatting.whitespaceBeforeOpenBrace": { "type": "boolean", @@ -684,10 +685,20 @@ "default": true, "description": "Adds a space after an opening brace ('{') and before a closing brace ('}')." }, - "powershell.codeFormatting.whitespaceAroundPipe": { + "powershell.codeFormatting.whitespaceBetweenParameters": { + "type": "boolean", + "default": false, + "description": "Removes redundant whitespace between parameters." + }, + "powershell.codeFormatting.addWhitespaceAroundPipe": { "type": "boolean", "default": true, - "description": "Adds a space before and after the pipeline operator ('|')." + "description": "Adds a space before and after the pipeline operator ('|') if it is missing." + }, + "powershell.codeFormatting.trimWhitespaceAroundPipe": { + "type": "boolean", + "default": false, + "description": "Trims extraneous whitespace (more than 1 character) before and after the pipeline operator ('|')." }, "powershell.codeFormatting.ignoreOneLineBlock": { "type": "boolean", diff --git a/src/settings.ts b/src/settings.ts index fdaacab742..a5f4cbd51e 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -18,6 +18,7 @@ enum PipelineIndentationStyle { IncreaseIndentationForFirstPipeline, IncreaseIndentationAfterEveryPipeline, NoIndentation, + None, } export enum HelpCompletion { @@ -51,8 +52,10 @@ export interface ICodeFormattingSettings { whitespaceBeforeOpenParen: boolean; whitespaceAroundOperator: boolean; whitespaceAfterSeparator: boolean; - whitespaceInsideBrace: true; - whitespaceAroundPipe: true; + whitespaceBetweenParameters: boolean; + whitespaceInsideBrace: boolean; + addWhitespaceAroundPipe: boolean; + trimWhitespaceAroundPipe: boolean; ignoreOneLineBlock: boolean; alignPropertyValuePairs: boolean; useCorrectCasing: boolean; @@ -158,13 +161,15 @@ export function load(): ISettings { openBraceOnSameLine: true, newLineAfterOpenBrace: true, newLineAfterCloseBrace: true, - pipelineIndentationStyle: PipelineIndentationStyle.NoIndentation, + pipelineIndentationStyle: PipelineIndentationStyle.None, whitespaceBeforeOpenBrace: true, whitespaceBeforeOpenParen: true, whitespaceAroundOperator: true, whitespaceAfterSeparator: true, + whitespaceBetweenParameters: false, whitespaceInsideBrace: true, - whitespaceAroundPipe: true, + addWhitespaceAroundPipe: true, + trimWhitespaceAroundPipe: false, ignoreOneLineBlock: true, alignPropertyValuePairs: true, useCorrectCasing: false, From 69a34ba42c12a172d93f25791f1fe295a606495f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Tue, 5 May 2020 00:44:28 +0200 Subject: [PATCH 143/166] Fix Pester invocation for 3x versions (#2676) --- InvokePesterStub.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/InvokePesterStub.ps1 b/InvokePesterStub.ps1 index cdb6cb1216..b1bcb75f61 100755 --- a/InvokePesterStub.ps1 +++ b/InvokePesterStub.ps1 @@ -105,9 +105,19 @@ if ($All) { } Pester\Invoke-Pester -Configuration $configuration | Out-Null } - else { + elseif ($pesterModule.Version -ge '3.4.5') { + # -Show was introduced in 3.4.5 Pester\Invoke-Pester -Script $ScriptPath -PesterOption @{IncludeVSCodeMarker=$true} -Show $pester4Output } + elseif ($pesterModule.Version -ge '3.4.0') { + # -PesterOption was introduced before 3.4.0, and VSCodeMarker in 4.0.3-rc, + # but because no-one checks the integrity of this hashtable we can call all of the versions + # down to 3.4.0 like this + Pester\Invoke-Pester -Script $ScriptPath -PesterOption @{IncludeVSCodeMarker=$true} + } + else { + Pester\Invoke-Pester -Script $ScriptPath + } } elseif (($LineNumber -match '\d+') -and ($pesterModule.Version -ge '4.6.0')) { if ($pesterModule.Version -ge '5.0.0') { From 76164f98daf8880fc52d7422f1fd70a7bc8ba759 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 6 May 2020 12:01:25 -0700 Subject: [PATCH 144/166] Replace link since vscode or github doesn't play nice with # (#2681) --- src/features/GenerateBugReport.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/GenerateBugReport.ts b/src/features/GenerateBugReport.ts index 111fa85fcc..6904095096 100644 --- a/src/features/GenerateBugReport.ts +++ b/src/features/GenerateBugReport.ts @@ -43,7 +43,7 @@ I am experiencing a problem with... Attached Logs ===== -Follow the instructions in the [README](https://github.com/PowerShell/vscode-powershell#reporting-problems) about +Follow the instructions in the [README](https://github.com/PowerShell/vscode-powershell/blob/master/docs/troubleshooting.md) about capturing and sending logs. Environment Information From b335bcf30a4e75497a76737b4fc16b59dce535a8 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 6 May 2020 12:08:08 -0700 Subject: [PATCH 145/166] Update powershell-preview CHANGELOG for v2020.5.0 (#2682) * Update CHANGELOG for v2020.5.0 * Update CHANGELOG.md * Update package.json --- CHANGELOG.md | 5270 +++++++++++++++++++++++++------------------------- package.json | 2 +- 2 files changed, 2648 insertions(+), 2624 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1506972410..954fb9f008 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2623 +1,2647 @@ -# PowerShell Extension Release History - -## v2020.4.3-preview -### Tuesday, April 28, 2020 -#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - -- 🛫 ✨ [vscode-powershell #2651](https://github.com/PowerShell/vscode-powershell/pull/2651) - - Add setting for the PackageManagement update feature. -- 👮‍ 🐛 [vscode-powershell #2659](https://github.com/PowerShell/vscode-powershell/pull/2659) - - Remove broken 'Select PSScriptAnalyzer Rules' command. (Thanks @bergmeister!) -- 🛫 ✨ [vscode-powershell #2526](https://github.com/PowerShell/vscode-powershell/pull/2653) - - Clean up WaitForSessionFile logic and support increasing timeout with warning. -- 📟 ✨ [vscode-powershell #2644](https://github.com/PowerShell/vscode-powershell/pull/2644) - - Display preview state and version info in PSIC startup banner. (Thanks @rkeithhill!) -- 👷 ✨ [vscode-powershell #2645](https://github.com/PowerShell/vscode-powershell/pull/2645) - - Add workspace file to load both vscode-powershell and PSES. (Thanks @rkeithhill!) - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- 📟 🐛 [PowerShellEditorServices #1272](https://github.com/PowerShell/PowerShellEditorServices/pull/1272) - - Allow progress colors to be settable and gettable from the internal host. -- 🛫 ✨ [PowerShellEditorServices #1239](https://github.com/PowerShell/PowerShellEditorServices/pull/1239) - - Prompt to update PackageManagement when using an old version. -- 🛫 ✨ [PowerShellEditorServices #1269](https://github.com/PowerShell/PowerShellEditorServices/pull/1269) - - Support ConstrainedLanguage mode. -- 📺 ✨ [PowerShellEditorServices #1268](https://github.com/PowerShell/PowerShellEditorServices/pull/1268) - - Refactor GetCommandHandler to not use dynamic. -- 🔍 🐛 [vscode-powershell #2654](https://github.com/PowerShell/PowerShellEditorServices/pull/1270) - - Fix interpolation in Log points, switch to double quotes. (Thanks @rkeithhill!) -- [PowerShellEditorServices #1267](https://github.com/PowerShell/PowerShellEditorServices/pull/1267) - - Update module manifest to match current module. -- 📟 🐛 [vscode-powershell #2637](https://github.com/PowerShell/PowerShellEditorServices/pull/1264) - - Leverage internal HostUI to check if VT100 is supported. -- 📟 🐛 [vscode-powershell #2637](https://github.com/PowerShell/PowerShellEditorServices/pull/1263) - - Use stable builds of PSReadLine for the PowerShell extension and preview builds for the PowerShell Preview extension. -- 💎 ✨ [vscode-powershell #2543](https://github.com/PowerShell/PowerShellEditorServices/pull/1262) - - Allow formatting when ScriptAnalysis setting is set to disabled. - -## v2020.4.0 -### Thursday, April 15, 2020 - -- ⚡️🧠 Better performance of overall but especially IntelliSense. -- 🐛📟 Errors show up properly on screen in PowerShell Integrated Console. -- ✨🐢 Run a single test in Pester v5 by setting `"powershell.pester.useLegacyCodeLens": false`. -- 🐛🔧 Ignore files specified in `files.exclude` and `search.exclude` in reference/CodeLens search. - -## v2020.4.2-preview -### Monday, April 13, 2020 -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- 🐛📟 [PowerShellEditorServices #1258](https://github.com/PowerShell/PowerShellEditorServices/pull/1258) - - No more warning about PowerShellEditorServices module being imported with unapproved verb. - -## v2020.4.1-preview -### Wednesday, April 09, 2020 -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- ✨📟 [PowerShellEditorServices #1255](https://github.com/PowerShell/PowerShellEditorServices/pull/1255) - - Move PSReadLine invocation into cmdlets to get closer to supporting ConstrainedLanguage mode. Also removes hard coded PSReadLine assembly version. - -## v2020.4.0-preview -### Wednesday, April 08, 2020 -#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - -- ✨👷 [vscode-powershell #2617](https://github.com/PowerShell/vscode-powershell/pull/2617) - - Use PowerShell Daily in CI. -- 🐛📖 [vscode-powershell #2618](https://github.com/PowerShell/vscode-powershell/pull/2618) - - Fix link to 'Exchange Online Connection' in community snippets ToC. (Thanks @hjorslev!) -- 🐛🐢 [vscode-powershell #2606](https://github.com/PowerShell/vscode-powershell/pull/2606) - - Fix Pester CodeLens setting which allows Pester v4 scripts to work again. (Thanks @nohwnd!) - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- ✨👷 [PowerShellEditorServices #1252](https://github.com/PowerShell/PowerShellEditorServices/pull/1252) - - Use PowerShell Daily in CI. -- 🐛⚡️🧠🔗 [PowerShellEditorServices #1251](https://github.com/PowerShell/PowerShellEditorServices/pull/1251) - - Add cancellation to SignatureHelp request and cache results for cmdlets on `Get-Command` and `Get-Help`. - -## v2020.3.2-preview -### Tuesday, March 31, 2020 -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- ✨📟 [PowerShellEditorServices #1245](https://github.com/PowerShell/PowerShellEditorServices/pull/1245) - - Better PSReadLine version filter check to include 2.1.0+ prereleases. -- 🐛⚡️🧠🔗 [PowerShellEditorServices #1248](https://github.com/PowerShell/PowerShellEditorServices/pull/1248) - - Fix cancellation for completions and add `textDocument/hover` cancellation support. - -## v2020.3.1-preview -### Thursday, March 26, 2020 -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- 🐛🧠 [vscode-powershell #2584](https://github.com/PowerShell/PowerShellEditorServices/pull/1243) - - Refactor GetCommandSynopsisAsync method to make sure cmdlets with module prefixes work. -- 🐛⚡️🧠📚 [vscode-powershell #2556](https://github.com/PowerShell/PowerShellEditorServices/pull/1238) - - Add cancellation for `textDocument/completion`, `textDocument/codeAction`, `textDocument/folding`. -- ✨👮 [vscode-powershell #2572](https://github.com/PowerShell/PowerShellEditorServices/pull/1241) - - Only run diagnostics on PowerShell files. -- ⚡️🧠 [PowerShellEditorServices #1237](https://github.com/PowerShell/PowerShellEditorServices/pull/1237) - - Optimize when we run GetCommandInfoAsync to use the pipeline less for Intellisense. - -## v2020.3.0-preview -### Thursday, March 12, 2020 -#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - -- 🐛👷‍♀️ [vscode-powershell #2533](https://github.com/PowerShell/vscode-powershell/pull/2533) - - Change source repository's recommended extension from ms-vscode.csharp to ms-dotnettools.csharp. (Thanks @devlead!) -- ✨🐢 [vscode-powershell #2441](https://github.com/PowerShell/vscode-powershell/pull/2441) - - Run a single Pester test. (Thanks @nohwnd!) -- 🐛🔧 [vscode-powershell #2524](https://github.com/PowerShell/vscode-powershell/pull/2524) - - Add `files.exclude` and `search.exclude` to configurations sent through to exclude them from PSES functionality - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- ✨🧠 [PowerShellEditorServices #1232](https://github.com/PowerShell/PowerShellEditorServices/pull/1232) - - Only resolve completion items from commands. -- ✨🐢 [PowerShellEditorServices #1167](https://github.com/PowerShell/PowerShellEditorServices/pull/1167) - - Run a single test in Pester v5. (Thanks @nohwnd!) -- 🐛🔍 [vscode-powershell #2534](https://github.com/PowerShell/PowerShellEditorServices/pull/1230) - - Ensure that errors are written to the console when debugging. -- 🐛🔍 [vscode-powershell #2525](https://github.com/PowerShell/PowerShellEditorServices/pull/1229) - - Don't warn users when using `Clear-Host` in temp sessions. -- ✨💎 [PowerShellEditorServices #1228](https://github.com/PowerShell/PowerShellEditorServices/pull/1228) - - Add better logging for formatter and refactor it into 1 class. -- 🐛🚂 [vscode-powershell #2397](https://github.com/PowerShell/PowerShellEditorServices/pull/1227) - - Use Assembly.LoadFile for dependency loading in WinPS. -- ✨🛫 [PowerShellEditorServices #1222](https://github.com/PowerShell/PowerShellEditorServices/pull/1222) - - Make initial logging work in constrained language mode, allowing the desired user-facing error to present. -- 🐛🛫 [PowerShellEditorServices #1225](https://github.com/PowerShell/PowerShellEditorServices/pull/1225) - - Sign Clear-Host.ps1. -- 🐛🛫 [PowerShellEditorServices #1219](https://github.com/PowerShell/PowerShellEditorServices/pull/1219) - - Ensure log directory is created. -- 🐛👷‍♀️ [PowerShellEditorServices #1223](https://github.com/PowerShell/PowerShellEditorServices/pull/1223) - - Change Ms-vscode.csharp to ms-dotnettools.csharp. (Thanks @devlead!) -- 🐛🔧 [PowerShellEditorServices #1220](https://github.com/PowerShell/PowerShellEditorServices/pull/1220) - - Fix typo in settings. -- ✨🔧 [PowerShellEditorServices #1218](https://github.com/PowerShell/PowerShellEditorServices/pull/1218) - - Switch to better document selecting for vim extension. -- 🐛🧠 [PowerShellEditorServices #1217](https://github.com/PowerShell/PowerShellEditorServices/pull/1217) - - Make session-state lock task-reentrant to fix Untitled file debugging. - -## v2020.3.0 -### Thursday, March 12, 2020 - -#### Release of preview work to stable branch - -This release, coinciding with the [GA release of PowerShell 7](https://devblogs.microsoft.com/powershell/announcing-PowerShell-7-0/), -brings a year of work on the PowerShell extension into the stable release. -The timing of this release is deliberate, since some of the new features -depend on additions and bugfixes in PowerShell 7, -while others have a much better experience in PowerShell 7 -thanks to many improvements shipping with it. - -Some changes that come to the stable channel in this release include: - -- [Integration of PSReadLine into the Integrated Console](https://github.com/PowerShell/vscode-PowerShell/issues/535), - enabling syntax highlighting, a better (and more configurable) completion experience, - multiline editing and searchable history in the PowerShell Integrated Console -- Performance and reliability improvements gained - by [replacing](https://github.com/PowerShell/PowerShellEditorServices/pull/1056) - a hand-rolled Language Server Protocol stack - with the LSP server library from the Omnisharp project -- An [ISE compatibility mode](https://github.com/PowerShell/vscode-powershell/pull/2335) - setting to toggle a more ISE-like user experience -- Debugging improvements in PowerShell 7, - [using its new debugging APIs](https://github.com/PowerShell/PowerShellEditorServices/pull/1119) -- [End of support for PowerShell v3/v4 and .NET 4.5.2](https://github.com/PowerShell/vscode-PowerShell/issues/1310) - -After this release, the stable/preview channels will now function as originally intended, -where the preview channel will be the beta release -for features to come out in the following stable release. - -You may also notice that the history of the changelog has changed. -For a full list of changes between this release and the previous stable release, -see [here](https://github.com/PowerShell/vscode-powershell/blob/master/docs/preview_to_stable_changelog.md). -You can find the changelog from the old stable fork -[here](https://github.com/PowerShell/vscode-powershell/blob/legacy/1.x/CHANGELOG.md). - -#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - -- ✨📺 [vscode-PowerShell #2503](https://github.com/PowerShell/vscode-powershell/pull/2503) - - Pick up the PowerShell dotnet global tool as a PowerShell runtime. -- 🐛🛫 [vscode-PowerShell #2491](https://github.com/PowerShell/vscode-powershell/pull/2498) - - Fix a startup issue where console becomes unresponsive due to the client waiting for the terminal PID from VSCode. -- 🐛👮 [vscode-PowerShell #2190](https://github.com/PowerShell/vscode-powershell/pull/2484) - - Look for `PSScriptAnalyzerSettings.psd1` in the workspace root by default for script analysis, - defaulting back to the default rules when not found. -- 🧰 [vscode-PowerShell #2477](https://github.com/PowerShell/vscode-powershell/pull/2477) - - Stop using the `caption` field on `powerShell/showChoicePrompt` messages, - and instead display only the `message` field. - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- 🐛📟 [PowerShellEditorServices #1201](https://github.com/PowerShell/PowerShellEditorServices/pull/1201) - - Fix newlines in error formatting. -- 🐛👮 [vscode-PowerShell #2489](https://github.com/PowerShell/PowerShellEditorServices/pull/1206) - - Fix PSScriptAnalyzer not using default rules when no settings file present. -- 🐛📟 [vscode-PowerShell #2291](https://github.com/PowerShell/PowerShellEditorServices/pull/1207) - - Fix `Read-Host` dropping characters. -- 🐛📺 [vscode-PowerShell #2424](https://github.com/PowerShell/PowerShellEditorServices/pull/1209) - - Fix `F8` not working repeatedly in an Interactive Debugging session. -- 🐛🛫 [vscode-PowerShell #2404](https://github.com/PowerShell/PowerShellEditorServices/pull/1208) - - Fix execution policy being set incorrectly at startup on Windows. -- 🐛🧠 [vscode-PowerShell #2364](https://github.com/PowerShell/PowerShellEditorServices/pull/1210) - - Fix intellisense and `F5` not working after debugging. -- 🐛🧰 [vscode-PowerShell #2495](https://github.com/PowerShell/PowerShellEditorServices/pull/1211) - - Fix PowerShellEditorServices.Commands module commands not working due to types being moved. -- 🐛👮 [vscode-PowerShell #2516](https://github.com/PowerShell/PowerShellEditorServices/pull/1216) - - Fix CommentHelp for when a function has other problems with it. - -## v2020.2.0 -### Thursday, February 20, 2020 -#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - -- 🐛📖 [vscode-PowerShell #2470](https://github.com/PowerShell/vscode-powershell/pull/2470) - - Fix incorrect reference to `New-ManifestModule` in documentation. (Thanks @rbleattler!) -- 🐛📺 [vscode-PowerShell #2469](https://github.com/PowerShell/vscode-powershell/pull/2469) - - Close other open pwsh instances when updating PowerShell. -- 🐛📟 [vscode-PowerShell #2434](https://github.com/powershell/vscode-powershell/pull/2437) - - Use a new VSCode API to hide the integrated terminal from the shell list - until debugging when `showOnStartup` is disabled. -- ✨🐢 [vscode-PowerShell #2445](https://github.com/PowerShell/vscode-powershell/pull/2445) - - Add `Run/Debug Pester tests` context menu options in the VSCode explorer - for Pester test files. (Thanks @bergmeister!) -- 🐛🐢 [vscode-PowerShell #2438](https://github.com/PowerShell/vscode-powershell/pull/2447/) - - Fixes test failures in Pester contexts not showing up in the Problems pane. (Thanks @tillig!) -- 🐛🔍 [vscode-PowerShell #2548](https://github.com/PowerShell/vscode-powershell/pull/2458) - - Show error message instead of not responding when temp debugging is used with an untitled file. -- 👷 [vscode-PowerShell #2465](https://github.com/PowerShell/vscode-powershell/pull/2465) - - Move macOS CI images to 10.14 (Thanks @bergmeister!) - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- 🐛📁 [vscode-PowerShell #2421](https://github.com/powershell/powershelleditorservices/pull/1161) - - Fix WorkspacePath so that references work with non-ASCII characters. -- 🐛📟 [vscode-PowerShell #2372](https://github.com/powershell/powershelleditorservices/pull/1162) - - Fix prompt behavior when debugging. -- 🐛🛫 [PowerShellEditorServices #1171](https://github.com/powershell/powershelleditorservices/pull/1171) - - Fix race condition where running multiple profiles caused errors. -- 🐛📟 [vscode-PowerShell #2420](https://github.com/powershell/powershelleditorservices/pull/1173) - - Fix an issue where pasting to a `Get-Credential` prompt in some Windows versions caused a crash. -- 🐛📟 [vscode-PowerShell #1790](https://github.com/powershell/powershelleditorservices/pull/1174) - - Fix an inconsistency where `Read-Host -Prompt 'prompt'` would return `$null` rather than empty string - when given no input. -- 🐛🔗 [PowerShellEditorServices #1177](https://github.com/powershell/powershelleditorservices/pull/1174) - - Fix an issue where untitled files did not work with CodeLens. -- ⚡️⏱️ [PowerShellEditorServices #1172](https://github.com/powershell/powershelleditorservices/pull/1172) - - Improve `async`/`await` and `Task` usage to reduce concurrency overhead and improve performance. -- 🐛📟 [PowerShellEditorServices #1178](https://github.com/powershell/powershelleditorservices/pull/1178) - - Improve PSReadLine experience where no new line is rendered in the console. -- ✨🔍 [PowerShellEditorServices #1119](https://github.com/powershell/powershelleditorservices/pull/1119) - - Enable new debugging APIs added in PowerShell 7, improving performance and fixing issues where - the debugger would stop responding or be unable to update breakpoints while scripts were running. -- 👷📟 [PowerShellEditorServices #1187](https://github.com/PowerShell/PowerShellEditorServices/pull/1187) - - Upgrade built-in PSReadLine to 2.0.0 GA. -- 🐛👮 [PowerShellEditorServices #1179](https://github.com/PowerShell/PowerShellEditorServices/pull/1179) - - Improve integration with PSScriptAnalyzer, improving performance, - fixing an error when PSScriptAnalyzer is not available, fix CodeActions not appearing on Windows, - fix an issue where the PSModulePath is reset by PSScriptAnalyzer opening new runspaces. -- 🚂 [PowerShellEditorServices #1183](https://github.com/PowerShell/PowerShellEditorServices/pull/1183) - - Close over public APIs not intended for external use and replace with new, async-friendly APIs. - -## v2020.1.0 -### Monday, January 13, 2020 -#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - -- 🛫 ✨ [vscode-powershell #2384](https://github.com/PowerShell/vscode-PowerShell/pull/2400) - - Add -Login startup option. -- 🛫 🐛 [vscode-powershell #2380](https://github.com/PowerShell/vscode-PowerShell/pull/2399) - - Make PowerShell names case insensitive for configuration. -- 🛫 📺 ✨ [vscode-powershell #2370](https://github.com/PowerShell/vscode-PowerShell/pull/2398) - - Add configuration to enable/disable banner. - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- 📺 [vscode-powershell #2405](https://github.com/PowerShell/PowerShellEditorServices/pull/1152) - - Add tooltip to completions ParameterValue. -- 🛫 🐛 [vscode-powershell #2393](https://github.com/PowerShell/PowerShellEditorServices/pull/1151) - - Probe netfx dir for deps. -- 🚂 ⏱️ 🐛 [vscode-powershell #2352](https://github.com/PowerShell/PowerShellEditorServices/pull/1149) - - Fix lock up that occurs when WinForms is executed on the pipeline thread. -- 💭 🐛 [vscode-powershell #2402](https://github.com/PowerShell/PowerShellEditorServices/pull/1150) - - Fix temp debugging after it broke bringing in $psEditor. -- 🧠 🐛 [vscode-powershell #2324](https://github.com/PowerShell/PowerShellEditorServices/pull/1143) - - Fix unicode character uri bug. -- 🛫 📺 ✨ [vscode-powershell #2370](https://github.com/PowerShell/PowerShellEditorServices/pull/1141) - - Make startup banner simpler. -- [vscode-powershell #2386](https://github.com/PowerShell/PowerShellEditorServices/pull/1140) - - Fix uncaught exception when SafeToString returns null. (Thanks @jborean93!) -- 🔗 🐛 [vscode-powershell #2374](https://github.com/PowerShell/PowerShellEditorServices/pull/1139) - - Simplify logic of determining Reference definition. -- 🛫 🐛 [vscode-powershell #2379](https://github.com/PowerShell/PowerShellEditorServices/pull/1138) - - Use -Option AllScope to fix Windows PowerShell error. - -## v2019.12.0 -### Wednesday, December 11, 2019 -#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - -- ✨ 📺 [vscode-PowerShell #2335](https://github.com/PowerShell/vscode-powershell/pull/2335) - - Add editor command `PowerShell: Enable/Disable ISE Mode` for ISE emulation in VS Code. -- ⚡️ 🛫 [vscode-PowerShell #2348](https://github.com/PowerShell/vscode-PowerShell/pull/2348) - - Start EditorServices without start script. -- ✨ 📟 [vscode-PowerShell #2316](https://github.com/PowerShell/vscode-PowerShell/pull/2316) - - Add `powershell.integratedConsole.forceClearScrollbackBuffer` setting to enable `Clear-Host` to clear scrollback buffer. -- 🐛 📺 [vscode-PowerShell #2325](https://github.com/PowerShell/vscode-PowerShell/pull/2325) - - Fix update PowerShell feature on windows. -- 🔧 📁 🐛 [vscode-powershell #2099](https://github.com/PowerShell/vscode-PowerShell/pull/2304) - - Use `powerShellDefaultVersion` everywhere and stop using `powerShellExePath`. -- 🐛 📺 [vscode-PowerShell #2294](https://github.com/PowerShell/vscode-PowerShell/pull/2294) - - Buttons show up for untitled files. - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- 👷 📟 [PowerShellEditorServices #1129](https://github.com/PowerShell/PowerShellEditorServices/pull/1129) - - Update PSReadLine to 2.0.0-rc1 in modules.json. -- 🛫 🐛 ⚡️ [vscode-powershell #2292](https://github.com/PowerShell/PowerShellEditorServices/pull/1118) - - Isolate PSES dependencies from PowerShell on load + make PSES a pure binary module. -- ✨ 📟 [PowerShellEditorServices #1108](https://github.com/PowerShell/PowerShellEditorServices/pull/1108) - - Clear the terminal via the LSP message `editor/clearTerminal`. -- 🔍 🐛 [vscode-powershell #2319](https://github.com/PowerShell/PowerShellEditorServices/pull/1117) - - Run one invocation per SetBreakpoints request. (Thanks @SeeminglyScience!) -- 🐛 [PowerShellEditorServices #1114](https://github.com/PowerShell/PowerShellEditorServices/pull/1114) - - Fix `Import-EditorCommand -Module`. (Thanks @sk82jack!) -- 🐛 🔍 [PowerShellEditorServices #1112](https://github.com/PowerShell/PowerShellEditorServices/pull/1112) - - Fix breakpoint setting deadlock. -- 🔗 🐛 [vscode-powershell #2306](https://github.com/PowerShell/PowerShellEditorServices/pull/1110) - - Fix references on Windows due to bad WorkspacePath. -- ✨ 👷 [PowerShellEditorServices #993](https://github.com/PowerShell/PowerShellEditorServices/pull/993) - - Add devcontainer support for building in container. (Thanks @bergmeister!) -- 🛫 🐛 [vscode-powershell #2311](https://github.com/PowerShell/PowerShellEditorServices/pull/1107) - - Protect against no RootUri (no open workspace). -- 🐛 📟 [vscode-powershell #2274](https://github.com/PowerShell/PowerShellEditorServices/pull/1092) - - Fix '@' appearing in console. -- 👮‍ 🐛 [vscode-powershell #2288](https://github.com/PowerShell/PowerShellEditorServices/pull/1094) - - Use RootUri.LocalPath for workspace path. -- 🐛 👮‍ [PowerShellEditorServices #1101](https://github.com/PowerShell/PowerShellEditorServices/pull/1101) - - Add `PSAvoidAssignmentToAutomaticVariable` to the default set of PSSA rules. (Thanks @bergmeister!) -- 👮‍ 🔗 🐛 [vscode-powershell #2290](https://github.com/PowerShell/PowerShellEditorServices/pull/1098) - - Fix diagnostics not showing in untitled files and now also show CodeLens. -- 🔍 🐛 [vscode-powershell #1850](https://github.com/PowerShell/PowerShellEditorServices/pull/1097) - - Fixes no prompt showing up when debugging. -- 🚂 📺 🐛 [vscode-powershell #2284](https://github.com/PowerShell/PowerShellEditorServices/pull/1096) - - Fix running indicator by ignoring PSRL aborts. - -## v2019.11.0 -### Friday, November 1, 2019 - -##### Special Note -In this release of the preview extension, -we've merged significant architectural work into PowerShell Editor Services. -After several months of work, PSES now uses the Omnisharp LSP library -to handle Language Server Protocol interaction instead of rolling its own, -allowing PSES to concentrate on being a good PowerShell backend. -We hope you'll see increased performance and stability in this release. -As always, [please let us know if you find any issues](https://github.com/PowerShell/vscode-powershell/issues/new/choose). - -#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - -- 🔧 [vscode-PowerShell #2262](https://github.com/PowerShell/vscode-PowerShell/pull/2262) - - Introduce `powershell.integratedConsole.useLegacyReadline` setting disable PSReadLine. -- 🛫🐛[vscode-powershell #2217](https://github.com/PowerShell/vscode-PowerShell/pull/2238) - - Discover new PowerShell installations, fix startup issue with Windows PowerShell. -- 📺 [vscode-PowerShell #2225](https://github.com/PowerShell/vscode-PowerShell/pull/2225) - - Surface `InvokeRegisteredEditorCommand` in the Command Palette. (Thanks @jpogran!) -- 📺 [vscode-PowerShell #2224](https://github.com/PowerShell/vscode-PowerShell/pull/2224) - - Provide Run Selection button in editor title menu. (Thanks @jpogran!) -- 👷 [vscode-powershell #2229](https://github.com/PowerShell/vscode-PowerShell/pull/2232) - - Fix version check in Install-VSCode.ps1. -- 🚂 [vscode-PowerShell #2226](https://github.com/PowerShell/vscode-PowerShell/pull/2226) - - Changes needed for Omnisharp migration of PowerShellEditorServices. -- 🔍 [vscode-powershell #2144](https://github.com/PowerShell/vscode-PowerShell/pull/2223) - - Fix debugging restart capability by ensuring the session file is not deleted. - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- 🐛 [PowerShellEditorServices #1080](https://github.com/PowerShell/PowerShellEditorServices/pull/1080) - - Remove extra newline in GetComment feature. -- 🐛 [PowerShellEditorServices #1079](https://github.com/PowerShell/PowerShellEditorServices/pull/1079) - - Fix duplicate diagnostics caused by DidChange handler. -- 🔧 [PowerShellEditorServices #1076](https://github.com/PowerShell/PowerShellEditorServices/pull/1076) - - Graduate PSReadLine feature and add UseLegacyReadLine. -- ⚙️ [PowerShellEditorServices #1075](https://github.com/PowerShell/PowerShellEditorServices/pull/1075) - - Lock OmniSharp dependencies to v0.14.0. (Thanks @mholo65!) -- 📟 [PowerShellEditorServices #1064](https://github.com/PowerShell/PowerShellEditorServices/pull/1064) - - Add support for terminal error color settings in PS7. -- 🐛 [PowerShellEditorServices #1073](https://github.com/PowerShell/PowerShellEditorServices/pull/1073) - - Fix prerelease version discovery and fix omnisharp change. -- 🐛 [PowerShellEditorServices #1065](https://github.com/PowerShell/PowerShellEditorServices/pull/1065) - - Fix TEMP debugging. -- 🐛 [vscode-powershell #1753](https://github.com/PowerShell/PowerShellEditorServices/pull/1072) - - Override PSRL ReadKey on Windows as well. -- 🚂 [PowerShellEditorServices #1056](https://github.com/PowerShell/PowerShellEditorServices/pull/1056) - - Re-architect PowerShell Editor Services to use the Omnisharp LSP platform. -- 🐛 [vscode-powershell #2116](https://github.com/PowerShell/PowerShellEditorServices/pull/1044) - - Fix UNC intellisense backslash. - -## v2019.9.0 -### Monday, September 23, 2019 -#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - -- 👷 [vscode-powershell #1961](https://github.com/PowerShell/vscode-powershell/pull/1961) - - Changelog tools. -- 🐛 [vscode-powershell #2141](https://github.com/PowerShell/vscode-powershell/pull/2141) - - Null check on activeTerminal to workaround vscode behavior. -- ✨ [vscode-powershell #2105](https://github.com/PowerShell/vscode-powershell/pull/2105) - - Prompt to update PowerShell version. -- 🔎 [vscode-powershell #2165](https://github.com/PowerShell/vscode-powershell/pull/2165) - - Add powershell.codeFormatting.autoCorrectAliases setting to add support for optionally correcting aliases as well (added in PSSA 1.18.2). Disabled by default.. (Thanks @bergmeister!) -- ✨ [vscode-powershell #2160](https://github.com/PowerShell/vscode-powershell/pull/2160) - - Added functionality to install the User variant of Stable Edition. (Thanks @Lothindir!) -- ✨ [vscode-powershell #2156](https://github.com/PowerShell/vscode-powershell) - - Default to PowerShell Core on Windows if it's installed. (Thanks @SydneyhSmith!) -- ✨ [vscode-powershell #2084](https://github.com/PowerShell/vscode-powershell/pull/2084) - - Implement #1611 - provide dynamic debug config. (Thanks @rkeithhill!) -- ✨ [vscode-powershell #2024](https://github.com/PowerShell/vscode-powershell/pull/2039) - - Add machine scope per VS Code team request. -- ✨ [vscode-powershell #2081](https://github.com/PowerShell/vscode-powershell/pull/2081) - - Add param-block snippet. (Thanks @AspenForester!) -- 🧹 [vscode-powershell #2062](https://github.com/PowerShell/vscode-powershell/pull/2062) - - Remove redundant snippets. (Thanks @travis-c-lagrone!) -- ✨ [vscode-powershell #1974](https://github.com/PowerShell/vscode-powershell/pull/1974) - - Add #Requires snippets. (Thanks @travis-c-lagrone!) -- 🧹 [vscode-powershell #2063](https://github.com/PowerShell/vscode-powershell/pull/2063) - - Remove redundant community snippets. (Thanks @travis-c-lagrone!) -- 👷 [vscode-powershell #2065](https://github.com/PowerShell/vscode-powershell/pull/2065) - - Update '.vscode/settings.json' to identify snippet files as 'JSON with Comments'. (Thanks @travis-c-lagrone!) -- 📔 [vscode-powershell #2065](https://github.com/PowerShell/vscode-powershell) - - Docs updates. (Thanks @SydneyhSmith!) -- 👷 [vscode-powershell #2038](https://github.com/PowerShell/vscode-powershell/pull/2038) - - Add ADS insiders gallery file to update script. -- 🔎 [vscode-powershell #2037](https://github.com/PowerShell/vscode-powershell/pull/2037) - - Update PSScriptAnalyzer docs Url to point to master branch because master is now the default branch. (Thanks @bergmeister!) -- 🐛 [vscode-powershell #2035](https://github.com/PowerShell/vscode-powershell/pull/2035) - - #1019: Get format settings from document editor instead of global. (Thanks @tillig!) -- 👷 [vscode-powershell #2025](https://github.com/PowerShell/vscode-powershell/pull/2025) - - Fix node version detect logic to handle node v10. (Thanks @rkeithhill!) -- ✨ [vscode-powershell #1946](https://github.com/PowerShell/vscode-powershell/pull/1946) - - Add ArgumentCompleter snippets. (Thanks @travis-c-lagrone!) -- 🧹 [vscode-powershell #2015](https://github.com/PowerShell/vscode-powershell/pull/2015) - - Fix node types version. - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- 🐛 [PowerShellEditorServices #1022](https://github.com/PowerShell/PowerShellEditorServices/pull/1022) - - Catch stream exceptions for some Debug Adapter stability. -- 🔎 [PowerShellEditorServices #1021](https://github.com/PowerShell/PowerShellEditorServices/pull/1021) - - Add AutoCorrectAliases setting (PR to be made in VS-Code repo as well) to add support for optionally correcting aliases as well (added in PSSA 1.18.2). (Thanks @bergmeister!). -- 🐛 [vscode-powershell #1994](https://github.com/PowerShell/PowerShellEditorServices/pull/1000) - - Fix crash when setBreakpoint from VSCode sends a git:/ URI. -- 🧹 [PowerShellEditorServices #988](https://github.com/PowerShell/PowerShellEditorServices/pull/988) - - Remove consoleecho lib for PowerShell 7. -- 📔 [PowerShellEditorServices #986](https://github.com/PowerShell/PowerShellEditorServices) - - Documentation updates. (Thanks @SydneyhSmith!) -- ⚙️ [PowerShellEditorServices #981](https://github.com/PowerShell/PowerShellEditorServices/pull/981) - - Update NewtonSoft.Json dependency from 10.0.3 to 11.02 since PS 6.0 has been deprecated. (Thanks @bergmeister!) -- 🐛 [vscode-powershell #2007](https://github.com/PowerShell/PowerShellEditorServices/pull/974) - - Defend against crash when no PSScriptAnalyzer is found. -- 👷 [PowerShellEditorServices #978](https://github.com/PowerShell/PowerShellEditorServices/pull/977) - - Delete stale WebSocket code. - -## v2019.5.0 -### Wednesday, May 22, 2019 -#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - -- ✨ [vscode-PowerShell #1880](https://github.com/PowerShell/vscode-powershell/pull/1911) - - Move to date-based versioning -- ✨ [vscode-PowerShell #1954](https://github.com/PowerShell/vscode-PowerShell/pull/1954) - - Allow passing runspace name -- ✨ [vscode-PowerShell #1945](https://github.com/PowerShell/vscode-PowerShell/pull/1945) - - Edit snippets to support $TM_SELECTED_TEXT (Thanks @travis-c-lagrone!) -- 👷 [vscode-PowerShell #1942](https://github.com/PowerShell/vscode-PowerShell/pull/1942) - - Stop supporting 6.0 -- ✨ [vscode-PowerShell #1928](https://github.com/PowerShell/vscode-PowerShell/pull/1928) - - Add RunCode command for CodeLens providers -- 🐛 [vscode-PowerShell #1927](https://github.com/PowerShell/vscode-PowerShell/pull/1927) - - Fix change session by moving to async/await promise -- 🐛 [vscode-PowerShell #1931](https://github.com/PowerShell/vscode-PowerShell/pull/1931) - - Fix upload bug report -- 🐛 [vscode-PowerShell #1925](https://github.com/PowerShell/vscode-PowerShell/pull/1925) - - Fix error in HtmlContentView.ShowContent when no JS/CSS provided (Thanks @rkeithhill!) -- 🐛 [vscode-PowerShell #1919](https://github.com/PowerShell/vscode-PowerShell/pull/1919) - - Fix CustomViews by switching to WebViews -- 🐛 [vscode-PowerShell #1922](https://github.com/PowerShell/vscode-PowerShell/pull/1922) - - Fix small typo in Function-Inline description (Thanks @V-ed!) -- ✨ [vscode-PowerShell #1908](https://github.com/PowerShell/vscode-PowerShell/pull/1908) - - Add PowerShell version telemetry -- 📖 [vscode-PowerShell #1900](https://github.com/PowerShell/vscode-PowerShell/pull/1900) - - Small update to Azure Data Studio marketplace README (Thanks @SQLvariant!) -- 💻 [vscode-PowerShell #1871](https://github.com/PowerShell/vscode-PowerShell/pull/1871) - - Change CI to use Azure Pipelines -- 🐛 [vscode-PowerShell #1867](https://github.com/PowerShell/vscode-PowerShell/pull/1867) - - Change whitespace settings to camelCase -- 🐛 [vscode-PowerShell #1852](https://github.com/PowerShell/vscode-PowerShell/pull/1852) - - Turn `powershell.codeformatting.useCorrectCasing` setting off by default until PSScriptAnalyzer issues are fixed (Thanks @bergmeister!) -- 🐛 [vscode-powershell #1822](https://github.com/PowerShell/vscode-PowerShell/pull/1838) - - Set featureFlag default to null so that it can be resolved by settings -- 💻 [vscode-PowerShell #1839](https://github.com/PowerShell/vscode-PowerShell/pull/1839) - - Add initial credscan config ymls for CI -- 🐛 [vscode-PowerShell #1837](https://github.com/PowerShell/vscode-PowerShell/pull/1837) - - Don't use -EncodedCommand to start PowerShell on Windows -- 🐛 [vscode-PowerShell #1825](https://github.com/PowerShell/vscode-PowerShell/pull/1825) - - Switch to current lowercase names for powershell and mdlint extensions (Thanks @rkeithhill!) -- 👷 [vscode-PowerShell #1823](https://github.com/PowerShell/vscode-PowerShell/pull/1823) - - Update to official TSLint extension in extensions.json, old version deprecated (Thanks @rkeithhill!) - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- ✨ [PowerShellEditorServices #951](https://github.com/PowerShell/PowerShellEditorServices/pull/951) - - Allow passing RunspaceName -- 🚨 [PowerShellEditorServices #944](https://github.com/PowerShell/PowerShellEditorServices/pull/944) - - Add integration testing module with simple tests to verify PSES starts and stops -- 🐛 [PowerShellEditorServices #954](https://github.com/PowerShell/PowerShellEditorServices/pull/955) - - Ensure NamedPipeServerStream is assigned in Windows PowerShell -- ✨ [PowerShellEditorServices #952](https://github.com/PowerShell/PowerShellEditorServices/pull/952) - - Update to PSReadLine 2.0.0-beta4 -- ✨ [PowerShellEditorServices #877](https://github.com/PowerShell/PowerShellEditorServices/pull/877) - - Add filtering for CodeLens and References (Thanks @glennsarti!) -- 🐛 [vscode-powershell #1933](https://github.com/PowerShell/PowerShellEditorServices/pull/949) - - Stop crash when workspace doesn't exist -- 👷 [PowerShellEditorServices #878](https://github.com/PowerShell/PowerShellEditorServices/pull/878) - - Remove native named pipes implementation -- 🐛 [PowerShellEditorServices #947](https://github.com/PowerShell/PowerShellEditorServices/pull/947) - - Fix silent failure in VSCode WebViews by using Id for dictionary since multiple pages could have the same title -- 🐛 [PowerShellEditorServices #946](https://github.com/PowerShell/PowerShellEditorServices/pull/946) - - Rename to use async -- 👷 [PowerShellEditorServices #943](https://github.com/PowerShell/PowerShellEditorServices/pull/943) - - Improvements to the log parsing module (Thanks @rkeithhill!) -- 💻 [PowerShellEditorServices #921](https://github.com/PowerShell/PowerShellEditorServices/pull/921) - - Set up CI with Azure Pipelines -- 🐛 [PowerShellEditorServices #908](https://github.com/PowerShell/PowerShellEditorServices/pull/908) - - Fix issue with reference code lens not working with UNC paths (Thanks @rkeithhill!) -- 🐛 [vscode-powershell #1571](https://github.com/PowerShell/PowerShellEditorServices/pull/911) - - Fix faulty netfx check -- 🐛 [PowerShellEditorServices #906](https://github.com/PowerShell/PowerShellEditorServices/pull/906) - - Fix New-EditorFile with no folder or no files open -- ✨ [vscode-powershell #1398](https://github.com/PowerShell/PowerShellEditorServices/pull/902) - - Improve path auto-completion (Thanks @rkeithhill!) -- 🐛 [PowerShellEditorServices #910](https://github.com/PowerShell/PowerShellEditorServices/pull/910) - - Fix UseCorrectCasing to be actually configurable via `powershell.codeFormatting.useCorrectCasing` (Thanks @bergmeister!) -- 👷 [PowerShellEditorServices #909](https://github.com/PowerShell/PowerShellEditorServices/pull/909) - - Use global.json to pin .Net Core SDK version and update it from 2.1.402 to 2.1.602 (Thanks @bergmeister!) -- 👷 [PowerShellEditorServices #903](https://github.com/PowerShell/PowerShellEditorServices/pull/903) - - Move temp folder into repo to avoid state that causes build errors from time to time when rebuilding locally (and packages have updated) (Thanks @bergmeister!) -- 💻 [PowerShellEditorServices #904](https://github.com/PowerShell/PowerShellEditorServices/pull/904) - - Add initial credscan configuation ymls for CI -- 🐛 [PowerShellEditorServices #901](https://github.com/PowerShell/PowerShellEditorServices/pull/901) - - Switch to current lowercase names for powershell and mdlint exts (Thanks @rkeithhill!) - -## v2.0.0-preview.3 -### Wednesday, April 10, 2019 -#### [vscode-powershell](https://github.com/powershell/vscode-powershell) - -- [vscode-PowerShell #1865](https://github.com/PowerShell/vscode-powershell/pull/1867) - - Change casing of `powershell.codeformatting` settings for consistency: - - `powershell.codeformatting.WhitespaceInsideBrace` is now `powershell.codeformatting.whitespaceInsideBrace` - - `powershell.codeformatting.WhitespaceAroundPipe` is now `powershell.codeformatting.whitespaceAroundPipe` -- [vscode-PowerShell #1852](https://github.com/PowerShell/vscode-PowerShell/pull/1852) - - Turn `powershell.codeformatting.useCorrectCasing` setting off by default until PSSA issues are fixed (Thanks @bergmeister!) -- [vscode-PowerShell #1838](https://github.com/PowerShell/vscode-PowerShell/pull/1838) - - Set PSReadLine featureFlag default to null so that it can be resolved by settings -- [vscode-PowerShell #1837](https://github.com/PowerShell/vscode-PowerShell/pull/1837) - - Do not use -EncodedCommand on Windows -- [vscode-PowerShell #1825](https://github.com/PowerShell/vscode-PowerShell/pull/1825) - - Switch to current lowercase names for powershell and mdlint recommended extensions (Thanks @rkeithhill!) -- [vscode-PowerShell #1823](https://github.com/PowerShell/vscode-PowerShell/pull/1823) - - Update to official TSLint ext in extensions.json, old version deprecated (Thanks @rkeithhill!) - -#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) - -- [PowerShellEditorServices #902](https://github.com/PowerShell/PowerShellEditorServices/pull/902) - - Improve path auto-completion (Thanks @rkeithhill!) -- [PowerShellEditorServices #910](https://github.com/PowerShell/PowerShellEditorServices/pull/910) - - Fix UseCorrectCasing to be actually configurable via `powershell.codeFormatting.useCorrectCasing` (Thanks @bergmeister!) -- [PowerShellEditorServices #909](https://github.com/PowerShell/PowerShellEditorServices/pull/909) - - Use global.json to pin .Net Core SDK version and update it from 2.1.402 to 2.1.602 (Thanks @bergmeister!) -- [PowerShellEditorServices #903](https://github.com/PowerShell/PowerShellEditorServices/pull/903) - - Move temp folder into repo to avoid state that causes build errors from time to time when rebuilding locally (and packages have updated) (Thanks @bergmeister!) - -## v2.0.0-preview.2 -### Friday, March 29, 2019 - -### Highlights - -* `Write-Progress` work in the integrated console ⏰ -* Support for [PSScriptAnalyzer 1.18](https://github.com/PowerShell/PSScriptAnalyzer/releases/tag/1.18.0) 📝 -* The ability to debug any runspace in any process 🔎 -* PSReadLine enabled by default on Windows 🎨 -* (Bug fix!) You can open untitled workspaces/folders again! 🐛☠️ - -There are a lot more goodies in this version. Checkout the changelog below! - -#### [vscode-powershell](https://github.com/powershell/vscode-powershell) - -- [vscode-PowerShell #1794](https://github.com/PowerShell/vscode-PowerShell/pull/1794) - - Make PSReadLine default on Windows -- [vscode-PowerShell #1736](https://github.com/PowerShell/vscode-PowerShell/pull/1736) - - Enable attach to process on Linux and macOS -- [vscode-PowerShell #1729](https://github.com/PowerShell/vscode-PowerShell/pull/1729) - - Handle Pester Describe block strings with single quotes inside it (Thanks @bergmeister!) -- [vscode-PowerShell #1741](https://github.com/PowerShell/vscode-PowerShell/pull/1741) - - Update build to clear node modules directory (Thanks @corbob!) -- [vscode-PowerShell #1743](https://github.com/PowerShell/vscode-PowerShell/pull/1743) - - Fix right-click help lookup not always working (Thanks @corbob!) -- [vscode-PowerShell #1746](https://github.com/PowerShell/vscode-PowerShell/pull/1746) - - Add label property to debug config, change pkg name to lowercase (Thanks @rkeithhill!) -- [vscode-PowerShell #1749](https://github.com/PowerShell/vscode-PowerShell/pull/1749) - - Add the Install-VSCode.ps1 script to signing -- [vscode-PowerShell #1747](https://github.com/PowerShell/vscode-PowerShell/pull/1747) - - Modify `powerShellDefaultVersion` description to make clearer (Thanks @rkeithhill!) -- [vscode-PowerShell #1755](https://github.com/PowerShell/vscode-PowerShell/pull/1755) - - Speed up Travis builds by skipping the .NET Core initialization (Thanks @bergmeister!) -- [vscode-PowerShell #1773](https://github.com/PowerShell/vscode-PowerShell/pull/1773) - - Change debugger type field back to `PowerShell` from `powershell` (Thanks @rkeithhill!) -- [vscode-PowerShell #1757](https://github.com/PowerShell/vscode-PowerShell/pull/1757) - - Match Install-VSCode.ps1 script url with the one from master branch (Thanks @rafaltra!) -- [vscode-PowerShell #1774](https://github.com/PowerShell/vscode-PowerShell/pull/1774) - - Switch to `EncodedCommand` for script execution -- [vscode-PowerShell #1764](https://github.com/PowerShell/vscode-PowerShell/pull/1764) - - Added Pester, ShouldProcess and Calculated Property PS Snippets (Thanks @brettmillerb!) -- [vscode-PowerShell #1776](https://github.com/PowerShell/vscode-PowerShell/pull/1776) - - Migrate Pester version detection into an InovkePester stub script (Thanks @rkeithhill!) -- [vscode-PowerShell #1781](https://github.com/PowerShell/vscode-PowerShell/pull/1781) - - Fix initial launch config casing -- [vscode-PowerShell #1775](https://github.com/PowerShell/vscode-PowerShell/pull/1775) - - Support `-CustomPipeName`, allowing configuration of custom namedpipes for LSP transport -- [vscode-PowerShell #1787](https://github.com/PowerShell/vscode-PowerShell/pull/1787) - - Added SQL PowerShell Examples (Thanks @SQLvariant!) -- [vscode-PowerShell #1782](https://github.com/PowerShell/vscode-PowerShell/pull/1782) - - Add Debug Runspace command (Thanks @adamdriscoll!) -- [vscode-PowerShell #1800](https://github.com/PowerShell/vscode-PowerShell/pull/1800) - - Include current runspace and runspace ID 1 in the PSHostProcess picker dialog -- [vscode-PowerShell #1687](https://github.com/PowerShell/vscode-PowerShell/pull/1687) - - Add new `powershell.useCorrectCasingsettings` for new rule in PSSA 1.18: PSUseCorrectCasing (Thanks @bergmeister!) -- [vscode-PowerShell #1668](https://github.com/PowerShell/vscode-PowerShell/pull/1668) - - Add new `powershell.codeFormatting` settings for new options in PSSA 1.18: WhitespaceInsideBrace and WhitespaceAroundPipe (Thanks @bergmeister!) -- [vscode-PowerShell #1669](https://github.com/PowerShell/vscode-PowerShell/pull/1669) - - Add new `powershell.codeFormatting` settings for new options in PSSA 1.18: PipelineIndentationStyle (Thanks @bergmeister!) -- [vscode-PowerShell #1738](https://github.com/PowerShell/vscode-PowerShell/pull/1738) - - Set CommandExplorer exclusion filter to be empty array by default (Thanks @adilio!) -- [vscode-PowerShell #1686](https://github.com/PowerShell/vscode-PowerShell/pull/1686) - - Add an exclusion filter to the Command Explorer (Thanks @corbob!) -- [vscode-PowerShell #1816](https://github.com/PowerShell/vscode-PowerShell/pull/1816) - - Workaround PSSA #1187 by defaulting to NoIndentation - -#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) - -- [PowerShellEditorServices #895](https://github.com/PowerShell/PowerShellEditorServices/pull/895) - - Add warning to parameter validation set (Thanks @Benny1007!) -- [PowerShellEditorServices #897](https://github.com/PowerShell/PowerShellEditorServices/pull/897) - - Clean up and pop dead runspaces when using 'attach' debugging -- [PowerShellEditorServices #888](https://github.com/PowerShell/PowerShellEditorServices/pull/888) - - Add new ParseError level to ScriptFileMarkerLevel and filter out PSSA parse errors -- [PowerShellEditorServices #858](https://github.com/PowerShell/PowerShellEditorServices/pull/858) - - Fix XUnit warnings that better assertion operators should be used. (Thanks @bergmeister!) -- [PowerShellEditorServices #854](https://github.com/PowerShell/PowerShellEditorServices/pull/854) - - Reinstate test filtering (Thanks @glennsarti!) -- [PowerShellEditorServices #866](https://github.com/PowerShell/PowerShellEditorServices/pull/866) - - Catch NotSupportedException which can be thrown by FileStream constructor (Thanks @rkeithhill!) -- [PowerShellEditorServices #868](https://github.com/PowerShell/PowerShellEditorServices/pull/868) - - Speed up Travis builds by skipping the .NET Core initialization (Thanks @bergmeister!) -- [PowerShellEditorServices #869](https://github.com/PowerShell/PowerShellEditorServices/pull/869) - - Added `AsNewFile` switch to Out-CurrentFile (Thanks @dfinke!) -- [PowerShellEditorServices #873](https://github.com/PowerShell/PowerShellEditorServices/pull/873) - - Return the start line number for Describe block (Thanks @rkeithhill!) -- [PowerShellEditorServices #876](https://github.com/PowerShell/PowerShellEditorServices/pull/876) - - Temporarily disable deemphasized stack frames to fix VSCode issue 1750 (Thanks @rkeithhill!) -- [PowerShellEditorServices #871](https://github.com/PowerShell/PowerShellEditorServices/pull/871) - - Support -CustomPipeName, allowing configuration of custom namedpipes for LSP transport -- [PowerShellEditorServices #872](https://github.com/PowerShell/PowerShellEditorServices/pull/872) - - Fix unable to open files in problems/peek windows issue (Thanks @rkeithhill!) -- [PowerShellEditorServices #875](https://github.com/PowerShell/PowerShellEditorServices/pull/875) - - Add attach to local runspace. (Thanks @adamdriscoll!) -- [PowerShellEditorServices #881](https://github.com/PowerShell/PowerShellEditorServices/pull/881) - - Use `NamedPipeConnectionInfo` to connect to remote runspaces instead of Enter-PSHostProcess -- [PowerShellEditorServices #845](https://github.com/PowerShell/PowerShellEditorServices/pull/845) - - Enable UseCorrectCasing as a default rule (Thanks @bergmeister!) -- [PowerShellEditorServices #835](https://github.com/PowerShell/PowerShellEditorServices/pull/835) - - Map new `powershell.codeformatting` settings WhitespaceInsideBrace and WhitespaceAroundPipe to PSSA settings hashtable (Thanks @bergmeister!) -- [PowerShellEditorServices #836](https://github.com/PowerShell/PowerShellEditorServices/pull/836) - - Add PipelineIndentationStyle configuration mapping (Thanks @bergmeister!) -- [PowerShellEditorServices #887](https://github.com/PowerShell/PowerShellEditorServices/pull/887) - - Cherry pick PR 1750 merge commit to legacy/v1.x, has additional fixes (Thanks @rkeithhill!) -- [PowerShellEditorServices #874](https://github.com/PowerShell/PowerShellEditorServices/pull/874) - - Use public `InternalHost` from origin runspace (Thanks @SeeminglyScience!) -- [PowerShellEditorServices #889](https://github.com/PowerShell/PowerShellEditorServices/pull/889) - - Enhance Get-PsesRpcNotificationMessage/MessageResponseTimes to allow filtering by message name (Thanks @rkeithhill!) -- [PowerShellEditorServices #859](https://github.com/PowerShell/PowerShellEditorServices/pull/859) - - Upgrade PowerShellStandard.Library, PowerShell.SDK, NET.Test.SDK and Serilog NuGet packages to latest released version and enable AppVeyor build on any branch (Thanks @bergmeister!) -- [PowerShellEditorServices #862](https://github.com/PowerShell/PowerShellEditorServices/pull/862) - - Handle arbitrary exceptions when recursing workspace - -## v2.0.0-preview.1 -### Wednesday, January 23, 2019 - -#### Preview builds of the PowerShell extension are now available in VSCode - -We are excited to announce the PowerShell Preview extension in the VSCode marketplace! -The PowerShell Preview extension allows users on Windows PowerShell 5.1 and PowerShell Core 6 to get and test the latest updates -to the PowerShell extension and comes with some exciting features. - -The PowerShell Preview extension is a substitute for the PowerShell extension so -both the PowerShell extension and the PowerShell Preview extension should not be enabled at the same time. - -By having a preview channel, in addition to our existing stable channel, we can get new features out faster and get feedback faster from you, the users. - -##### How to Get/Use the PowerShell Preview extension - -If you dont already have VSCode, start [here](https://code.visualstudio.com/Docs/setup/setup-overview). - -Once you have VSCode open, click `Clt+Shift+X` to open the extensions marketplace. -Next, type `PowerShell Preview` in the search bar. -Click `Install` on the `PowerShell Preview` page. -Finally, click `Reload` in order to refresh VSCode. - -If you already have the PowerShell extension, please disable it to use the Powershell Preview extension. -To disable the PowerShell extension, find it in the Extensions sidebar view, specifically under the list of Enabled extensions, -Right-click on the PowerShell extension and select `Disable`. -Please note that it is important to only have either the PowerShell extension or the PowerShell Preview extension enabled at one time. -![How to Disable](https://github.com/PowerShell/powershell.github.io/blob/master/PowerShell-Blog/Images/disable-extension.jpg) - -#### What the first preview contains - -The v2.0.0-preview.1 version of the extension is built on .NET Standard -(enabling support for both Windows PowerShell and PowerShell Core from one assembly) - -It also contains PSReadLine support in the integrated console for Windows behind a feature flag. -PSReadLine provides a consistent and rich interactive experience, -including syntax coloring and multi-line editing and history, in the PowerShell console, in Cloud Shell, -and now in VSCode terminal. For more information on the benefits of PSReadLine, -check out their [documentation](https://docs.microsoft.com/en-us/powershell/module/psreadline/about/about_psreadline?view=powershell-6). - -To enable PSReadLine support in the Preview version on Windows, please add the following to your user settings: - -``` -"powershell.developer.featureFlags": [ "PSReadLine" ] -``` - -HUGE thanks to @SeeminglyScience for all his amazing work getting PSReadLine working in PowerShell Editor Services! - -#### Breaking Changes - -As stated above, this version of the PowerShell extension only works with Windows PowerShell versions 5.1 and PowerShell Core 6. - -#### [vscode-powershell](https://github.com/powershell/vscode-powershell) - -- [vscode-PowerShell #1587](https://github.com/PowerShell/vscode-PowerShell/pull/1587) - - Removed ShowOnlineHelp Command (Thanks @corbob!) - -#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) - -- [PowerShellEditorServices #792](https://github.com/PowerShell/PowerShellEditorServices/pull/792) - - Add Async suffix to async methods (Thanks @dee-see!) -- [PowerShellEditorServices #775](https://github.com/PowerShell/PowerShellEditorServices/pull/775) - - Removed ShowOnlineHelp Message (Thanks @corbob!) -- [PowerShellEditorServices #769](https://github.com/PowerShell/PowerShellEditorServices/pull/769) - - Set Runspaces to use STA when running in Windows PowerShell -- [PowerShellEditorServices #741](https://github.com/PowerShell/PowerShellEditorServices/pull/741) - - Migrate to netstandard2.0 and PSStandard -- [PowerShellEditorServices #672](https://github.com/PowerShell/PowerShellEditorServices/pull/672) - - PSReadLine integration (Thanks @SeeminglyScience!) - -## v1.10.2 -### Tuesday, December 18, 2018 - -#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) - -- [vscode-PowerShell #1632](https://github.com/PowerShell/vscode-powershell/pull/1632) - - Started [a document for ISE-like configuration of VSCode](https://github.com/PowerShell/vscode-powershell/blob/master/docs/ise_compatibility.md). - Please help us build it out by [contirbuting an edit](https://github.com/PowerShell/vscode-powershell/edit/master/docs/ise_compatibility.md). - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- [PowerShellEditorServices #811](https://github.com/PowerShell/PowerShellEditorServices/pull/805) - - Fix token-based folding (thanks @glennsarti!) -- [PowerShellEditorServices #823](https://github.com/PowerShell/PowerShellEditorServices/pull/823) - - Fix case-sensitivity of Pester CodeLens (thanks @bergmeister!) -- [PowerShellEditorServices #815](https://github.com/PowerShell/PowerShellEditorServices/pull/815) - - Fix crash when untitled files opened as PowerShell -- [PowerShellEditorServices #826](https://github.com/PowerShell/PowerShellEditorServices/pull/826) - - Fix crash when duplicate references are present in the same file - -## v1.10.1 -### Friday, December 7, 2018 - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- [PowerShellEditorServices #808](https://github.com/PowerShell/PowerShellEditorServices/pull/808) - - Fix startup crash on Windows 7 -- [PowerShellEditorServices #807](https://github.com/PowerShell/PowerShellEditorServices/pull/807) - - Fix deadlock occurring while connecting to named pipes - -## v1.10.0 -### Monday, December 3, 2018 -#### [vscode-powershell](https://github.com/PowerShell/vscode-powershell) - -- [vscode-PowerShell #1610](https://github.com/PowerShell/vscode-powershell/pull/1610) - - Remove client-side syntax folding provider in favor of server-side provider (thanks @glennsarti!) -- [vscode-PowerShell #1616](https://github.com/PowerShell/vscode-powershell/pull/1616) - - Make `Restart Current Session` always available in the session quick pick -- [vscode-PowerShell #1406](https://github.com/PowerShell/vscode-powershell/pull/1406) - - Add a Show-Command explorer (thanks @corbob!) -- [vscode-PowerShell #1615](https://github.com/PowerShell/vscode-powershell/pull/1615) - - Fix Pester CodeLens not working for running/debugging tests (thanks @rkeithhill!) -- [vscode-PowerShell #1600](https://github.com/PowerShell/vscode-powershell/pull/1608) - - Add CodeAction support to show PSSA rule documentation (thanks @rkeithhill!) -- [vscode-PowerShell #1606](https://github.com/PowerShell/vscode-powershell/pull/1606) - - Add Ctrl+Alt+J (Cmd+Alt+J on macOS) - keybinding to open up list of available snippets -- [vscode-PowerShell #1597](https://github.com/PowerShell/vscode-powershell/pull/1597) - - Make `Install-VSCode.ps1` work on macOS and Linux. Get the script [here](https://github.com/PowerShell/vscode-powershell/blob/master/scripts/Install-VSCode.ps1) -- [vscode-PowerShell #1580](https://github.com/PowerShell/vscode-powershell/pull/1580) - - `New-EditorFile` works on non-PowerShell untitled files -- [vscode-PowerShell #1557](https://github.com/PowerShell/vscode-powershell/pull/1557) - - Default to showing the last line in folded regions. Unset with `"powershell.codeFolding.showLastLine": false` - (thanks @glennsarti!) -- [vscode-PowerShell #1567](https://github.com/PowerShell/vscode-powershell/pull/1567) - - New snippet: Exchange Online connection (thanks @vmsilvamolina!) -- [vscode-PowerShell #1567](https://github.com/PowerShell/vscode-powershell/pull/1567) - - New snippet: HTML header (thanks @vmsilvamolina!) -- [vscode-PowerShell #1555](https://github.com/PowerShell/vscode-powershell/pull/1555) - - Log when language client not loaded during initialization (thanks @corbob!) -- [vscode-PowerShell #1554](https://github.com/PowerShell/vscode-powershell/pull/1554) - - Fix spacing in parameters when starting the extension (thanks @rkeithhill!) - -#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) - -- [PowerShellEditorServices #786](https://github.com/PowerShell/PowerShellEditorServices/pull/786) - - Fix #17: Add go to definition support for dot sourced file paths (Thanks @dee-see!) -- [PowerShellEditorServices #767](https://github.com/PowerShell/PowerShellEditorServices/pull/767) - - Change unhandled messages to warnings instead of errors -- [PowerShellEditorServices #765](https://github.com/PowerShell/PowerShellEditorServices/pull/765) - - Fix PowerShell wildcard escaping in debug paths -- [PowerShellEditorServices #778](https://github.com/PowerShell/PowerShellEditorServices/pull/778) - - Fix multiple occurrences of the same typo (Thanks @dee-see!) -- [PowerShellEditorServices #782](https://github.com/PowerShell/PowerShellEditorServices/pull/782) - - Fix #779: NRE on Dispose in ExecutionTimer (Thanks @dee-see!) -- [PowerShellEditorServices #772](https://github.com/PowerShell/PowerShellEditorServices/pull/772) - - Log build info -- [PowerShellEditorServices #774](https://github.com/PowerShell/PowerShellEditorServices/pull/774) - - New-EditorFile works on non-powershell untitled files -- [PowerShellEditorServices #787](https://github.com/PowerShell/PowerShellEditorServices/pull/787) - - Fix descion/decision typo in visitors (Thanks @dee-see!) -- [PowerShellEditorServices #784](https://github.com/PowerShell/PowerShellEditorServices/pull/784) - - Replace bad StringReader usage with String.Split() -- [PowerShellEditorServices #768](https://github.com/PowerShell/PowerShellEditorServices/pull/768) - - Make pipeline runtime exceptions warnings in log -- [PowerShellEditorServices #790](https://github.com/PowerShell/PowerShellEditorServices/pull/790) - - Add managed thread id to log output to add debugging threading issues (Thanks @rkeithhill!) -- [PowerShellEditorServices #794](https://github.com/PowerShell/PowerShellEditorServices/pull/794) - - Fix Pester CodeLens run/debug by not quoting params/already quoted args (Thanks @rkeithhill!) -- [PowerShellEditorServices #785](https://github.com/PowerShell/PowerShellEditorServices/pull/785) - - Adds ability to use separate pipes for reading and writing (Thanks @ant-druha!) -- [PowerShellEditorServices #796](https://github.com/PowerShell/PowerShellEditorServices/pull/796) - - Code cleanup of the start script and ESHost.cs file (Thanks @rkeithhill!) -- [PowerShellEditorServices #795](https://github.com/PowerShell/PowerShellEditorServices/pull/795) - - Fix file recursion overflow problems -- [PowerShellEditorServices #697](https://github.com/PowerShell/PowerShellEditorServices/pull/697) - - Add functionality to allow a Show-Command like panel in VS Code (Thanks @corbob!) -- [PowerShellEditorServices #777](https://github.com/PowerShell/PowerShellEditorServices/pull/777) - - Add syntax folding (Thanks @glennsarti!) -- [PowerShellEditorServices #801](https://github.com/PowerShell/PowerShellEditorServices/pull/801) - - Fix local remoting -- [PowerShellEditorServices #797](https://github.com/PowerShell/PowerShellEditorServices/pull/797) - - Start of a PSES log file analyzer (Thanks @rkeithhill!) -- [PowerShellEditorServices #789](https://github.com/PowerShell/PowerShellEditorServices/pull/789) - - Add support for a "Show Documentation" quick fix menu entry (Thanks @rkeithhill!) -- [PowerShellEditorServices #760](https://github.com/PowerShell/PowerShellEditorServices/pull/760) - - Fix exception when remoting from Windows to non-Windows (Thanks @SeeminglyScience!) - -## v1.9.0 -### Thursday, September 27, 2018 -#### [vscode-powershell](https://github.com/powershell/vscode-powershell) - -- [vscode-PowerShell #1548](https://github.com/PowerShell/vscode-PowerShell/pull/1548) - - Explicitly return `undefined` from resolveDbgConfig when session not started (Thanks @rkeithhill!) -- [vscode-PowerShell #1516](https://github.com/PowerShell/vscode-PowerShell/pull/1516) - - Change "Get Online Help" menu item label to "Get Help" (Thanks @corbob!) -- [vscode-PowerShell #1525](https://github.com/PowerShell/vscode-PowerShell/pull/1525) - - Remove duplicate/overlapping folding regions (Thanks @glennsarti!) - -#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) - -- [PowerShellEditorServices #750](https://github.com/PowerShell/PowerShellEditorServices/pull/750) - - Fix issue where # in path causes the path to resolve incorrectly -- [PowerShellEditorServices #721](https://github.com/PowerShell/PowerShellEditorServices/pull/721) - - Change Get-Help behavior to return local help when online help can't be displayed (Thanks @corbob!) -- [PowerShellEditorServices #748](https://github.com/PowerShell/PowerShellEditorServices/pull/748) - - Fix index out-of-range exception when deleting script files -- [PowerShellEditorServices #749](https://github.com/PowerShell/PowerShellEditorServices/pull/749) - - Fix crash for finding symbols on bad paths -- [PowerShellEditorServices #740](https://github.com/PowerShell/PowerShellEditorServices/pull/740) - - Fix inner help completion -- [PowerShellEditorServices #736](https://github.com/PowerShell/PowerShellEditorServices/pull/736) - - Cache the reflection call done for completions -- [PowerShellEditorServices #737](https://github.com/PowerShell/PowerShellEditorServices/pull/737) - - Remove LINQ usage in language service methods -- [PowerShellEditorServices #743](https://github.com/PowerShell/PowerShellEditorServices/pull/743) - - Remove unnecessary LINQ calls from LanguageServer - -## v1.8.4 -### Friday, August 31, 2018 -#### [vscode-powershell](https://github.com/powershell/vscode-powershell) - -- [vscode-PowerShell #1489](https://github.com/PowerShell/vscode-PowerShell/pull/1489) - - Use asynchronous logic for help completions -- [vscode-PowerShell #1477](https://github.com/PowerShell/vscode-PowerShell/pull/1477) - - Add BitsTransfer & user switch to install latest user profile insiders edition with Install-VSCode.ps1 script (Thanks @tabs-not-spaces!) -- [vscode-PowerShell #1485](https://github.com/PowerShell/vscode-PowerShell/pull/1485) - - Increase connection timeout - -#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) - -- [PowerShellEditorServices #728](https://github.com/PowerShell/PowerShellEditorServices/pull/728) - - Fix formatter crash when script contains parse errors -- [PowerShellEditorServices #730](https://github.com/PowerShell/PowerShellEditorServices/pull/730) - - Fix crash where lines appended to end of script file causes out of bounds exception -- [PowerShellEditorServices #732](https://github.com/PowerShell/PowerShellEditorServices/pull/732) - - Fix CodeLens crash when a file cannot be opened, stop unnecessary file reads in CodeLens -- [PowerShellEditorServices #729](https://github.com/PowerShell/PowerShellEditorServices/pull/729) - - Fix a null dereference when an invalid cast exception has no inner exception -- [PowerShellEditorServices #719](https://github.com/PowerShell/PowerShellEditorServices/pull/719) - - Reduce allocations in the CodeLens providers -- [PowerShellEditorServices #725](https://github.com/PowerShell/PowerShellEditorServices/pull/725) - - Fix null dereference when debugging untitlted filesj -- [PowerShellEditorServices #726](https://github.com/PowerShell/PowerShellEditorServices/pull/726) - - Fix comment-based help snippet - - -## v1.8.3 -### Wednesday, August 15, 2018 - -#### [vscode-powershell](https://github.com/powershell/vscode-powershell) - -- [PowerShell/vscode-powershell #1480](https://github.com/PowerShell/vscode-powershell/pull/1480) - - Use PowerShell signing script in VSTS builds -- [PowerShell/vscode-powershell #1460](https://github.com/PowerShell/vscode-powershell/pull/1460) - - Use newer version for preleases -- [PowerShell/vscode-powershell #1475](https://github.com/PowerShell/vscode-powershell/pull/1475) - - Change resourceLangId to editorLangId so right-click works properly with unsaved files (Thanks @corbob!) -- [PowerShell/vscode-powershell #1467](https://github.com/PowerShell/vscode-powershell/pull/1467) - - Remove region folding from non-region areas (Thanks @glennsarti!) - - #### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) - -- [PowerShell/PowerShellEditorServices #722](https://github.com/PowerShell/PowerShellEditorServices/pull/722) - - Add VSTS signing step -- [PowerShell/PowerShellEditorServices #717](https://github.com/PowerShell/PowerShellEditorServices/pull/717) - - Increment version for prerelease -- [PowerShell/PowerShellEditorServices #715](https://github.com/PowerShell/PowerShellEditorServices/pull/715) - - Reduce allocations when parsing files (Thanks @mattpwhite!) - -## v1.8.2 -### Thursday, July 26, 2018 - -#### [vscode-powershell](https://github.com/powershell/vscode-powershell) - -- [PowerShell/vscode-powershell #1438](https://github.com/PowerShell/vscode-powershell/pull/1438) - - Fix detecting contiguous comment blocks and regions (Thanks @glennsarti!) -- [PowerShell/vscode-powershell #1436](https://github.com/PowerShell/vscode-powershell/pull/1436) - - First approach to fix issue with dbg/run start before PSES running (Thanks @rkeithhill!) - -#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) - -- [PowerShell/PowerShellEditorServices #712](https://github.com/PowerShell/PowerShellEditorServices/pull/712) - - workaround to support inmemory:// -- [PowerShell/PowerShellEditorServices #706](https://github.com/PowerShell/PowerShellEditorServices/pull/706) - - Go To Definition works with different Ast types -- [PowerShell/PowerShellEditorServices #707](https://github.com/PowerShell/PowerShellEditorServices/pull/707) - - fix stdio passing -- [PowerShell/PowerShellEditorServices #709](https://github.com/PowerShell/PowerShellEditorServices/pull/709) - - Stop Diagnostic logging from logging to stdio when the communication protocol is set to stdio -- [PowerShell/PowerShellEditorServices #710](https://github.com/PowerShell/PowerShellEditorServices/pull/710) - - stdio should only launch language service not debug -- [PowerShell/PowerShellEditorServices #705](https://github.com/PowerShell/PowerShellEditorServices/pull/705) - - Fix load order of PSSA modules -- [PowerShell/PowerShellEditorServices #704](https://github.com/PowerShell/PowerShellEditorServices/pull/704) - - Do not enable PSAvoidTrailingWhitespace rule by default as it currenly flags whitespace-only lines as well (Thanks @bergmeister!) - -## v1.8.1 -### Wednesday, July 11, 2018 - -- [PowerShell/vscode-powershell #1418](https://github.com/PowerShell/vscode-powershell/pull/1418) - - Fix code folding in documents using CRLF newlines. (Thanks @glennsarti!) - -## v1.8.0 -### Tuesday, July 10, 2018 - -- [PowerShell/vscode-powershell #1238](https://github.com/PowerShell/vscode-powershell/pull/1238) - - Added functionality to install the VSCode context menus. (Thanks @detlefs!) -- [PowerShell/vscode-powershell #1354](https://github.com/PowerShell/vscode-powershell/pull/1354) - - Edit snippet to fix issue #1353 (Thanks @kilasuit!) -- [PowerShell/vscode-powershell #1362](https://github.com/PowerShell/vscode-powershell/pull/1362) - - Updated Pester Problem Matcher (Thanks @awickham10!) -- [PowerShell/vscode-powershell #1359](https://github.com/PowerShell/vscode-powershell/pull/1359) - - (maint) Add visual ruler for line length (Thanks @glennsarti!) -- [PowerShell/vscode-powershell #1344](https://github.com/PowerShell/vscode-powershell/pull/1344) - - Update to TypeScript 2.9.x (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1323](https://github.com/PowerShell/vscode-powershell/pull/1323) - - SpecProcId - interactive var replacement supports only string type (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1327](https://github.com/PowerShell/vscode-powershell/pull/1327) - - Switch to named pipes -- [PowerShell/vscode-powershell #1321](https://github.com/PowerShell/vscode-powershell/pull/1321) - - GitHub issue template tweaks and add PSSA template (Thanks @bergmeister!) -- [PowerShell/vscode-powershell #1320](https://github.com/PowerShell/vscode-powershell/pull/1320) - - Take advantage of multiple issue templates (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1317](https://github.com/PowerShell/vscode-powershell/pull/1317) - - Change SpecifyScriptArgs command to only return string - not string[] (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1318](https://github.com/PowerShell/vscode-powershell/pull/1318) - - Update package veresion in lock file, format package.json file. (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1312](https://github.com/PowerShell/vscode-powershell/pull/1312) - - Updates to Examples PSSA settings file to include more rule config (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1305](https://github.com/PowerShell/vscode-powershell/pull/1305) - - Make SaveAs work for untitled files -- [PowerShell/vscode-powershell #1307](https://github.com/PowerShell/vscode-powershell/pull/1307) - - Added Columns, Improved readability for ToC. (Thanks @st0le!) -- [PowerShell/vscode-powershell #1368](https://github.com/PowerShell/vscode-powershell/pull/1368) - - Add new snippet for #region (#1368) (Thanks @lipkau!) -- [PowerShell/vscode-powershell #1416](https://github.com/PowerShell/vscode-powershell/pull/1416) - - (GH-1413) Resolve promise correctly in Folding feature (Thanks @glennsarti!) -- [PowerShell/vscode-powershell #1412](https://github.com/PowerShell/vscode-powershell/pull/1412) - - Set the extension's log level based on settings value (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1411](https://github.com/PowerShell/vscode-powershell/pull/1411) - - Escape paths w/single quotes before passing to powershell in single-quoted strings (#1411) (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1409](https://github.com/PowerShell/vscode-powershell/pull/1409) - - Rename file to match type name (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1408](https://github.com/PowerShell/vscode-powershell/pull/1408) - - Restore ability to start debug session when script run in PSIC hits breakpoint (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1407](https://github.com/PowerShell/vscode-powershell/pull/1407) - - Scroll the terminal to bottom for F8 executionPartial fix #1257 (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1414](https://github.com/PowerShell/vscode-powershell/pull/1414) - - Update grammar parsing for vscode-textmate v4 module (Thanks @glennsarti!) -- [PowerShell/vscode-powershell #1397](https://github.com/PowerShell/vscode-powershell/pull/1397) - - Allow debugging in interactive session with no dir change (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1402](https://github.com/PowerShell/vscode-powershell/pull/1402) - - Move lint directive after the file-header to fix lint error (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1366](https://github.com/PowerShell/vscode-powershell/pull/1366) - - Add support for side-by-side PS Core preview on Linux/macOS (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1391](https://github.com/PowerShell/vscode-powershell/pull/1391) - - Add PowerShell Online Help lookup to context menu (Thanks @corbob!) -- [PowerShell/vscode-powershell #1396](https://github.com/PowerShell/vscode-powershell/pull/1396) - - Add tslint rule file-header to enforce copyright in TS files (Thanks @rkeithhill!) -- [PowerShell/vscode-powershell #1355](https://github.com/PowerShell/vscode-powershell/pull/1355) - - Add syntax aware folding provider (Thanks @glennsarti!) -- [PowerShell/vscode-powershell #1395](https://github.com/PowerShell/vscode-powershell/pull/1395) - - Update community_snippets.md (Thanks @fullenw1!) -- [PowerShell/vscode-powershell #1382](https://github.com/PowerShell/vscode-powershell/pull/1382) - - Fix markdown syntax (Thanks @lipkau!) -- [PowerShell/vscode-powershell #1369](https://github.com/PowerShell/vscode-powershell/pull/1369) - - Update README.md with kbds and what to do if you find a vulnerability -- [PowerShell/vscode-powershell #1297](https://github.com/PowerShell/vscode-powershell/pull/1297) - - Added some snippets (#1297) (Thanks @SQLDBAWithABeard!) - -## 1.7.0 -### Wednesday, April 25, 2018 - -- [PowerShell/vscode-powershell #1285](https://github.com/PowerShell/vscode-powershell/pull/1285) - - Add a community snippet for date-annotated `Write-Verbose` messages. - -- [PowerShell/vscode-powershell #1228](https://github.com/PowerShell/vscode-powershell/issues/1228) - - Make comment-based help trigger always be `##` with a new setting `powershell.helpCompletion` to - allow you to select between help comment styles: `BlockComment` (default) or `LineComment`. - You can also specify Disabled to disable this functionality. - -- [PowerShell/vscode-powershell #603](https://github.com/PowerShell/vscode-powershell/issues/603) - - Fix PowerShell crashing on machines with IPv6 disabled. - -- [PowerShell/vscode-powershell #1243](https://github.com/PowerShell/vscode-powershell/issues/1243) - - Support custom PowerShell executable paths in user configuration which can be selected (via name) - in either user or workspace configuration. - -- [PowerShell/vscode-powershell #1264](https://github.com/PowerShell/vscode-powershell/pull/1264) - - Add support for [Visual Studio Live Share](https://code.visualstudio.com/visual-studio-live-share). - -- [PowerShell/vscode-powershell #1261](https://github.com/PowerShell/vscode-powershell/pull/1261) - - Add support for `$psEditor.GetEditorContext.CurrentFile.SaveAs("NewFileName.ps1")`. - -- [PowerShell/vscode-powershell #1252](https://github.com/PowerShell/vscode-powershell/pull/1252) - - Change the way the extension builds and runs, so that PowerShellEditorServices is self-contained. - -- [PowerShell/vscode-powershell #1248](https://github.com/PowerShell/vscode-powershell/pull/1248) - - Replace `$global:IsOSX` with `$global:IsMacOS`. - -- [PowerShell/vscode-powershell #1246](https://github.com/PowerShell/vscode-powershell/pull/1246) - - Create [community_snippets.md](./docs/community_snippets.md) for user created snippets. - -- [PowerShell/vscode-powershell #1155](https://github.com/PowerShell/vscode-powershell/issues/1155) - - Fix PSES crashes caused by running "Set PSScriptAnalyzer Rules" on an untitled file. - -- [PowerShell/vscode-powershell #1236](https://github.com/PowerShell/vscode-powershell/pull/1236) - - Stop an error occurring when VSCode trims trailing whitespace and sends document update messages. - -- [PowerShell/vscode-powershell #996](https://github.com/PowerShell/vscode-powershell/issues/996) - - Fix `Install-PSCode.ps1` crashing due to `$IsLinux` variable in older PowerShell versions. - -- [PowerShell/vscode-powershell #1234](https://github.com/PowerShell/vscode-powershell/pull/1234) - - Add snippets for Hashtable and PSCustomObject. - -- [PowerShell/vscode-powershell #1233](https://github.com/PowerShell/vscode-powershell/pull/1233) - - Add a keybinding for Show Addtional Commands to Shift-Alt-S. - -- [PowerShell/vscode-powershell #1227](https://github.com/PowerShell/vscode-powershell/pull/1227) - - Add an indicator for when PowerShell is running in the status bar. - -- [PowerShell/vscode-powershell #1225](https://github.com/PowerShell/vscode-powershell/pull/1225) - - Fix launch config not using temporary integrated console setting. - -- [PowerShell/vscode-powershell #1208](https://github.com/PowerShell/vscode-powershell/issues/1208) - - Stop configured temporary windows closing after running Pester tests. - -## 1.6.0 -### Thursday, February 22, 2018 - -#### Fixes and Improvements - -- [PowerShell/vscode-powershell #907](https://github.com/PowerShell/vscode-powershell/issues/907) - - Persist temp console debug session. - -- [PowerShell/vscode-powershell #1198](https://github.com/PowerShell/vscode-powershell/pull/1198) - - Enhance Start-EditorServices.ps1 for better logging and fix bugs. - -- [PowerShell/PowerShellEditorServices #413](https://github.com/PowerShell/PowerShellEditorServices/issues/413) - - Allow opening files as not previews to allow Open-EditorFile to open multiple files passed in. - -- [PowerShell/vscode-powershell #1177](https://github.com/PowerShell/vscode-powershell/issues/1177) - - Add function-advanced snippet. Thanks to [Benny1007](https://github.com/Benny1007)! - -- [PowerShell/vscode-powershell #1179](https://github.com/PowerShell/vscode-powershell/issues/1179) - - Switch onDebug to onDebugResolve:type for better debugging perf. - -- [PowerShell/vscode-powershell #1086](https://github.com/PowerShell/vscode-powershell/issues/1086) - - Add tslint to vscode-powershell and address all issues. - -- [PowerShell/vscode-powershell #1153](https://github.com/PowerShell/vscode-powershell/issues/1153) - - Add docs for ps remoting in vscode. - -- [PowerShell/vscode-powershell #1161](https://github.com/PowerShell/vscode-powershell/pull/1161) - - Check for the expected version of the PowerShell Editor Services module fails because of the wrong function parameters. Thanks to [ant-druha](https://github.com/ant-druha)! - -- [PowerShell/vscode-powershell #1141](https://github.com/PowerShell/vscode-powershell/pull/1141) - - Updated install script minified URL. Thanks to [tabs-not-spaces](https://github.com/tabs-not-spaces)! - -- [PowerShell/PowerShellEditorServices #258](https://github.com/PowerShell/PowerShellEditorServices/issues/258) - - add .Save() to FileContext API. - -- [PowerShell/vscode-powershell #1137](https://github.com/PowerShell/vscode-powershell/pull/1137) - - Added 64bit support & vscode-insiders install support. Thanks to [tabs-not-spaces](https://github.com/tabs-not-spaces)! - -- [PowerShell/vscode-powershell #1115](https://github.com/PowerShell/vscode-powershell/issues/1115) - - Fixed "Open in ISE" keyboard shortcut from overwriting basic editing keyboard shortcut. - -- [PowerShell/vscode-powershell #1111](https://github.com/PowerShell/vscode-powershell/issues/1111) - - Update examples tasks.json for 2.0.0 schema. - -## 1.5.1 -### Tuesday, November 14, 2017 - -- [PowerShell/vscode-powershell #1100](https://github.com/PowerShell/vscode-powershell/issues/1100) - - Fixed CodeLens on Pester test invocation fails with "Error: command 'vscode.startDebug' not found". - -- [PowerShell/vscode-powershell #1091](https://github.com/PowerShell/vscode-powershell/issues/1091) - - Fixed crash when editing remote file using psedit. - -- [PowerShell/vscode-powershell #1084](https://github.com/PowerShell/vscode-powershell/issues/1084) - - Fixed authenticode signature 'HashMismatch' on Start-EditorServices.ps1. - -- [PowerShell/vscode-powershell #1078](https://github.com/PowerShell/vscode-powershell/issues/1078) - - Fixed debug adapter process terminating when setting breakpoint in an Untitled file or in a Git diff window. - -- Update download.sh to remove macOS OpenSSL check since PowerShell Core Beta and higher no longer depend on OpenSSL. Thanks to [elovelan](https://github.com/elovelan)! - -- Get-Help -ShowWindow will no longer error in the PowerShell Integrated Console. The help window will appear but at the moment, it will appear behind VSCode. - -- Fix language server crash when processing a deep directory structure that exceeds max path. - -## 1.5.0 -### Friday, October 27, 2017 - -#### Fixes and Improvements - -- [PowerShell/vscode-powershell #820](https://github.com/PowerShell/vscode-powershell/issues/820) - - Added new "Upload Bug Report to GitHub" command to make it easy to post an issue to the vscode-powershell GitHub repo. Thanks to [Mark Schill](https://github.com/PowerSchill)! - -- [PowerShell/vscode-powershell #910](https://github.com/PowerShell/vscode-powershell/issues/910) - - Set-VSCodeHtmlContentView cmdlet now exposes `JavaScriptPaths` and `StyleSheetPaths` parameters to allow using JavaScript code and CSS stylesheets in VS Code HTML preview views. - -- [PowerShell/vscode-powershell #909](https://github.com/PowerShell/vscode-powershell/issues/909) - - Write-VSCodeHtmlContentView's AppendBodyContent now accepts input from the pipeline - -- [PowerShell/vscode-powershell #1071](https://github.com/PowerShell/vscode-powershell/pull/1071) - - Updated session menu to find PowerShell Core installs with the new pwsh.exe path - -- [PowerShell/vscode-powershell #842](https://github.com/PowerShell/vscode-powershell/issues/842) - - psedit can now open empty files in remote sessions - -- [PowerShell/vscode-powershell #1040](https://github.com/PowerShell/vscode-powershell/issues/1040) - - Non-PowerShell files opened in remote sessions using psedit can now be saved back to the remote server - -- [PowerShell/vscode-powershell #660](https://github.com/PowerShell/vscode-powershell/issues/660) - - Set/Enable/Disable/Remove-PSBreakpoint commands now cause the VS Code breakpoint UI to be updated while the debugger is active - -- [PowerShell/vscode-powershell #625](https://github.com/PowerShell/vscode-powershell/issues/625) - - Breakpoints are now cleared from the session when the debugger starts so that stale breakpoints from previous sessions are not hit - -- [PowerShell/vscode-powershell #1004](https://github.com/PowerShell/vscode-powershell/issues/1004) - - Handle exception case when finding references of a symbol - -- [PowerShell/vscode-powershell #942](https://github.com/PowerShell/vscode-powershell/issues/942) - - Temporary debugging session now does not stop responding when running "PowerShell Interactive Session" debugging configuration - -- [PowerShell/vscode-powershell #917](https://github.com/PowerShell/vscode-powershell/issues/917) - - Added PowerShell.InvokeRegisteredEditorCommand command to be used from HTML preview views for invoking editor commands registered in PowerShell. Thanks to [Kamil Kosek](https://github.com/kamilkosek)! - -- [PowerShell/vscode-powershell #872](https://github.com/PowerShell/vscode-powershell/issues/872) - - Watch variables with children are now expandable - -- [PowerShell/vscode-powershell #1060](https://github.com/PowerShell/vscode-powershell/issues/1060) - - $psEditor.Workspace.NewFile() now works again in VSC 1.18.0 Insiders builds - -- [PowerShell/vscode-powershell #1046](https://github.com/PowerShell/vscode-powershell/issues/1046) - - Debugging now works again in VSC 1.18.0 Insiders builds - -- [PowerShell/PowerShellEditorServices #342](https://github.com/PowerShell/PowerShellEditorServices/issues/342) - - Unexpected file URI schemes are now handled more reliably - -- [PowerShell/PowerShellEditorServices #396](https://github.com/PowerShell/PowerShellEditorServices/issues/396) - - Resolved errors being written to Integrated Console when running native applications while transcription is turned on - -- [PowerShell/PowerShellEditorServices #529](https://github.com/PowerShell/PowerShellEditorServices/issues/529) - - Fixed an issue with loading the PowerShellEditorServices module in PowerShell Core 6.0.0-beta3 - -- [PowerShell/PowerShellEditorServices #533](https://github.com/PowerShell/PowerShellEditorServices/pull/533) - - Added new $psEditor.GetCommand() method for getting all registered editor commands. Thanks to [Kamil Kosek](https://github.com/kamilkosek)! - -- [PowerShell/PowerShellEditorServices #535](https://github.com/PowerShell/PowerShellEditorServices/pull/535) - - Type information is now exposed on hover for variables in the Variables view - -## 1.4.3 -### Wednesday, September 13, 2017 - -- [#1016](https://github.com/PowerShell/vscode-powershell/issues/1016) - - Fixed a conflict with the "Azure Resource Manager for Visual Studio - Code" extension which prevented the PowerShell extension from loading - successfully. - -## 1.4.2 -### Tuesday, September 5, 2017 - -- [#993](https://github.com/PowerShell/vscode-powershell/issues/993) - - `powershell.powerShellExePath` using Sysnative path should be automatically - corrected when using 64-bit Visual Studio Code -- [#1008](https://github.com/PowerShell/vscode-powershell/issues/1008) - - Windows PowerShell versions (x64 and x86) are not enumerated correctly - when using 64-bit Visual Studio Code -- [#1009](https://github.com/PowerShell/vscode-powershell/issues/1009) - - PowerShell version indicator in status bar is missing tooltip -- [#1020](https://github.com/PowerShell/vscode-powershell/issues/1020) - - "Show Session Menu", "Show Integrated Console", and "Restart Current Session" - commands should cause PowerShell extension to be activated - -## 1.4.1 -### Thursday, June 22, 2017 - -- [PowerShell/PowerShellEditorServices#529](https://github.com/PowerShell/PowerShellEditorServices/issues/529) - - Fixed an issue with loading the extension with in PowerShell Core 6.0.0-beta3 - -## 1.4.0 -### Wednesday, June 21, 2017 - -#### New HTML content view commands enabling custom UI tabs - -You can now show editor tabs with custom HTML-based UI by using the -new HTML content view commands! This is the first step toward UI -extensions for VS Code written in PowerShell. - -Here's an example: - -```powershell -$view = New-VSCodeHtmlContentView -Title "My Custom View" -ShowInColumn One -Set-VSCodeHtmlContentView -View $view -Content "

Hello world!

" -Write-VSCodeHtmlContentView $view -Content "I'm adding new content!
" -``` - -And here's the result: - -![HTML view demo](https://user-images.githubusercontent.com/79405/27394133-f96c38cc-565f-11e7-8102-a3727014ea5a.GIF) - -Check out the cmdlet help for the following commands to learn more: - -- `New-VSCodeHtmlContentView` -- `Show-VSCodeHtmlContentView` -- `Close-VSCodeHtmlContentView` -- `Set-VSCodeHtmlContentView` -- `Write-VSCodeHtmlContentView` - -Since this is a first release, we've restricted the use of JavaScript -inside of the HTML. We will add this capability in a future release! - -#### Code formatting setting presets for common styles - -We've now added code formatting presets for the most common code style -conventions used in the PowerShell community: - -- **[OTBS](https://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS_.28OTBS.29)** - - Known as the "One True Brace Style". Causes `else`, `catch`, and other - keywords to be "cuddled", keeping them on the same line as the previous - closing brace: - - ```powershell - if ($var -eq $true) { - # Do the thing - } else { - # Do something else - } - ``` - -- **[Stroustrup](https://en.wikipedia.org/wiki/Indent_style#Variant:_Stroustrup)** - - Causes beginning curly braces to be placed on the same line as the statement: - - ```powershell - if ($var -eq $true) { - # Do the thing - } - else { - # Do something else - } - ``` - -- **[Allman](https://en.wikipedia.org/wiki/Indent_style#Allman_style)** - All curly braces are preceded by a newline: - - ```powershell - if ($var -eq $true) - { - # Do the thing - } - else - { - # Do something else - } - ``` - -- **Custom** - Allows full customization of the code formatting settings. - -In addition, code formatting now respects your `editor.insertSpaces` and -`editor.tabSize` settings! - -#### Debugging in a temporary PowerShell Integrated Console - -We've added the ability to debug your PowerShell code in a temporary -PowerShell Integrated Console so that you have a fresh runspace and -PowerShell process each time you hit F5! - -This setting is necessary if you are developing with PowerShell 5 -classes or modules using .NET assemblies because .NET types cannot -be reloaded inside of the same PowerShell process. This new setting -saves you from reloading your PowerShell session each time you debug -your code! - -You can configure this behavior in two ways: - -- Use the `launch.json` configuration parameter `createTemporaryIntegratedConsole`: - - ```json - { - "type": "PowerShell", - "request": "launch", - "name": "PowerShell Launch Current File in Temporary Console", - "script": "${file}", - "args": [], - "cwd": "${file}", - "createTemporaryIntegratedConsole": true - }, - ``` - -- Configure the setting `powershell.debugging.createTemporaryIntegratedConsole`: - - ```json - "powershell.debugging.createTemporaryIntegratedConsole": true, - ``` - -The default value for these settings is `false`, meaning that the temporary -console behavior is **opt-in**. - -Configuring the user or workspace setting will cause all debugging sessions -to be run in a temporary Integrated Console so it's useful if you would prefer -this to be the default behavior. The `launch.json` setting overrides the user -setting so you can always customize the behavior for a specific launch -configuration. - -#### NewFile() API and Out-CurrentFile command - -You can now create a new untitled file from within the Integrated Console -by using the `$psEditor.Workspace.NewFile()` command! Also, you can send -the formatted output of any PowerShell command to the current file by using -the `Out-CurrentFile` command: - -```powershell -Get-Process | Out-CurrentFile -``` - -Special thanks to [Doug Finke](https://github.com/dfinke) for the contribution! - -#### Other fixes and improvements - -- [#881](https://github.com/PowerShell/vscode-powershell/pull/881) - - When you select a different PowerShell version in the session menu, your choice - is persisted to the `powershell.powerShellExePath` setting. - -- [#891](https://github.com/PowerShell/vscode-powershell/issues/891) - - Pester CodeLenses now run tests without string interpolation of test names - -## 1.3.2 -### Monday, June 12, 2017 - -- [PowerShell/vscode-powershell#864](https://github.com/PowerShell/vscode-powershell/issues/864) - Improved the visibility of hyphen characters on the currently edited line in the PowerShell ISE theme (thanks [Stefan Stranger](https://github.com/stefanstranger)!) - -- [PowerShell/vscode-powershell#857](https://github.com/PowerShell/vscode-powershell/issues/855) - Typing a new function into a file no longer causes the language server to crash - -- [PowerShell/vscode-powershell#855](https://github.com/PowerShell/vscode-powershell/issues/855) - "Format Document" no longer hangs indefinitely - -- [PowerShell/vscode-powershell#859](https://github.com/PowerShell/vscode-powershell/issues/859) - Language server no longer hangs when opening a Pester test file containing dot-sourced script references - -- [PowerShell/vscode-powershell#856](https://github.com/PowerShell/vscode-powershell/issues/856) - CodeLenses for function definitions no longer count the definition itself as a reference and shows "0 references" when there are no uses of that function - -- [PowerShell/vscode-powershell#838](https://github.com/PowerShell/vscode-powershell/issues/838) - Right-clicking a debugger variable and selecting "Add to Watch" now has the desired result - -- [PowerShell/vscode-powershell#837](https://github.com/PowerShell/vscode-powershell/issues/837) - Debugger call stack now navigates correctly to the user's selected stack frame - -- [PowerShell/vscode-powershell#862](https://github.com/PowerShell/vscode-powershell/issues/862) - Terminating errors in the language server now close the Integrated Console immediately and prompt the user to restart the session - -- [PowerShell/PowerShellEditorServices#505](https://github.com/PowerShell/PowerShellEditorServices/issues/505) - Added improved cmdlet help in the PowerShellEditorServices.Commands module - -- [PowerShell/PowerShellEditorServices#509](https://github.com/PowerShell/PowerShellEditorServices/issues/509) - Importing the PowerShellEditorServices.Commands module no longer causes errors to be written about missing help languages - -## 1.3.1 -### Friday, June 9, 2017 - -#### Fixes and improvements - -- [#850](https://github.com/PowerShell/vscode-powershell/issues/850) - - Fixed an issue where lower-cased "describe" blocks were not identified by - the CodeLens feature. - -- [#851](https://github.com/PowerShell/vscode-powershell/issues/851) - - Fixed an issue where the language server would stop responding when typing out a describe - block. - -- [#852](https://github.com/PowerShell/vscode-powershell/issues/852) - - Fixed an issue where Pester test names would not be detected correctly when - other arguments like -Tags were being used on a Describe block. - -## 1.3.0 -### Friday, June 9, 2017 - -#### CodeLens for running and debugging Pester tests - -We've added two new CodeLens actions that show up above Describe blocks in -your Pester tests, "Run tests" and "Debug tests". By clicking one of these -CodeLenses, your tests will be executed in the Integrated Console with -the debugger attached. You can now set breakpoints and quickly debug a portion -of your test script: - -![Pester CodeLens](https://user-images.githubusercontent.com/79405/26988706-3c054ed0-4d05-11e7-87f0-5bbf16ee73ef.GIF) - -#### CodeLens support for finding references of a function or cmdlet - -We've also added CodeLenses for showing the number of references for a function or -cmdlet that is defined in a script. If you click this CodeLens, the references -pane will appear so that you can navigate through all of the references: - -![References CodeLens](https://user-images.githubusercontent.com/79405/26989245-384a4866-4d07-11e7-9c1e-076dbd7d6eb4.GIF) - -We will add CodeLens support for PowerShell 5+ classes and class methods in a future -update! - -#### Document symbol support for Pester tests - -We've also added document symbol support for Pester tests so that you can easily -navigate among the Describe, Context, and It blocks in large Pester script files: - -![Pester symbols](https://user-images.githubusercontent.com/79405/26989077-91e7a306-4d06-11e7-8e26-916bb78720f8.GIF) - -#### New PowerShell ISE theme - -We now include a new color theme that tries to provide a faithful interpretation -of the PowerShell ISE's style, including a blue console background! To use this -theme open the Command Palette (Ctrl+Shift+P), run the "Preferences: Color Theme" -command, then select "PowerShell ISE". - -![ISE theme](https://user-images.githubusercontent.com/79405/26988805-9769aea6-4d05-11e7-81fc-da79bf1ec3cb.png) - -This is a first attempt at making this happen so [give us feedback](https://git.io/v9jnL) -if you think that the colors can be improved! Super huge thanks to -[Matt McNabb](https://twitter.com/mcnabbmh) for putting this together! - -#### New cmdlets inside the Integrated Console - -Thanks to new PowerShell Editor Services co-maintainer [Patrick Meinecke](https://github.com/SeeminglyScience), -we've gained a new set of useful commands for interacting with the $psEditor APIs -within the Integrated Console: - -- [Find-Ast](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Find-Ast.md) -- [Get-Token](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Get-Token.md) -- [ConvertFrom-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/ConvertFrom-ScriptExtent.md) -- [ConvertTo-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/ConvertTo-ScriptExtent.md) -- [Set-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Set-ScriptExtent.md) -- [Join-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Join-ScriptExtent.md) -- [Test-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Test-ScriptExtent.md) -- [Import-EditorCommand](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Import-EditorCommand.md) - -This should also resolve the issues some people were seeing when we tried -to load the unsigned temporary script containing `Register-EditorCommand` -on machines with an AllSigned execution policy ([#784]([https://github.com/PowerShell/vscode-powershell/issues/784])). - -#### Fixes and improvements - -- [#827](https://github.com/PowerShell/vscode-powershell/issues/827) - - Fixed an issue where an Output panel will appear with an error when you close - the PowerShell Integrated Terminal - -## 1.2.1 -### Thursday, June 1, 2017 - -#### Fixes and improvements - -- [PowerShell/PowerShellEditorServices#478](https://github.com/PowerShell/PowerShellEditorServices/issues/478) - - Dynamic comment help snippets now generate parameter fields correctly - when `<#` is typed above a `param()` block. - -- [#808](https://github.com/PowerShell/vscode-powershell/issues/808) - - An extra `PS>` is no longer being written to the Integrated Console for - some users who have custom prompt functions. - -- [#813](https://github.com/PowerShell/vscode-powershell/issues/813) - - Finding references of symbols across the workspace now properly handles - inaccessible folders and file paths - -- [#810](https://github.com/PowerShell/vscode-powershell/issues/810) - - `$psEditor.GetEditorContext()` now doesn't throw exceptions when in an - untitled file - -- [#807](https://github.com/PowerShell/vscode-powershell/issues/807) - - The users's previously selected PowerShell session type is now retained - when running the "PowerShell: Restart Current Session" command. - -- [#821](https://github.com/PowerShell/vscode-powershell/issues/821) - - Note properties on PSObjects are now visible in the debugger's Variables - view - -## 1.2.0 -### Wednesday, May 31, 2017 - -#### Dynamic comment-based help snippets now work inside functions ([#763](https://github.com/PowerShell/vscode-powershell/issues/748)) - -You asked for it, you got it! Dynamic comment-based help snippets now work -inside function definitions, both above the `param()` block and at the end -of the function body: - -![Comment help GIF](https://cloud.githubusercontent.com/assets/79405/26637844/6e76cfa6-45d5-11e7-89b8-a2d6a559536b.GIF) - -*NOTE: There is an issue where parameter sections don't get generated inside of a function -with a `[CmdletBinding()]` attribute. This is being tracked at [PowerShell/PSScriptAnalyzer#768](https://github.com/PowerShell/PSScriptAnalyzer/issues/768).* - -#### Session menu now contains entries for PowerShell Core installations on Windows ([#794](https://github.com/PowerShell/vscode-powershell/issues/794)) - -It's now much easier to switch between Windows PowerShell and PowerShell Core installs -on Windows. When you run the "PowerShell: Show Session Menu" command or click the -PowerShell version indication in the status bar you'll now see PowerShell Core entries -in the menu: - -![Session menu](https://cloud.githubusercontent.com/assets/79405/26637984/d177f5f8-45d5-11e7-9def-705b3fa68953.png) - -#### Improved PSScriptAnalyzer marker display and suppression snippets ([#781](https://github.com/PowerShell/vscode-powershell/issues/781)) and ([#783](https://github.com/PowerShell/vscode-powershell/issues/783)) - -The green squiggle markers you receive from PSScriptAnalyzer now include the -name of the corresponding rule in their description: - -![Rule name](https://cloud.githubusercontent.com/assets/79405/26638073/15aaaaae-45d6-11e7-93a0-cf6d5397553e.png) - -This is really helpful with the new rule suppression snippets contributed by -[Jos Verlinde](https://github.com/Josverl)! You can access them by typing -`suppress-` and selecting one of the suppression snippet options: - -![Suppress rule](https://cloud.githubusercontent.com/assets/79405/26638390/d8c42164-45d6-11e7-8844-a34a314654a5.GIF) - -#### New built-in Pester problem matcher ([#798](https://github.com/PowerShell/vscode-powershell/issues/798)) - -We now include a built-in [problem matcher](https://code.visualstudio.com/Docs/editor/tasks#_defining-a-problem-matcher) -for Pester test output so that you don't need to define one in your `tasks.json` -file any longer! You can reference the built-in problem matcher in your test -tasks by using the name `$pester`: - -```json - { - "taskName": "Test", - "suppressTaskName": true, - "isTestCommand": true, - "showOutput": "always", - "args": [ "Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true}" ], - "problemMatcher": "$pester" - } -``` - -*NOTE: There is an issue with problem matchers when using the new `2.0.0` -version of VS Code's task runner. Pester errors may show up multiple -times in the Problems panel. This issue is being tracked at -[#797](https://github.com/PowerShell/vscode-powershell/issues/797).* - -#### Other fixes and improvements - -- [#710](https://github.com/PowerShell/vscode-powershell/issues/710) - - Variable definitions can now be found across the workspace - -- [#771](https://github.com/PowerShell/vscode-powershell/issues/771) - - Improved dynamic comment help snippet performance in scripts with many functions - -- [#786](https://github.com/PowerShell/vscode-powershell/issues/786) - - Running the "Show Integrated Console" command will now start the extension - if it isn't already started - -- [#774](https://github.com/PowerShell/vscode-powershell/issues/774) - - Pressing Enter now causes custom prompt functions to be fully evaluated - -- [#770](https://github.com/PowerShell/vscode-powershell/issues/770) - - Fixed issue where custom prompt function might be written twice when - starting the integrated console - -- [#767](https://github.com/PowerShell/vscode-powershell/issues/767) - - Fixed placeholder navigation for many built-in snippets - -- [#782](https://github.com/PowerShell/vscode-powershell/issues/782) - - Fixed extension host crash when restarting the PowerShell session - -- [#737](https://github.com/PowerShell/vscode-powershell/issues/737) - - Fixed hangs and high CPU when restarting or switching between PowerShell sessions - -- [#777](https://github.com/PowerShell/vscode-powershell/issues/777) - - Changed "Starting PowerShell" message to clearly indicate that we're in the - PowerShell Integrated Console - -## 1.1.0 -### Thursday, May 18, 2017 - -#### New dynamic snippet for adding comment-based help ([#748](https://github.com/PowerShell/vscode-powershell/issues/748)) - -We've added a really cool new feature that enables you to create comment-based -help blocks with ease! When you've defined a function in a PowerShell script -file, you can now start typing a comment block above the function definition -and it will be completed for you: - -![Help Comment GIF](https://cloud.githubusercontent.com/assets/79405/26216440/f31a47c8-3bb8-11e7-9fbc-7e3fb596c0ea.GIF) - -This comment block works like a snippet, allowing you to tab through the fields -to quickly add documentation for the parts you care about. - -This is a first pass for this feature and we plan to do more with it in the future. -Please feel free to [file feature requests](https://git.io/v9jnL) for anything else -you'd like to see! - -#### Breakpoints hit in the Integrated Console now activate the debugger UI ([#619](https://github.com/PowerShell/vscode-powershell/issues/619)) - -In previous releases it was necessary to start the "PowerShell Interactive Session" -debugging configuration before you could run a command or script from the Integrated -Console and hit breakpoints in the editor UI. We've just removed this limitation! - -Now when you set a breakpoint using `Set-PSBreakpoint` and run a script or command in the -Integrated Console, the debugger UI now gets activated: - -![Debugger Activate GIF](https://cloud.githubusercontent.com/assets/79405/26217019/d17708f2-3bba-11e7-982f-4d481c2cf533.GIF) - -Note that breakpoints set in the Integrated Console [still do not show up](https://github.com/PowerShell/vscode-powershell/issues/660) -in the editor UI; this requires [changes to VS Code](https://github.com/Microsoft/vscode/issues/8642) -that we'll be contributing for their next feature release. - -#### Improved output when loading profile scripts ([#663](https://github.com/PowerShell/vscode-powershell/issues/663) and [#689](https://github.com/PowerShell/vscode-powershell/issues/689)) - -We now write the errors and Write-Output calls that occur while loading profile -scripts so that it's easier to diagnose issues with your profile scripts. This -fix will help us identify the things missing from the Integrated Console which -cause your profile scripts to fail (like the current lack of a [PrivateData object for setting console colors](https://github.com/PowerShell/vscode-powershell/issues/571)). - -Please feel free to [file issues](https://git.io/v9jnL) for anything that causes -your profile scripts to throw errors when they get loaded! - -#### Other fixes and improvements - -- [#751](https://github.com/PowerShell/vscode-powershell/issues/751) - - Removed keybinding for the "Find PowerShell Modules from the Gallery" command - because it conflicts with VS Code's default "Format Selection" keybinding. - -- [#739](https://github.com/PowerShell/vscode-powershell/issues/739) - - Fixed wording of PowerShell extension commands to have consistent capitalization. - Thanks to [@AndySchneiderDev](https://github.com/AndySchneiderDev) for the - contribution! - -## 1.0.0 -### Wednesday, May 10, 2017 - -We are excited to announce that we've reached version 1.0! For more information, -please see the [official announcement](https://blogs.msdn.microsoft.com/powershell/2017/05/10/announcing-powershell-for-visual-studio-code-1-0/) -on the PowerShell Team Blog. - -#### New script argument UI when debugging ([#705](https://github.com/PowerShell/vscode-powershell/issues/705)) - -You can now set PowerShell debugger configurations to prompt for arguments to be -passed to your script when it is executed. This is configured using the new -`${command:SpecifyScriptArgs}` configuration variable in `launch.json`: - -```json - { - "type": "PowerShell", - "request": "launch", - "name": "PowerShell Launch DebugTest.ps1 w/Args Prompt", - "script": "${workspaceRoot}/DebugTest.ps1", - "args": [ "${command:SpecifyScriptArgs}" ], - "cwd": "${file}" - } -``` - -When you launch this configuration you will see a UI popup asking for arguments: - - -![image](https://cloud.githubusercontent.com/assets/5177512/25560503/e60e9822-2d12-11e7-9837-29464d077082.png) - -You can type your arguments to the script as you would in PowerShell: - -``` --Count 5 -``` - -In future executions of this configuration, you will be presented with the arguments -you typed the last time you ran it so that you can easily edit them and test variations! - -#### New hash table alignment formatting rule ([#672](https://github.com/PowerShell/vscode-powershell/issues/672)) - -We've added a new code formatting rule that automatically aligns the equal sign -in assignments of keys in hash tables or DSC configurations. It also works with -nested hash tables! Here's a simple example: - -**Before** - -```powershell -$formatTest = @{ - Apple = 4 - Tangerine = @{ - Orange = 2 - CornflowerBlue = 6 - } - Banana = 3 -} -``` - -**After** - -```powershell - -$formatTest = @{ - Apple = 4 - Tangerine = @{ - Orange = 2 - CornflowerBlue = 6 - } - Banana = 3 -} -``` - -This formatting rule is enabled by default but can be disabled with the following -setting: - -``` -"powershell.codeFormatting.alignPropertyValuePairs": false -``` - -#### Added basic module-wide function references support - -In the past, finding the references or definition of a function in `FileA.ps1` only -worked if `FileA.ps1` had an explicit dot-source invocation of `FileB.ps1`. We have -removed this limitation so that you can now find definitions and references of any -function across all the script files in your project folder! This is especially -useful if you write PowerShell modules where all of the source files are dot-sourced -inside of the .psm1 file. - -This new implementation is very basic and may give unexpected results, so please [file -an issue on GitHub](https://github.com/PowerShell/vscode-powershell/issues) if you get -a result you did not expect! - -#### Other integrated console and debugger improvements - -- Fixed [#698](https://github.com/PowerShell/vscode-powershell/issues/698) - - When debugging scripts in the integrated console, the cursor position should now - be stable after stepping through your code! Please let us know if you see any - other cases where this issue appears. - -- Fixed [#626](https://github.com/PowerShell/vscode-powershell/issues/626) - - Fixed an issue where debugging a script in one VS Code window would cause that script's - output to be written to a different VS Code window in the same process. - -- Fixed [#618](https://github.com/PowerShell/vscode-powershell/issues/618) - - Pressing enter on an empty command line in the Integrated Console no longer adds the - empty line to the command history. - -- Fixed [#617](https://github.com/PowerShell/vscode-powershell/issues/617) - - Stopping the debugger during a prompt for a mandatory script parameter no - longer crashes the language server. - -- Fixed [PowerShellEditorServices #428](https://github.com/PowerShell/PowerShellEditorServices/issues/428) - - Debugger no longer hangs when you stop debugging while an input or choice prompt is - active in the integrated console. - -## 0.12.2 -### Friday, April 7, 2017 - -- Fixed [#662](https://github.com/PowerShell/vscode-powershell/issues/662) - - Changed usage of `$env:PSMODULEPATH` to `$env:PSModulePath` to conform to - a recent change in PowerShell 6 ([PowerShell/PowerShell#3255](https://github.com/PowerShell/PowerShell/pull/3255)) - which makes the casing of `PSModulePath` consistent between Windows and - the *NIX platforms. - - **NOTE: This is a breaking change for PowerShell extension users on Linux and macOS** - - If you are using PowerShell 6.0.0-alpha.17 or lower you **will** need to upgrade - to 6.0.0-alpha.18. - -- Fixed [#645](https://github.com/PowerShell/vscode-powershell/issues/645) - - "Go to Definition" or "Find References" now work in untitled scripts without - crashing the session -- Fixed [#632](https://github.com/PowerShell/vscode-powershell/issues/632) - - Debugger no longer hangs when launched while PowerShell session is still - initializing -- Fixed [#655](https://github.com/PowerShell/vscode-powershell/issues/655) - - Fixed an issue with current working directory being set incorrectly when - debugging untitled script files -- Fixed [PowerShellEditorServices #430](https://github.com/PowerShell/PowerShellEditorServices/issues/430) - - Resolved occasional IntelliSense slowness by preventing the implicit loading - of the PowerShellGet and PackageManagement modules. This change will be reverted - once a bug in PackageManagement is fixed. -- Fixed [PowerShellEditorServices #427](https://github.com/PowerShell/PowerShellEditorServices/issues/427) - - Fixed an occasional crash when requesting editor IntelliSense while running - a script in the debugger -- Fixed [PowerShellEditorServices #416](https://github.com/PowerShell/PowerShellEditorServices/issues/416) - - Cleaned up errors that would appear in the `$Errors` variable from the use - of `Get-Command` and `Get-Help` in IntelliSense results - -## 0.12.1 -### Tuesday, April 4, 2017 - -- Fixed [#648](https://github.com/PowerShell/vscode-powershell/issues/648) - - Resolved an error when launching an untitled script file in a workspace - with no launch.json or in a window without a workspace path - -## 0.12.0 -### Tuesday, April 4, 2017 - -#### Debugging untitled files ([#555](https://github.com/PowerShell/vscode-powershell/issues/555)) - -You can now debug untitled files that are set to the PowerShell language mode. When you -create a new untitled file, use the "Change Language Mode" command (Ctrl+K M) -and choose "PowerShell" from the menu that appears. You can now press F5 to start -debugging the script file without saving it. - -In the upcoming 1.11.0 release of Visual Studio Code (or in the current VS Code Insiders -release), you can configure the new `files.defaultLanguage` setting to `powershell` in either -your User or Workspace settings to cause all untitled files to be created with the PowerShell -mode by default. This will allow you to create new PowerShell scripts and debug them -immediately without saving first! - -#### New right-click context menu for Run Selection ([#581](https://github.com/PowerShell/vscode-powershell/issues/581)) - -By user request, we've also added a new "Run Selection" item in the right-click context menu -for PowerShell script files: - -![image](https://cloud.githubusercontent.com/assets/79405/24670885/a18513fe-1924-11e7-91d3-dc14c6cbfad9.png) - -#### Debugging improvements - -- Fixed [#620](https://github.com/PowerShell/vscode-powershell/issues/620) - - PowerShell session now does not crash when a breakpoint is hit outside of - debug mode - -- Fixed [#614](https://github.com/PowerShell/vscode-powershell/issues/614) - - Auto variables are now populating correctly in the debugger. **NOTE**: There is - a known issue where all of a script's variables begin to show up in the - Auto list after running a script for the first time. This is caused by - a change in 0.11.0 where we now dot-source all debugged scripts. We will - provide an option for this behavior in the future. - -- Fixed [#641](https://github.com/PowerShell/vscode-powershell/issues/641) - - PowerShell script files with capitalized extensions (.PS1, .PSM1) can now - be launched in the debugger - -- Fixed [#616](https://github.com/PowerShell/vscode-powershell/issues/616) - - Debugger now shows column position indicators when debugging pipelines or - nested expressions: - - ![image](https://cloud.githubusercontent.com/assets/79405/24316990/2157480e-10b0-11e7-8a61-19fde63edfb7.png) - -#### Integrated console improvements - -- Fixed [PowerShell/PowerShellEditorServices#411](https://github.com/PowerShell/PowerShellEditorServices/issues/411) - - Commands run outside of the integrated console prompt now interrupt the prompt - correctly. This resolves a class of issues that appear when running commands - in the extension like "New Project from Plaster Template" or any `$psEditor` - commands added with the "Register-EditorCommand" function. Running any of - these commands will now cause the current input prompt to be cancelled so that - the command's output will be written correctly. - -#### Code formatting improvements - -- Fixed [#595](https://github.com/PowerShell/vscode-powershell/issues/595) - - High CPU usage when using formatOnType has now been resolve - -- Fixed [#559](https://github.com/PowerShell/vscode-powershell/issues/559) - - The `newLineAfterCloseBrace` behavior has been improved to respect common syntax - usages - -- Fixed[PowerShell/PowerShellEditorServices#380](https://github.com/PowerShell/PowerShellEditorServices/issues/380) - - The `whitespaceBeforeOpenBrace` behavior now leaves "magic" functions with the - correct formatting. For example: `(0 .. 10).foreach{$_}` now does not have a - whitespace inserted before the `{`. - -#### New Project with Plaster improvements - -- Fixed [#643](https://github.com/PowerShell/vscode-powershell/issues/643) - - Running Plaster using the New Project command now interrupts the command prompt - correctly - -- Fixed [#504](https://github.com/PowerShell/vscode-powershell/issues/504) - - Confirming default values in Plaster input prompts by pressing Enter now works - correctly - -#### Other fixes and improvements - -- Added [#639](https://github.com/PowerShell/vscode-powershell/pull/639) and - [#640](https://github.com/PowerShell/vscode-powershell/pull/640) - - Our configuration setting descriptions have been edited for superior clarity - thanks to [June Blender](https://github.com/juneb)! - -- Fixed [#611](https://github.com/PowerShell/vscode-powershell/pull/640) - - Example-* snippets are now displaying correctly in IntelliSense results - -- Added [#624](https://github.com/PowerShell/vscode-powershell/pull/624) - - When you update the PowerShell extension after this release, you will now see - version update indicators which offer to display the changelog in a preview - tab - -## 0.11.0 -### Wednesday, March 22, 2017 - -#### Remotely edited files can now be saved - -- Added [#583](https://github.com/PowerShell/vscode-powershell/issues/583) - - When you open files in a remote PowerShell session with the `psedit` command, - their updated contents are now saved back to the remote machine when you save - them in the editor. - -#### Integrated console improvements - -- Fixed [#533](https://github.com/PowerShell/vscode-powershell/issues/533) - - The backspace key now works in the integrated console on Linux and macOS. This - fix also resolves a few usability problems with the integrated console on all - supported OSes. - -- Fixed [542](https://github.com/PowerShell/vscode-powershell/issues/542) - - Get-Credential now hides keystrokes correctly on Linux and macOS. - -We also added some new settings ([#580](https://github.com/PowerShell/vscode-powershell/issues/580), -[#588](https://github.com/PowerShell/vscode-powershell/issues/588)) to allow fine-tuning -of the integrated console experience: - -- `powershell.startAutomatically` (default: `true`) - If true, causes PowerShell extension - features to start automatically when a PowerShell file is opened. If false, the user must - initiate startup using the 'PowerShell: Restart Current Session' command. IntelliSense, - code navigation, integrated console, code formatting, and other features will not be - enabled until the extension has been started. Most users will want to leave this - setting to `true`, though it was added to save CPU cycles if you often use new VS Code - instances to quickly view PowerShell files. - -- `powershell.integratedConsole.showOnStartup` (default: `true`) - If true, causes the - integrated console to be shown automatically when the PowerShell extension is initialized. - -- `powershell.integratedConsole.focusConsoleOnExecute` (default: `true`) - If `true`, - causes the integrated console to be focused when a script selection is run or a - script file is debugged. - -#### Interactive debugging improvements - -- Added [#540](https://github.com/PowerShell/vscode-powershell/issues/540) - - The scripts that you debug are now dot-sourced into the integrated console's - session, allowing you to experiment with the results of your last execution. - -- Added [#600](https://github.com/PowerShell/vscode-powershell/issues/600) - - Debugger commands like `stepInto`, `continue`, and `quit` are now available - in the integrated console while debugging a script. - -- Fixed [#596](https://github.com/PowerShell/vscode-powershell/issues/596) - - VS Code's Debug Console now warns the user when it is used while debugging - a script. All command evaluation now happens through the integrated console - so this message should help alleviate confusion. - -#### Other fixes and improvements - -- Fixed [#579](https://github.com/PowerShell/vscode-powershell/issues/579) - - Sorting of IntelliSense results is now consistent with the PowerShell ISE -- Fixed [#591](https://github.com/PowerShell/vscode-powershell/issues/591) - - "Editor commands" registered with the `Register-EditorCommand` function are - now sorted alphabetically by their `Name` field, causing commands to be grouped - based on their source module. -- Fixed [#575](https://github.com/PowerShell/vscode-powershell/issues/575) - - The interactive console no longer starts up with errors in the `$Error` variable. -- Fixed [#599](https://github.com/PowerShell/vscode-powershell/issues/599) - - The [SSASCMDLETS module](https://msdn.microsoft.com/en-us/library/hh213141.aspx?f=255&MSPPError=-2147217396) - from SQL Server Analytics Service should now load correctly in the integrated - console. - -## 0.10.1 -### Thursday, March 16, 2017 - -#### Fixes and improvements - -- Fixed [#566](https://github.com/PowerShell/vscode-powershell/issues/566) - - Enable editor IntelliSense while stopped at a breakpoint -- Fixed [#556](https://github.com/PowerShell/vscode-powershell/issues/556) - - Running and debugging scripts in the integrated console should not steal focus from the editor -- Fixed [#543](https://github.com/PowerShell/vscode-powershell/issues/543) - - Keyboard input using AltGr Ctrl+Alt modifiers does not work -- Fixed [#421](https://github.com/PowerShell/vscode-powershell/issues/421) - - Session startup should give a helpful error message if ConstrainedLanguage mode is turned on -- Fixed [#401](https://github.com/PowerShell/vscode-powershell/issues/401) - - Session startup should indicate if current PowerShell version is unsupported (PSv1 and v2) -- Fixed [#454](https://github.com/PowerShell/vscode-powershell/issues/454) - - ExecutionPolicy set via group policy or registry key should not cause language server to crash -- Fixed [#532](https://github.com/PowerShell/vscode-powershell/issues/532) - - DEVPATH environment variable not being set for interactive console session -- Fixed [PowerShellEditorServices #387](https://github.com/PowerShell/PowerShellEditorServices/issues/387) - - Write-(Warning, Verbose, Debug) are missing message prefixes and foreground colors -- Fixed [PowerShellEditorServices #382](https://github.com/PowerShell/PowerShellEditorServices/issues/382) - - PSHostUserInterface implementation should set SupportsVirtualTerminal to true - -## 0.10.0 -### Tuesday, March 14, 2017 - -#### New interactive console experience - -We are excited to provide you with the first release of our new interactive -console experience! When you open up a PowerShell script file, you will -be greeted with a new VS Code integrated terminal window called -"PowerShell Integrated Console" - -![integrated console screenshot](https://cloud.githubusercontent.com/assets/79405/23910661/b599f2ee-0897-11e7-9426-00af794c10b5.png) - -In this console you will have an experience that falls somewhere between -the PowerShell ISE and the PowerShell console host: - -- Tab completion of commands and their parameters -- Basic command history, accessed using the up/down arrow keys -- The `psedit` command opens existing files in an editor pane -- Pressing F8 in an editor pane runs the current line or selection in the console -- Native applications like `git` are fully supported -- Script debugging shares the same console session with the editor for - a true ISE-like debugging experience - -It even works with your fancy prompt function if configured in your -VS Code profile (`$HOME\Documents\WindowsPowerShell\Microsoft.VSCode_profile.ps1`): - -![custom prompt screenshot](https://cloud.githubusercontent.com/assets/79405/23910654/b1bca66c-0897-11e7-81b1-70eff5b97c21.png) - -The integrated console is supported on PowerShell v3 through v6 and works -on Linux and macOS with PowerShell Core. By default you don't have to -configure which PowerShell to run, we will pick an appropriate default -based on your platform. If you'd like to choose a different install -of PowerShell you can always change the `powershell.developer.powerShellExePath` -setting. - -Keep in mind that this is the first release for this feature and there are -bound to be issues and missing functionality. Please feel free to file -GitHub issues for any bugs or feature requests! - -##### Known Issues and Limitations - -- [#535](https://github.com/PowerShell/vscode-powershell/issues/535) PSReadline - is currently **not** supported in the integrated console. We will enable this - in a future release. -- [#534](https://github.com/PowerShell/vscode-powershell/issues/534) Integrated console - prompt is not restarted when you stop the debugging of a local runspace in another - process. This will be addressed soon in a patch update. -- [#533](https://github.com/PowerShell/vscode-powershell/issues/533) Backspace key - does not work in the integrated console on Linux and macOS. The workaround for now - is to use Ctrl+H instead of the Backspace key. This will be addressed - soon in a patch update. -- [#536](https://github.com/PowerShell/vscode-powershell/issues/536) Integrated console - sometimes does not have a scrollbar at startup. The workaround is to resize the width - of the VS Code window slightly and the scrollbar will appear. This will be addressed - soon in a patch update. - -#### Get-Credential and PSCredential support - -Now that we have the integrated console, we have added support for the `Get-Credential` -cmdlet, `Read-Host -AsSecureString`, and any input prompt of type `SecureString` or `PSCredential`. -When you run any of these cmdlets you will be prompted inside the integrated console: - -![credential screenshot](https://cloud.githubusercontent.com/assets/79405/23910668/bac9019c-0897-11e7-80e2-eaf1b9e507f8.png) - -#### Code formatting improvements - -We now support VS Code's `editor.formatOnType` setting so that your code gets formatted -as you type! Formatting will be triggered when you press Enter or the closing curly -brace character `}`. - -Based on your feedback, we've also added new code formatting options, all of which -are turned on by default: - -- `powershell.codeFormatting.newLineAfterCloseBrace` - Causes a newline to be inserted - after a closing brace in multi-line expressions like if/else -- `powershell.codeFormatting.whitespaceBeforeOpenBrace` - Causes whitespace to be - inserted before an open brace like `Foreach-Object {` -- `powershell.codeFormatting.whitespaceBeforeOpenParen` - Causes whitespace to be - inserted before an open parentheses like `if (` -- `powershell.codeFormatting.whitespaceAroundOperator` - Causes whitespace to be - inserted around operators like `=` or `+` -- `powershell.codeFormatting.whitespaceAfterSeparator` - Causes whitespace to be - inserted around separator characters like `;` and `,` -- `powershell.codeFormatting.ignoreOneLineBlock` - Single-line expressions, like - small if/else statements, will not be expanded to multiple lines. - -We've also made many improvements to the performance and stability of the formatter. - -#### Debugging improvements - -We've added a new configuration for debugging your Pester tests. By default it -merely runs `Invoke-Pester` at the workspace path, but you can also edit the -configuation to add additional arguments to be passed through. - -We've also added support for column breakpoints. Now you can set a breakpoint -directly within a pipeline by placing your cursor at any column on a line and -running the `Debug: Column Breakpoint` command: - -![column breakpoint screenshot](https://cloud.githubusercontent.com/assets/79405/23910649/aaef70e4-0897-11e7-93b7-0d729969a1e2.png) - -For the latest PowerShell Core release ([6.0.0-alpha.17](https://github.com/PowerShell/PowerShell/releases/tag/v6.0.0-alpha.17)), -we have also added the ability to step into ScriptBlocks that are executed on another -machine using `Invoke-Command -Computer`. - -Set a breakpoint on an `Invoke-Command` line and then once it's hit: - -![Invoke-Command screenshot](https://cloud.githubusercontent.com/assets/79405/23911032/c01b8ff6-0898-11e7-89e3-02a31d419fc5.png) - -Press `F11` and you will step into the ScriptBlock. You can now continue to use -"step in" and trace the ScriptBlock's execution on the remote machine: - -![remote script listing screenshot](https://cloud.githubusercontent.com/assets/79405/23918844/ca86cf28-08b1-11e7-8014-c689cdcccf87.png) - -Note that you cannot currently set breakpoints in the script listing file as -this code is being executed without an actual script file on the remote machine. - -#### Other fixes and improvements - -- Fixed [#427](https://github.com/PowerShell/vscode-powershell/issues/427) - - The keybinding for "Expand Alias" command has been changed to Shift+Alt+E -- Fixed [#519](https://github.com/PowerShell/vscode-powershell/issues/519) - - Debugger hangs after continuing when watch expressions are set -- Fixed [#448](https://github.com/PowerShell/vscode-powershell/issues/448) - - Code formatter should keep indentation for multi-line pipelines -- Fixed [#518](https://github.com/PowerShell/vscode-powershell/issues/518) - - Code formatter fails when dollar-paren `$()` expressions are used -- Fixed [#447](https://github.com/PowerShell/vscode-powershell/issues/447) - - Code formatter crashes when run on untitled documents - -## 0.9.0 -### Thursday, January 19, 2017 - -#### New PowerShell code formatter - -We've added a formatter for PowerShell code which allows you to format an -entire file or a selection within a file. You can access this formatter by -running VS Code's `Format Document` and `Format Selection` commands inside -of a PowerShell file. - -You can configure code formatting with the following settings: - -- `powershell.codeFormatting.openBraceOnSameLine` - Places open brace on the - same line as its associated statement. Default is `true`. -- `powershell.codeFormatting.newLineAfterOpenBrace` - Ensures that a new line - occurs after an open brace (unless in a pipeline statement on the same line). - Default is `true` -- `editor.tabSize` - Specifies the indentation width for code blocks. This - is a VS Code setting but it is respected by the code formatter. -- `editor.formatOnSave` - If true, automatically formats when they are saved. - This is a VS Code setting and may also affect non-PowerShell files. - -Please note that this is only a first pass at PowerShell code formatting, it -may not format your code perfectly in all cases. If you run into any issues, -please [file an issue](https://github.com/PowerShell/vscode-powershell/issues/new) -and give us your feedback! - -#### Streamlined debugging experience - launch.json is now optional! - -**NOTE: This improvement depends on VS Code 1.9.0 which is due for release -early February!** However, you can try it out right now with the [VS Code Insiders](https://code.visualstudio.com/insiders) -release. - -Thanks to a new improvement in VS Code's debugging APIs, we are now able to -launch the PowerShell debugger on a script file without the need for a `launch.json` -file. You can even debug individual PowerShell scripts without opening a -workspace folder! Don't worry, you can still use a `launch.json` file to configure -specific debugging scenarios. - -We've also made debugger startup much more reliable. You will no longer see the -dreaded "Debug adapter terminated unexpectedly" message when you try to launch -the debugger while the language server is still starting up. - -#### Support for debugging remote and attached runspaces - -We now support remote PowerShell sessions via the [`Enter-PSSession`](https://msdn.microsoft.com/en-us/powershell/reference/5.0/microsoft.powershell.core/enter-pssession) -cmdlet. This cmdlet allows you to create a PowerShell session on another machine -so that you can run commands or debug scripts there. The full debugging -experience works with these remote sessions on PowerShell 4 and above, allowing -you to set breakpoints and see remote files be opened locally when those breakpoints -are hit. - -For PowerShell 5 and above, we also support attaching to local and remote PowerShell -host processes using the [`Enter-PSHostProcess`](https://msdn.microsoft.com/en-us/powershell/reference/5.0/microsoft.powershell.core/enter-pshostprocess) -and [`Debug-Runspace`](https://msdn.microsoft.com/en-us/powershell/reference/5.0/microsoft.powershell.utility/debug-runspace) -cmdlets. This allows you to jump into another process and then debug a script that -is already running in one of the runspaces in that process. The debugger will break -execution of the running script and then the associated script file will be opened -in the editor so that you can set breakpoints and step through its execution. - -We've also added a new `launch.json` configuration for debugging PowerShell host processes: - -![Process launch configuration screenshot](https://cloud.githubusercontent.com/assets/79405/22089468/391e8120-dda0-11e6-950c-64f81b364c35.png) - -When launched, the default "attach" configuration will prompt you with a list of -PowerShell host processes on the local machine so that you can easily select one -to be debugged: - -![Process selection UI screenshot](https://cloud.githubusercontent.com/assets/79405/22081037/c205e516-dd76-11e6-834a-66f4c38e181d.png) - -You can also edit the launch configuration to hardcode the launch parameters, even -setting a remote machine to connect to before attaching to the remote process: - -```json - { - "type": "PowerShell", - "request": "attach", - "name": "PowerShell Attach to Host Process", - "computerName": "my-remote-machine", - "processId": "12345", - "runspaceId": 1 - } -``` - -Please note that we currently do not yet support initiating remote sessions from Linux -or macOS. This will be supported in an upcoming release. - -#### Initial support for remote file opening using `psedit` - -Another nice improvement is that we now support the `psedit` command in remote and -attached sessions. This command allows you to open a file in a local or remote session -so that you can set breakpoints in it using the UI before launching it. For now these -remotely-opened files will not be saved back to the remote session when you edit and -save them. We plan to add this capability in the next feature update. - -#### New "interactive session" debugging mode - -You can now create a new launch configuration which drops you directly into the -debug console so that you can debug your scripts and modules however you wish. -You can call Set-PSBreakpoint to set any type of breakpoint and then invoke your -code through the console to see those breakpoints get hit. This mode can also be -useful for debugging remote sessions. - -![Interactive session config screenshot](https://cloud.githubusercontent.com/assets/79405/22089502/5e56b4c6-dda0-11e6-8a51-f24e29ce7988.png) - -Please note that this is NOT a replacement for a true interactive console experience. -We've added this debugging configuration to enable a few other debugging scenarios, like -debugging PowerShell modules, while we work on a true interactive console experience using -VS Code's Terminal interface. - -#### New document symbol support for PSD1 files - -We've extended our document symbol support to `.psd1` files to make it really easy to -navigate through them. When you have a `.psd1` file open, run the `Go to Symbol in File...` -command (Ctrl + Shift + O) and you'll see this popup: - -![psd1 symbol screenshot](https://cloud.githubusercontent.com/assets/79405/22094872/85c7d9a2-ddc5-11e6-9bee-5fc8c3dae097.png) - -You can type a symbol name or navigate using your arrow keys. Once you select one of the -symbol names, the editor pane will jump directly to that line. - -#### Other fixes and improvements - -- Added a new `Open Examples Folder` command to easily open the extension's - example script folder. -- Added a new setting `powershell.developer.powerShellExeIsWindowsDevBuild` - which, when true, indicates that the `powerShellExePath` points to a Windows - PowerShell development build. -- Fixed [#395](https://github.com/PowerShell/vscode-powershell/issues/395): - Quick Fix for PSAvoidUsingAliases rule replaces the entire command -- Fixed [#396](https://github.com/PowerShell/vscode-powershell/issues/396): - Extension commands loaded in PowerShell profile are not being registered -- Fixed [#391](https://github.com/PowerShell/vscode-powershell/issues/391): - DSC IntelliSense can cause the language server to crash -- Fixed [#400](https://github.com/PowerShell/vscode-powershell/issues/400): - Language server can crash when selecting PSScriptAnalyzer rules -- Fixed [#408](https://github.com/PowerShell/vscode-powershell/issues/408): - Quick fix requests meant for other extensions crash the language server -- Fixed [#401](https://github.com/PowerShell/vscode-powershell/issues/401): - Extension startup should indicate if the current PowerShell version is unsupported -- Fixed [#314](https://github.com/PowerShell/vscode-powershell/issues/314): - Errors/Warnings still show up in Problems window when file is closed -- Fixed [#388](https://github.com/PowerShell/vscode-powershell/issues/388): - Syntax errors are not reported when powershell.scriptAnalysis.enable is set to false - -## 0.8.0 -### Friday, December 16, 2016 - -#### Improved PowerShell session management - -It's now much easier to manage the active PowerShell session. We've added a -new item to the status bar to indicate the state of the session and the version -of PowerShell you're using: - -![Screenshot of status indicator](https://cloud.githubusercontent.com/assets/79405/21247551/fcf2777c-c2e4-11e6-9659-7349c35adbcd.png) - -When this status item is clicked, a new menu appears to give you some session -management options: - -![Screenshot of session menu](https://cloud.githubusercontent.com/assets/79405/21247555/009fa64c-c2e5-11e6-8171-76914d3366a0.png) - -You can restart the active session, switch between 32-bit and 64-bit PowerShell on -Windows or switch to another PowerShell process (like a 6.0 alpha build) that -you've configured with the `powershell.developer.powerShellExePath`. - -We've also improved the overall experience of loading and using the extension: - -- It will prompt to restart the PowerShell session if it crashes for any reason -- It will also prompt to restart the session if you change any relevant PowerShell - configuration setting like the aforementioned `powershell.developer.powerShellExePath`. -- You can easily access the logs of the current session by running the command - `Open PowerShell Extension Logs Folder`. - -#### Create new modules with Plaster - -In this release we've added integration with the [Plaster](https://github.com/PowerShell/Plaster) -module to provide a `Create New Project from Plaster Template` command. This command will -walk you through the experience of selecting a template and filling in all of -the project details: - -![Screenshot of Plaster template selection](https://cloud.githubusercontent.com/assets/79405/21247560/087b47a4-c2e5-11e6-86e7-ba3727b5e36d.png) - -![Screenshot of Plaster input](https://cloud.githubusercontent.com/assets/79405/21247562/0a79b130-c2e5-11e6-97e9-cfd672803f75.png) - -We include one basic project template by default and will add more in the very -near future. However, you won't need to update the PowerShell extension to get these -new templates, they will appear when you install an update to the Plaster module from -the [PowerShell Gallery](https://www.powershellgallery.com/). - -Check out [Plaster's documentation](https://github.com/PowerShell/Plaster/tree/master/docs/en-US) -for more details on how it can be used and how you can create your own templates. - -#### New "quick fix" actions for PSScriptAnalyzer rules - -The PowerShell extension now uses any "suggested corrections" which are returned with -a rule violation in your script file to provide a "quick fix" option for the affected -section of code. For example, when the `PSAvoidUsingCmdletAliases` rule finds the use -of a non-whitelisted alias, you will see a light bulb icon that gives the option to -change to the full name (right click or Ctrl+. on the marker): - -![Screenshot of PSScriptAnalyzer quick fix](https://cloud.githubusercontent.com/assets/79405/21247558/05887e86-c2e5-11e6-9c67-e4558a7e2dba.png) - -If you'd like to see more quick fixes for PowerShell code, head over to the -[PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) GitHub page and -get involved! - -#### Easily enable and disable PSScriptAnalyzer rules - -Another improvement related to PSScriptAnalyzer is the ability to change the active -PSScriptAnalyzer rules in the current editing session using a helpful selection menu: - -![Screenshot of PSScriptAnalyzer rule selection](https://cloud.githubusercontent.com/assets/79405/21247557/037888b6-c2e5-11e6-816f-6732e13cddb7.png) - -You can enable and disable active rules by running the `Select PSScriptAnalyzer Rules` -command. For now this only changes the active session but in a future release we will -modify your PSScriptAnalyzer settings file so that the changes are persisted to future -editing sessions. - -#### New "hit count" breakpoints in the debugger - -When debugging PowerShell scripts you can now set "hit count" breakpoints which -cause the debugger to stop only after the breakpoint has been encountered a specified -number of times. - -![Screenshot of a hit count breakpoint](https://cloud.githubusercontent.com/assets/79405/21247563/0c159202-c2e5-11e6-8c91-36791c4fa804.png) - -#### Other fixes and improvements - -- We now provide snippets for the `launch.json` configuration file which make it easier - to add new PowerShell debugging configurations for your project. -- In PowerShell `launch.json` configurations, the `program` parameter has now been - renamed to `script`. Configurations still using `program` will continue to work. -- Fixed #353: Cannot start PowerShell debugger on Windows when offline -- Fixed #217: PowerShell output window should be shown when F8 is pressed -- Fixed #292: Check for Homebrew's OpenSSL libraries correctly on macOS -- Fixed #384: PowerShell snippets broken in VS Code 1.8.0 - -## 0.7.2 -### Friday, September 2, 2016 - -- Fixed #243: Debug adapter process has terminated unexpectedly -- Fixed #264: Add check for OpenSSL on OS X before starting the language service -- Fixed #271: PSScriptAnalyzer settings path isn't being passed along -- Fixed #273: Debugger crashes after multiple runs -- Fixed #274: Extension crashes on Ctrl+Hover - -## 0.7.1 -### Tuesday, August 23, 2016 - -- "Auto" variable scope in debugger UI now expands by default -- Fixed #244: Extension fails to load if username contains spaces -- Fixed #246: Restore default PSScriptAnalyzer ruleset -- Fixed #248: Extension fails to load on Windows 7 with PowerShell v3 - -## 0.7.0 -### Thursday, August 18, 2016 - -#### Introducing support for Linux and macOS! - -This release marks the beginning of our support for Linux and macOS via -the new [cross-platform release of PowerShell](https://github.com/PowerShell/PowerShell). -You can find installation and usage instructions at the [PowerShell GitHub repository](https://github.com/PowerShell/PowerShell). - -## 0.6.2 -### Friday, August 12, 2016 - -- Fixed #231: In VS Code 1.4.0, IntelliSense has stopped working -- Fixed #193: Typing "n" breaks intellisense -- Fixed #187: Language server sometimes crashes then $ErrorActionPreference = "Stop" - -## 0.6.1 -### Monday, May 16, 2016 - -- Fixed #180: Profile loading should be enabled by default -- Fixed #183: Language server sometimes fails to initialize preventing IntelliSense, etc from working -- Fixed #182: Using 'Run Selection' on a line without a selection only runs to the cursor position -- Fixed #184: When running a script in the debugger, $host.Version reports wrong extension version - -## 0.6.0 -### Thursday, May 12, 2016 - -#### Added a new cross-editor extensibility model - -- We've added a new extensibility model which allows you to write PowerShell - code to add new functionality to Visual Studio Code and other editors with - a single API. If you've used `$psISE` in the PowerShell ISE, you'll feel - right at home with `$psEditor`. Check out the [documentation](https://powershell.github.io/PowerShellEditorServices/guide/extensions.html) - for more details! - -#### Support for user and system-wide profiles - -- We've now introduced the `$profile` variable which contains the expected - properties that you normally see in `powershell.exe` and `powershell_ise.exe`: - - `AllUsersAllHosts` - - `AllUsersCurrentHost` - - `CurrentUserAllHosts` - - `CurrentUserCurrentHost` -- In Visual Studio Code the profile name is `Microsoft.VSCode_profile.ps1`. -- `$host.Name` now returns "Visual Studio Code Host" and `$host.Version` returns - the version of the PowerShell extension that is being used. - -#### Other improvements - -- IntelliSense for static methods and properties now works correctly. If you - type `::` after a type such as `[System.Guid]` you will now get the correct - completion results. This also works if you press `Ctrl+Space` after the `::` - characters. -- `$env` variables now have IntelliSense complete correctly. -- Added support for new VSCode command `Debug: Start Without Debugging`. Shortcut - for this command is Ctrl+F5. -- Changed the keyboard shortcut for `PowerShell: Expand Alias` from Ctrl+F5 to Ctrl+Alt+e. -- Added support for specifying a PSScriptAnalyzer settings file by - providing a full path in your User Settings for the key `powershell.scriptAnalysis.settingsPath`. - You can also configure the same setting in your project's `.vscode\settings.json` - file to contain a workspace-relative path. If present, this workspace-level setting - overrides the one in your User Settings file. See the extension's `examples\.vscode\settings.json` - file for an example. -- The debug adapter now does not crash when you attempt to add breakpoints - for files that have been moved or don't exist. -- Fixed an issue preventing output from being written in the debugger if you - don't set a breakpoint before running a script. - -#### New configuration settings - -- `powershell.scriptAnalysis.settingsPath`: Specifies the path to a PowerShell Script Analyzer settings file. Use either an absolute path (to override the default settings for all projects) or use a path relative to your workspace. - -## 0.5.0 -### Thursday, March 10, 2016 - -#### Support for PowerShell v3 and v4 - -- Support for PowerShell v3 and v4 is now complete! Note that for this release, - Script Analyzer support has been disabled for PS v3 and v4 until we implement - a better strategy for integrating it as a module dependency - -#### Debugging improvements - -- Added support for command breakpoints. - - Hover over the Debug workspace's 'Breakpoints' list header and click the 'Add' - button then type a command name (like `Write-Output`) in the new text box that - appears in the list. - -- Added support for conditional breakpoints. - - Right click in the breakpoint margin to the left of the code editor and click - 'Add conditional breakpoint' then enter a PowerShell expression in the text box - that appears in the editor. - -#### Other improvements - -- Added a preview of a possible project template for PowerShell Gallery modules in - the `examples` folder. Includes a PSake build script with Pester test, clean, - build, and publish tasks. See the `examples\README.md` file for instructions. - Check it out and give your feedback on GitHub! -- `using 'module'` now resolves relative paths correctly, removing a syntax error that - previously appeared when relative paths were used -- Calling `Read-Host -AsSecureString` or `Get-Credential` from the console now shows an - appropriate "not supported" error message instead of crashing the language service. - Support for these commands will be added in a later release. - -#### New configuration settings - -- `powershell.useX86Host`: If true, causes the 32-bit language service to be used on 64-bit Windows. On 32-bit Windows this setting has no effect. - -## 0.4.1 -### Wednesday, February 17, 2016 - -- Updated PSScriptAnalyzer 1.4.0 for improved rule marker extents -- Added example Pester task for running tests in the examples folder -- Fixed #94: Scripts fail to launch in the debugger if the working directory path contains spaces - -## 0.4.0 -### Tuesday, February 9, 2016 - -#### Debugging improvements - -[@rkeithhill](https://github.com/rkeithhill) spent a lot of time polishing the script debugging experience for this release: - -- You can now pass arguments to scripts in the debugger with the `args` parameter in launch.json -- You can also run your script with the 32-bit debugger by changing the `type` parameter in launch.json to "PowerShell x86" (also thanks to [@adamdriscoll](https://github.com/adamdriscoll)!) -- The new default PowerShell debugger configuration now launches the active file in the editor -- You can also set the working directory where the script is run by setting the `cwd` parameter in launch.json to an absolute path. If you need a workspace relative path, use ${workspaceRoot} to create an absolute path e.g. `"${workspaceRoot}/modules/foo.psm1"`. - -We recommend deleting any existing `launch.json` file you're using so that a new one will -be generated with the new defaults. - -#### Console improvements - -- Improved PowerShell console output formatting and performance - - The console prompt is now displayed after a command is executed - - Command execution errors are now displayed correctly in more cases - - Console output now wraps at 120 characters instead of 80 characters - -- Added choice and input prompt support - - When executing code using the 'Run Selection' command, choice and input prompts appear as VS Code UI popups - - When executing code in the debugger, choice and input prompts appear in the Debug Console - -#### New commands - -- "Find/Install PowerShell modules from the gallery" (`Ctrl+K Ctrl+F`): Enables you to find and install modules from the PowerShell Gallery (thanks [@dfinke](https://github.com/dfinke)!) -- "Open current file in PowerShell ISE" (`Ctrl+Shift+i`): Opens the current file in the PowerShell ISE (thanks [@janegilring](https://github.com/janegilring)!) - -#### Editor improvements - -- Path auto-completion lists show just the current directory's contents instead of the full path (which had resulted in clipped text) -- Parameter auto-completion lists are now sorted in the same order as they are in PowerShell ISE where command-specific parameters preceed the common parameters -- Parameter auto-completion lists show the parameter type -- Command auto-completion lists show the resolved command for aliases and the path for executables -- Many improvements to the PowerShell snippets, more clearly separating functional and example snippets (all of the latter are prefixed with `ex-`) -- Added some additional example script files in the `examples` folder - -#### New configuration settings - -- `powershell.developer.editorServicesLogLevel`: configures the logging verbosity for PowerShell Editor Services. The default log level will now write less logs, improving overall performance - -## 0.3.1 -### Thursday, December 17, 2015 - -- Fix issue #49, Debug Console does not receive script output - -## 0.3.0 -### Tuesday, December 15, 2015 - -- Major improvements in variables retrieved from the debugging service: - - Global and script scope variables are now accessible - - New "Auto" scope which shows only the variables defined within the current scope - - Greatly improved representation of variable values, especially for dictionaries and - objects that implement the ToString() method -- Added new "Expand Alias" command which resolves command aliases used in a file or - selection and updates the source text with the resolved command names -- Reduced default Script Analyzer rules to a minimal list -- Fixed a wide array of completion text replacement bugs -- Improved extension upgrade experience - -## 0.2.0 -### Monday, November 23, 2015 - -- (Experimental) Added a new "Run selection" (F8) command which executes the current code selection and displays the output -- Added a new online help command! Press Ctrl+F1 to get help for the symbol under the cursor. -- Enabled PowerShell language features for untitled and in-memory (e.g. in Git diff viewer) PowerShell files -- Added `powershell.scriptAnalysis.enable` configuration variable to allow disabling script analysis for performance (issue #11) -- Fixed issue where user's custom PowerShell snippets did not show up -- Fixed high CPU usage when completing or hovering over an application path - -## 0.1.0 -### Wednesday, November 18, 2015 - -Initial release with the following features: - -- Syntax highlighting -- Code snippets -- IntelliSense for cmdlets and more -- Rule-based analysis provided by PowerShell Script Analyzer -- Go to Definition of cmdlets and variables -- Find References of cmdlets and variables -- Document and workspace symbol discovery -- Local script debugging and basic interactive console support +# PowerShell Extension Release History + +## v2020.5.0 +### Wednesday, May 06, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- [vscode-powershell #2676](https://github.com/PowerShell/vscode-powershell/pull/2676) - + Fix Pester invocation for 3x versions. (Thanks @nohwnd!) +- [vscode-powershell #2674](https://github.com/PowerShell/vscode-powershell/pull/2674) - + Add additional settings for PSScriptAnalyzer 1.19. (Thanks @bergmeister!) +- [vscode-powershell #2672](https://github.com/PowerShell/vscode-powershell/pull/2672) - + Use in-memory debug adapter instead of spinning up new process. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🛫🐛 [PowerShellEditorServices #1285](https://github.com/PowerShell/PowerShellEditorServices/pull/1285) - + Use API on ScriptBlock to generate PSCommand to run in ConstrainedLanguage mode. +- ⚡️🧠 [PowerShellEditorServices #1283](https://github.com/PowerShell/PowerShellEditorServices/pull/1283) - + Move to Omnisharp lib 0.17.0 for increased performance. +- ✨👮 [PowerShellEditorServices #1280](https://github.com/PowerShell/PowerShellEditorServices/pull/1280) - + Add additional settings for PSScriptAnalyzer 1.19. (Thanks @bergmeister!) +- 🔗 🐛 [vscode-powershell #305](https://github.com/PowerShell/PowerShellEditorServices/pull/1279) - + Fix document highlight column. +- 🐛🧠 [PowerShellEditorServices #1276](https://github.com/PowerShell/PowerShellEditorServices/pull/1276) - + Handle when no CommandInfo comes back from Get-Command to prevent an Exception showing up in logs. + +## v2020.4.3-preview +### Tuesday, April 28, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🛫 ✨ [vscode-powershell #2651](https://github.com/PowerShell/vscode-powershell/pull/2651) - + Add setting for the PackageManagement update feature. +- 👮‍ 🐛 [vscode-powershell #2659](https://github.com/PowerShell/vscode-powershell/pull/2659) - + Remove broken 'Select PSScriptAnalyzer Rules' command. (Thanks @bergmeister!) +- 🛫 ✨ [vscode-powershell #2526](https://github.com/PowerShell/vscode-powershell/pull/2653) - + Clean up WaitForSessionFile logic and support increasing timeout with warning. +- 📟 ✨ [vscode-powershell #2644](https://github.com/PowerShell/vscode-powershell/pull/2644) - + Display preview state and version info in PSIC startup banner. (Thanks @rkeithhill!) +- 👷 ✨ [vscode-powershell #2645](https://github.com/PowerShell/vscode-powershell/pull/2645) - + Add workspace file to load both vscode-powershell and PSES. (Thanks @rkeithhill!) + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 📟 🐛 [PowerShellEditorServices #1272](https://github.com/PowerShell/PowerShellEditorServices/pull/1272) - + Allow progress colors to be settable and gettable from the internal host. +- 🛫 ✨ [PowerShellEditorServices #1239](https://github.com/PowerShell/PowerShellEditorServices/pull/1239) - + Prompt to update PackageManagement when using an old version. +- 🛫 ✨ [PowerShellEditorServices #1269](https://github.com/PowerShell/PowerShellEditorServices/pull/1269) - + Support ConstrainedLanguage mode. +- 📺 ✨ [PowerShellEditorServices #1268](https://github.com/PowerShell/PowerShellEditorServices/pull/1268) - + Refactor GetCommandHandler to not use dynamic. +- 🔍 🐛 [vscode-powershell #2654](https://github.com/PowerShell/PowerShellEditorServices/pull/1270) - + Fix interpolation in Log points, switch to double quotes. (Thanks @rkeithhill!) +- [PowerShellEditorServices #1267](https://github.com/PowerShell/PowerShellEditorServices/pull/1267) - + Update module manifest to match current module. +- 📟 🐛 [vscode-powershell #2637](https://github.com/PowerShell/PowerShellEditorServices/pull/1264) - + Leverage internal HostUI to check if VT100 is supported. +- 📟 🐛 [vscode-powershell #2637](https://github.com/PowerShell/PowerShellEditorServices/pull/1263) - + Use stable builds of PSReadLine for the PowerShell extension and preview builds for the PowerShell Preview extension. +- 💎 ✨ [vscode-powershell #2543](https://github.com/PowerShell/PowerShellEditorServices/pull/1262) - + Allow formatting when ScriptAnalysis setting is set to disabled. + +## v2020.4.0 +### Thursday, April 15, 2020 + +- ⚡️🧠 Better performance of overall but especially IntelliSense. +- 🐛📟 Errors show up properly on screen in PowerShell Integrated Console. +- ✨🐢 Run a single test in Pester v5 by setting `"powershell.pester.useLegacyCodeLens": false`. +- 🐛🔧 Ignore files specified in `files.exclude` and `search.exclude` in reference/CodeLens search. + +## v2020.4.2-preview +### Monday, April 13, 2020 +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛📟 [PowerShellEditorServices #1258](https://github.com/PowerShell/PowerShellEditorServices/pull/1258) - + No more warning about PowerShellEditorServices module being imported with unapproved verb. + +## v2020.4.1-preview +### Wednesday, April 09, 2020 +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- ✨📟 [PowerShellEditorServices #1255](https://github.com/PowerShell/PowerShellEditorServices/pull/1255) - + Move PSReadLine invocation into cmdlets to get closer to supporting ConstrainedLanguage mode. Also removes hard coded PSReadLine assembly version. + +## v2020.4.0-preview +### Wednesday, April 08, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- ✨👷 [vscode-powershell #2617](https://github.com/PowerShell/vscode-powershell/pull/2617) - + Use PowerShell Daily in CI. +- 🐛📖 [vscode-powershell #2618](https://github.com/PowerShell/vscode-powershell/pull/2618) - + Fix link to 'Exchange Online Connection' in community snippets ToC. (Thanks @hjorslev!) +- 🐛🐢 [vscode-powershell #2606](https://github.com/PowerShell/vscode-powershell/pull/2606) - + Fix Pester CodeLens setting which allows Pester v4 scripts to work again. (Thanks @nohwnd!) + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- ✨👷 [PowerShellEditorServices #1252](https://github.com/PowerShell/PowerShellEditorServices/pull/1252) - + Use PowerShell Daily in CI. +- 🐛⚡️🧠🔗 [PowerShellEditorServices #1251](https://github.com/PowerShell/PowerShellEditorServices/pull/1251) - + Add cancellation to SignatureHelp request and cache results for cmdlets on `Get-Command` and `Get-Help`. + +## v2020.3.2-preview +### Tuesday, March 31, 2020 +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- ✨📟 [PowerShellEditorServices #1245](https://github.com/PowerShell/PowerShellEditorServices/pull/1245) - + Better PSReadLine version filter check to include 2.1.0+ prereleases. +- 🐛⚡️🧠🔗 [PowerShellEditorServices #1248](https://github.com/PowerShell/PowerShellEditorServices/pull/1248) - + Fix cancellation for completions and add `textDocument/hover` cancellation support. + +## v2020.3.1-preview +### Thursday, March 26, 2020 +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛🧠 [vscode-powershell #2584](https://github.com/PowerShell/PowerShellEditorServices/pull/1243) - + Refactor GetCommandSynopsisAsync method to make sure cmdlets with module prefixes work. +- 🐛⚡️🧠📚 [vscode-powershell #2556](https://github.com/PowerShell/PowerShellEditorServices/pull/1238) - + Add cancellation for `textDocument/completion`, `textDocument/codeAction`, `textDocument/folding`. +- ✨👮 [vscode-powershell #2572](https://github.com/PowerShell/PowerShellEditorServices/pull/1241) - + Only run diagnostics on PowerShell files. +- ⚡️🧠 [PowerShellEditorServices #1237](https://github.com/PowerShell/PowerShellEditorServices/pull/1237) - + Optimize when we run GetCommandInfoAsync to use the pipeline less for Intellisense. + +## v2020.3.0-preview +### Thursday, March 12, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🐛👷‍♀️ [vscode-powershell #2533](https://github.com/PowerShell/vscode-powershell/pull/2533) - + Change source repository's recommended extension from ms-vscode.csharp to ms-dotnettools.csharp. (Thanks @devlead!) +- ✨🐢 [vscode-powershell #2441](https://github.com/PowerShell/vscode-powershell/pull/2441) - + Run a single Pester test. (Thanks @nohwnd!) +- 🐛🔧 [vscode-powershell #2524](https://github.com/PowerShell/vscode-powershell/pull/2524) - + Add `files.exclude` and `search.exclude` to configurations sent through to exclude them from PSES functionality + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- ✨🧠 [PowerShellEditorServices #1232](https://github.com/PowerShell/PowerShellEditorServices/pull/1232) - + Only resolve completion items from commands. +- ✨🐢 [PowerShellEditorServices #1167](https://github.com/PowerShell/PowerShellEditorServices/pull/1167) - + Run a single test in Pester v5. (Thanks @nohwnd!) +- 🐛🔍 [vscode-powershell #2534](https://github.com/PowerShell/PowerShellEditorServices/pull/1230) - + Ensure that errors are written to the console when debugging. +- 🐛🔍 [vscode-powershell #2525](https://github.com/PowerShell/PowerShellEditorServices/pull/1229) - + Don't warn users when using `Clear-Host` in temp sessions. +- ✨💎 [PowerShellEditorServices #1228](https://github.com/PowerShell/PowerShellEditorServices/pull/1228) - + Add better logging for formatter and refactor it into 1 class. +- 🐛🚂 [vscode-powershell #2397](https://github.com/PowerShell/PowerShellEditorServices/pull/1227) - + Use Assembly.LoadFile for dependency loading in WinPS. +- ✨🛫 [PowerShellEditorServices #1222](https://github.com/PowerShell/PowerShellEditorServices/pull/1222) - + Make initial logging work in constrained language mode, allowing the desired user-facing error to present. +- 🐛🛫 [PowerShellEditorServices #1225](https://github.com/PowerShell/PowerShellEditorServices/pull/1225) - + Sign Clear-Host.ps1. +- 🐛🛫 [PowerShellEditorServices #1219](https://github.com/PowerShell/PowerShellEditorServices/pull/1219) - + Ensure log directory is created. +- 🐛👷‍♀️ [PowerShellEditorServices #1223](https://github.com/PowerShell/PowerShellEditorServices/pull/1223) - + Change Ms-vscode.csharp to ms-dotnettools.csharp. (Thanks @devlead!) +- 🐛🔧 [PowerShellEditorServices #1220](https://github.com/PowerShell/PowerShellEditorServices/pull/1220) - + Fix typo in settings. +- ✨🔧 [PowerShellEditorServices #1218](https://github.com/PowerShell/PowerShellEditorServices/pull/1218) - + Switch to better document selecting for vim extension. +- 🐛🧠 [PowerShellEditorServices #1217](https://github.com/PowerShell/PowerShellEditorServices/pull/1217) - + Make session-state lock task-reentrant to fix Untitled file debugging. + +## v2020.3.0 +### Thursday, March 12, 2020 + +#### Release of preview work to stable branch + +This release, coinciding with the [GA release of PowerShell 7](https://devblogs.microsoft.com/powershell/announcing-PowerShell-7-0/), +brings a year of work on the PowerShell extension into the stable release. +The timing of this release is deliberate, since some of the new features +depend on additions and bugfixes in PowerShell 7, +while others have a much better experience in PowerShell 7 +thanks to many improvements shipping with it. + +Some changes that come to the stable channel in this release include: + +- [Integration of PSReadLine into the Integrated Console](https://github.com/PowerShell/vscode-PowerShell/issues/535), + enabling syntax highlighting, a better (and more configurable) completion experience, + multiline editing and searchable history in the PowerShell Integrated Console +- Performance and reliability improvements gained + by [replacing](https://github.com/PowerShell/PowerShellEditorServices/pull/1056) + a hand-rolled Language Server Protocol stack + with the LSP server library from the Omnisharp project +- An [ISE compatibility mode](https://github.com/PowerShell/vscode-powershell/pull/2335) + setting to toggle a more ISE-like user experience +- Debugging improvements in PowerShell 7, + [using its new debugging APIs](https://github.com/PowerShell/PowerShellEditorServices/pull/1119) +- [End of support for PowerShell v3/v4 and .NET 4.5.2](https://github.com/PowerShell/vscode-PowerShell/issues/1310) + +After this release, the stable/preview channels will now function as originally intended, +where the preview channel will be the beta release +for features to come out in the following stable release. + +You may also notice that the history of the changelog has changed. +For a full list of changes between this release and the previous stable release, +see [here](https://github.com/PowerShell/vscode-powershell/blob/master/docs/preview_to_stable_changelog.md). +You can find the changelog from the old stable fork +[here](https://github.com/PowerShell/vscode-powershell/blob/legacy/1.x/CHANGELOG.md). + +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- ✨📺 [vscode-PowerShell #2503](https://github.com/PowerShell/vscode-powershell/pull/2503) - + Pick up the PowerShell dotnet global tool as a PowerShell runtime. +- 🐛🛫 [vscode-PowerShell #2491](https://github.com/PowerShell/vscode-powershell/pull/2498) - + Fix a startup issue where console becomes unresponsive due to the client waiting for the terminal PID from VSCode. +- 🐛👮 [vscode-PowerShell #2190](https://github.com/PowerShell/vscode-powershell/pull/2484) - + Look for `PSScriptAnalyzerSettings.psd1` in the workspace root by default for script analysis, + defaulting back to the default rules when not found. +- 🧰 [vscode-PowerShell #2477](https://github.com/PowerShell/vscode-powershell/pull/2477) - + Stop using the `caption` field on `powerShell/showChoicePrompt` messages, + and instead display only the `message` field. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛📟 [PowerShellEditorServices #1201](https://github.com/PowerShell/PowerShellEditorServices/pull/1201) - + Fix newlines in error formatting. +- 🐛👮 [vscode-PowerShell #2489](https://github.com/PowerShell/PowerShellEditorServices/pull/1206) - + Fix PSScriptAnalyzer not using default rules when no settings file present. +- 🐛📟 [vscode-PowerShell #2291](https://github.com/PowerShell/PowerShellEditorServices/pull/1207) - + Fix `Read-Host` dropping characters. +- 🐛📺 [vscode-PowerShell #2424](https://github.com/PowerShell/PowerShellEditorServices/pull/1209) - + Fix `F8` not working repeatedly in an Interactive Debugging session. +- 🐛🛫 [vscode-PowerShell #2404](https://github.com/PowerShell/PowerShellEditorServices/pull/1208) - + Fix execution policy being set incorrectly at startup on Windows. +- 🐛🧠 [vscode-PowerShell #2364](https://github.com/PowerShell/PowerShellEditorServices/pull/1210) - + Fix intellisense and `F5` not working after debugging. +- 🐛🧰 [vscode-PowerShell #2495](https://github.com/PowerShell/PowerShellEditorServices/pull/1211) - + Fix PowerShellEditorServices.Commands module commands not working due to types being moved. +- 🐛👮 [vscode-PowerShell #2516](https://github.com/PowerShell/PowerShellEditorServices/pull/1216) - + Fix CommentHelp for when a function has other problems with it. + +## v2020.2.0 +### Thursday, February 20, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🐛📖 [vscode-PowerShell #2470](https://github.com/PowerShell/vscode-powershell/pull/2470) - + Fix incorrect reference to `New-ManifestModule` in documentation. (Thanks @rbleattler!) +- 🐛📺 [vscode-PowerShell #2469](https://github.com/PowerShell/vscode-powershell/pull/2469) - + Close other open pwsh instances when updating PowerShell. +- 🐛📟 [vscode-PowerShell #2434](https://github.com/powershell/vscode-powershell/pull/2437) - + Use a new VSCode API to hide the integrated terminal from the shell list + until debugging when `showOnStartup` is disabled. +- ✨🐢 [vscode-PowerShell #2445](https://github.com/PowerShell/vscode-powershell/pull/2445) - + Add `Run/Debug Pester tests` context menu options in the VSCode explorer + for Pester test files. (Thanks @bergmeister!) +- 🐛🐢 [vscode-PowerShell #2438](https://github.com/PowerShell/vscode-powershell/pull/2447/) - + Fixes test failures in Pester contexts not showing up in the Problems pane. (Thanks @tillig!) +- 🐛🔍 [vscode-PowerShell #2548](https://github.com/PowerShell/vscode-powershell/pull/2458) - + Show error message instead of not responding when temp debugging is used with an untitled file. +- 👷 [vscode-PowerShell #2465](https://github.com/PowerShell/vscode-powershell/pull/2465) - + Move macOS CI images to 10.14 (Thanks @bergmeister!) + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛📁 [vscode-PowerShell #2421](https://github.com/powershell/powershelleditorservices/pull/1161) - + Fix WorkspacePath so that references work with non-ASCII characters. +- 🐛📟 [vscode-PowerShell #2372](https://github.com/powershell/powershelleditorservices/pull/1162) - + Fix prompt behavior when debugging. +- 🐛🛫 [PowerShellEditorServices #1171](https://github.com/powershell/powershelleditorservices/pull/1171) - + Fix race condition where running multiple profiles caused errors. +- 🐛📟 [vscode-PowerShell #2420](https://github.com/powershell/powershelleditorservices/pull/1173) - + Fix an issue where pasting to a `Get-Credential` prompt in some Windows versions caused a crash. +- 🐛📟 [vscode-PowerShell #1790](https://github.com/powershell/powershelleditorservices/pull/1174) - + Fix an inconsistency where `Read-Host -Prompt 'prompt'` would return `$null` rather than empty string + when given no input. +- 🐛🔗 [PowerShellEditorServices #1177](https://github.com/powershell/powershelleditorservices/pull/1174) - + Fix an issue where untitled files did not work with CodeLens. +- ⚡️⏱️ [PowerShellEditorServices #1172](https://github.com/powershell/powershelleditorservices/pull/1172) - + Improve `async`/`await` and `Task` usage to reduce concurrency overhead and improve performance. +- 🐛📟 [PowerShellEditorServices #1178](https://github.com/powershell/powershelleditorservices/pull/1178) - + Improve PSReadLine experience where no new line is rendered in the console. +- ✨🔍 [PowerShellEditorServices #1119](https://github.com/powershell/powershelleditorservices/pull/1119) - + Enable new debugging APIs added in PowerShell 7, improving performance and fixing issues where + the debugger would stop responding or be unable to update breakpoints while scripts were running. +- 👷📟 [PowerShellEditorServices #1187](https://github.com/PowerShell/PowerShellEditorServices/pull/1187) - + Upgrade built-in PSReadLine to 2.0.0 GA. +- 🐛👮 [PowerShellEditorServices #1179](https://github.com/PowerShell/PowerShellEditorServices/pull/1179) - + Improve integration with PSScriptAnalyzer, improving performance, + fixing an error when PSScriptAnalyzer is not available, fix CodeActions not appearing on Windows, + fix an issue where the PSModulePath is reset by PSScriptAnalyzer opening new runspaces. +- 🚂 [PowerShellEditorServices #1183](https://github.com/PowerShell/PowerShellEditorServices/pull/1183) - + Close over public APIs not intended for external use and replace with new, async-friendly APIs. + +## v2020.1.0 +### Monday, January 13, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🛫 ✨ [vscode-powershell #2384](https://github.com/PowerShell/vscode-PowerShell/pull/2400) - + Add -Login startup option. +- 🛫 🐛 [vscode-powershell #2380](https://github.com/PowerShell/vscode-PowerShell/pull/2399) - + Make PowerShell names case insensitive for configuration. +- 🛫 📺 ✨ [vscode-powershell #2370](https://github.com/PowerShell/vscode-PowerShell/pull/2398) - + Add configuration to enable/disable banner. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 📺 [vscode-powershell #2405](https://github.com/PowerShell/PowerShellEditorServices/pull/1152) - + Add tooltip to completions ParameterValue. +- 🛫 🐛 [vscode-powershell #2393](https://github.com/PowerShell/PowerShellEditorServices/pull/1151) - + Probe netfx dir for deps. +- 🚂 ⏱️ 🐛 [vscode-powershell #2352](https://github.com/PowerShell/PowerShellEditorServices/pull/1149) - + Fix lock up that occurs when WinForms is executed on the pipeline thread. +- 💭 🐛 [vscode-powershell #2402](https://github.com/PowerShell/PowerShellEditorServices/pull/1150) - + Fix temp debugging after it broke bringing in $psEditor. +- 🧠 🐛 [vscode-powershell #2324](https://github.com/PowerShell/PowerShellEditorServices/pull/1143) - + Fix unicode character uri bug. +- 🛫 📺 ✨ [vscode-powershell #2370](https://github.com/PowerShell/PowerShellEditorServices/pull/1141) - + Make startup banner simpler. +- [vscode-powershell #2386](https://github.com/PowerShell/PowerShellEditorServices/pull/1140) - + Fix uncaught exception when SafeToString returns null. (Thanks @jborean93!) +- 🔗 🐛 [vscode-powershell #2374](https://github.com/PowerShell/PowerShellEditorServices/pull/1139) - + Simplify logic of determining Reference definition. +- 🛫 🐛 [vscode-powershell #2379](https://github.com/PowerShell/PowerShellEditorServices/pull/1138) - + Use -Option AllScope to fix Windows PowerShell error. + +## v2019.12.0 +### Wednesday, December 11, 2019 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- ✨ 📺 [vscode-PowerShell #2335](https://github.com/PowerShell/vscode-powershell/pull/2335) - + Add editor command `PowerShell: Enable/Disable ISE Mode` for ISE emulation in VS Code. +- ⚡️ 🛫 [vscode-PowerShell #2348](https://github.com/PowerShell/vscode-PowerShell/pull/2348) - + Start EditorServices without start script. +- ✨ 📟 [vscode-PowerShell #2316](https://github.com/PowerShell/vscode-PowerShell/pull/2316) - + Add `powershell.integratedConsole.forceClearScrollbackBuffer` setting to enable `Clear-Host` to clear scrollback buffer. +- 🐛 📺 [vscode-PowerShell #2325](https://github.com/PowerShell/vscode-PowerShell/pull/2325) - + Fix update PowerShell feature on windows. +- 🔧 📁 🐛 [vscode-powershell #2099](https://github.com/PowerShell/vscode-PowerShell/pull/2304) - + Use `powerShellDefaultVersion` everywhere and stop using `powerShellExePath`. +- 🐛 📺 [vscode-PowerShell #2294](https://github.com/PowerShell/vscode-PowerShell/pull/2294) - + Buttons show up for untitled files. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 👷 📟 [PowerShellEditorServices #1129](https://github.com/PowerShell/PowerShellEditorServices/pull/1129) - + Update PSReadLine to 2.0.0-rc1 in modules.json. +- 🛫 🐛 ⚡️ [vscode-powershell #2292](https://github.com/PowerShell/PowerShellEditorServices/pull/1118) - + Isolate PSES dependencies from PowerShell on load + make PSES a pure binary module. +- ✨ 📟 [PowerShellEditorServices #1108](https://github.com/PowerShell/PowerShellEditorServices/pull/1108) - + Clear the terminal via the LSP message `editor/clearTerminal`. +- 🔍 🐛 [vscode-powershell #2319](https://github.com/PowerShell/PowerShellEditorServices/pull/1117) - + Run one invocation per SetBreakpoints request. (Thanks @SeeminglyScience!) +- 🐛 [PowerShellEditorServices #1114](https://github.com/PowerShell/PowerShellEditorServices/pull/1114) - + Fix `Import-EditorCommand -Module`. (Thanks @sk82jack!) +- 🐛 🔍 [PowerShellEditorServices #1112](https://github.com/PowerShell/PowerShellEditorServices/pull/1112) - + Fix breakpoint setting deadlock. +- 🔗 🐛 [vscode-powershell #2306](https://github.com/PowerShell/PowerShellEditorServices/pull/1110) - + Fix references on Windows due to bad WorkspacePath. +- ✨ 👷 [PowerShellEditorServices #993](https://github.com/PowerShell/PowerShellEditorServices/pull/993) - + Add devcontainer support for building in container. (Thanks @bergmeister!) +- 🛫 🐛 [vscode-powershell #2311](https://github.com/PowerShell/PowerShellEditorServices/pull/1107) - + Protect against no RootUri (no open workspace). +- 🐛 📟 [vscode-powershell #2274](https://github.com/PowerShell/PowerShellEditorServices/pull/1092) - + Fix '@' appearing in console. +- 👮‍ 🐛 [vscode-powershell #2288](https://github.com/PowerShell/PowerShellEditorServices/pull/1094) - + Use RootUri.LocalPath for workspace path. +- 🐛 👮‍ [PowerShellEditorServices #1101](https://github.com/PowerShell/PowerShellEditorServices/pull/1101) - + Add `PSAvoidAssignmentToAutomaticVariable` to the default set of PSSA rules. (Thanks @bergmeister!) +- 👮‍ 🔗 🐛 [vscode-powershell #2290](https://github.com/PowerShell/PowerShellEditorServices/pull/1098) - + Fix diagnostics not showing in untitled files and now also show CodeLens. +- 🔍 🐛 [vscode-powershell #1850](https://github.com/PowerShell/PowerShellEditorServices/pull/1097) - + Fixes no prompt showing up when debugging. +- 🚂 📺 🐛 [vscode-powershell #2284](https://github.com/PowerShell/PowerShellEditorServices/pull/1096) - + Fix running indicator by ignoring PSRL aborts. + +## v2019.11.0 +### Friday, November 1, 2019 + +##### Special Note +In this release of the preview extension, +we've merged significant architectural work into PowerShell Editor Services. +After several months of work, PSES now uses the Omnisharp LSP library +to handle Language Server Protocol interaction instead of rolling its own, +allowing PSES to concentrate on being a good PowerShell backend. +We hope you'll see increased performance and stability in this release. +As always, [please let us know if you find any issues](https://github.com/PowerShell/vscode-powershell/issues/new/choose). + +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 🔧 [vscode-PowerShell #2262](https://github.com/PowerShell/vscode-PowerShell/pull/2262) - + Introduce `powershell.integratedConsole.useLegacyReadline` setting disable PSReadLine. +- 🛫🐛[vscode-powershell #2217](https://github.com/PowerShell/vscode-PowerShell/pull/2238) - + Discover new PowerShell installations, fix startup issue with Windows PowerShell. +- 📺 [vscode-PowerShell #2225](https://github.com/PowerShell/vscode-PowerShell/pull/2225) - + Surface `InvokeRegisteredEditorCommand` in the Command Palette. (Thanks @jpogran!) +- 📺 [vscode-PowerShell #2224](https://github.com/PowerShell/vscode-PowerShell/pull/2224) - + Provide Run Selection button in editor title menu. (Thanks @jpogran!) +- 👷 [vscode-powershell #2229](https://github.com/PowerShell/vscode-PowerShell/pull/2232) - + Fix version check in Install-VSCode.ps1. +- 🚂 [vscode-PowerShell #2226](https://github.com/PowerShell/vscode-PowerShell/pull/2226) - + Changes needed for Omnisharp migration of PowerShellEditorServices. +- 🔍 [vscode-powershell #2144](https://github.com/PowerShell/vscode-PowerShell/pull/2223) - + Fix debugging restart capability by ensuring the session file is not deleted. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛 [PowerShellEditorServices #1080](https://github.com/PowerShell/PowerShellEditorServices/pull/1080) - + Remove extra newline in GetComment feature. +- 🐛 [PowerShellEditorServices #1079](https://github.com/PowerShell/PowerShellEditorServices/pull/1079) - + Fix duplicate diagnostics caused by DidChange handler. +- 🔧 [PowerShellEditorServices #1076](https://github.com/PowerShell/PowerShellEditorServices/pull/1076) - + Graduate PSReadLine feature and add UseLegacyReadLine. +- ⚙️ [PowerShellEditorServices #1075](https://github.com/PowerShell/PowerShellEditorServices/pull/1075) - + Lock OmniSharp dependencies to v0.14.0. (Thanks @mholo65!) +- 📟 [PowerShellEditorServices #1064](https://github.com/PowerShell/PowerShellEditorServices/pull/1064) - + Add support for terminal error color settings in PS7. +- 🐛 [PowerShellEditorServices #1073](https://github.com/PowerShell/PowerShellEditorServices/pull/1073) - + Fix prerelease version discovery and fix omnisharp change. +- 🐛 [PowerShellEditorServices #1065](https://github.com/PowerShell/PowerShellEditorServices/pull/1065) - + Fix TEMP debugging. +- 🐛 [vscode-powershell #1753](https://github.com/PowerShell/PowerShellEditorServices/pull/1072) - + Override PSRL ReadKey on Windows as well. +- 🚂 [PowerShellEditorServices #1056](https://github.com/PowerShell/PowerShellEditorServices/pull/1056) - + Re-architect PowerShell Editor Services to use the Omnisharp LSP platform. +- 🐛 [vscode-powershell #2116](https://github.com/PowerShell/PowerShellEditorServices/pull/1044) - + Fix UNC intellisense backslash. + +## v2019.9.0 +### Monday, September 23, 2019 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- 👷 [vscode-powershell #1961](https://github.com/PowerShell/vscode-powershell/pull/1961) - + Changelog tools. +- 🐛 [vscode-powershell #2141](https://github.com/PowerShell/vscode-powershell/pull/2141) - + Null check on activeTerminal to workaround vscode behavior. +- ✨ [vscode-powershell #2105](https://github.com/PowerShell/vscode-powershell/pull/2105) - + Prompt to update PowerShell version. +- 🔎 [vscode-powershell #2165](https://github.com/PowerShell/vscode-powershell/pull/2165) - + Add powershell.codeFormatting.autoCorrectAliases setting to add support for optionally correcting aliases as well (added in PSSA 1.18.2). Disabled by default.. (Thanks @bergmeister!) +- ✨ [vscode-powershell #2160](https://github.com/PowerShell/vscode-powershell/pull/2160) - + Added functionality to install the User variant of Stable Edition. (Thanks @Lothindir!) +- ✨ [vscode-powershell #2156](https://github.com/PowerShell/vscode-powershell) - + Default to PowerShell Core on Windows if it's installed. (Thanks @SydneyhSmith!) +- ✨ [vscode-powershell #2084](https://github.com/PowerShell/vscode-powershell/pull/2084) - + Implement #1611 - provide dynamic debug config. (Thanks @rkeithhill!) +- ✨ [vscode-powershell #2024](https://github.com/PowerShell/vscode-powershell/pull/2039) - + Add machine scope per VS Code team request. +- ✨ [vscode-powershell #2081](https://github.com/PowerShell/vscode-powershell/pull/2081) - + Add param-block snippet. (Thanks @AspenForester!) +- 🧹 [vscode-powershell #2062](https://github.com/PowerShell/vscode-powershell/pull/2062) - + Remove redundant snippets. (Thanks @travis-c-lagrone!) +- ✨ [vscode-powershell #1974](https://github.com/PowerShell/vscode-powershell/pull/1974) - + Add #Requires snippets. (Thanks @travis-c-lagrone!) +- 🧹 [vscode-powershell #2063](https://github.com/PowerShell/vscode-powershell/pull/2063) - + Remove redundant community snippets. (Thanks @travis-c-lagrone!) +- 👷 [vscode-powershell #2065](https://github.com/PowerShell/vscode-powershell/pull/2065) - + Update '.vscode/settings.json' to identify snippet files as 'JSON with Comments'. (Thanks @travis-c-lagrone!) +- 📔 [vscode-powershell #2065](https://github.com/PowerShell/vscode-powershell) - + Docs updates. (Thanks @SydneyhSmith!) +- 👷 [vscode-powershell #2038](https://github.com/PowerShell/vscode-powershell/pull/2038) - + Add ADS insiders gallery file to update script. +- 🔎 [vscode-powershell #2037](https://github.com/PowerShell/vscode-powershell/pull/2037) - + Update PSScriptAnalyzer docs Url to point to master branch because master is now the default branch. (Thanks @bergmeister!) +- 🐛 [vscode-powershell #2035](https://github.com/PowerShell/vscode-powershell/pull/2035) - + #1019: Get format settings from document editor instead of global. (Thanks @tillig!) +- 👷 [vscode-powershell #2025](https://github.com/PowerShell/vscode-powershell/pull/2025) - + Fix node version detect logic to handle node v10. (Thanks @rkeithhill!) +- ✨ [vscode-powershell #1946](https://github.com/PowerShell/vscode-powershell/pull/1946) - + Add ArgumentCompleter snippets. (Thanks @travis-c-lagrone!) +- 🧹 [vscode-powershell #2015](https://github.com/PowerShell/vscode-powershell/pull/2015) - + Fix node types version. + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- 🐛 [PowerShellEditorServices #1022](https://github.com/PowerShell/PowerShellEditorServices/pull/1022) - + Catch stream exceptions for some Debug Adapter stability. +- 🔎 [PowerShellEditorServices #1021](https://github.com/PowerShell/PowerShellEditorServices/pull/1021) - + Add AutoCorrectAliases setting (PR to be made in VS-Code repo as well) to add support for optionally correcting aliases as well (added in PSSA 1.18.2). (Thanks @bergmeister!). +- 🐛 [vscode-powershell #1994](https://github.com/PowerShell/PowerShellEditorServices/pull/1000) - + Fix crash when setBreakpoint from VSCode sends a git:/ URI. +- 🧹 [PowerShellEditorServices #988](https://github.com/PowerShell/PowerShellEditorServices/pull/988) - + Remove consoleecho lib for PowerShell 7. +- 📔 [PowerShellEditorServices #986](https://github.com/PowerShell/PowerShellEditorServices) - + Documentation updates. (Thanks @SydneyhSmith!) +- ⚙️ [PowerShellEditorServices #981](https://github.com/PowerShell/PowerShellEditorServices/pull/981) - + Update NewtonSoft.Json dependency from 10.0.3 to 11.02 since PS 6.0 has been deprecated. (Thanks @bergmeister!) +- 🐛 [vscode-powershell #2007](https://github.com/PowerShell/PowerShellEditorServices/pull/974) - + Defend against crash when no PSScriptAnalyzer is found. +- 👷 [PowerShellEditorServices #978](https://github.com/PowerShell/PowerShellEditorServices/pull/977) - + Delete stale WebSocket code. + +## v2019.5.0 +### Wednesday, May 22, 2019 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- ✨ [vscode-PowerShell #1880](https://github.com/PowerShell/vscode-powershell/pull/1911) - + Move to date-based versioning +- ✨ [vscode-PowerShell #1954](https://github.com/PowerShell/vscode-PowerShell/pull/1954) - + Allow passing runspace name +- ✨ [vscode-PowerShell #1945](https://github.com/PowerShell/vscode-PowerShell/pull/1945) - + Edit snippets to support $TM_SELECTED_TEXT (Thanks @travis-c-lagrone!) +- 👷 [vscode-PowerShell #1942](https://github.com/PowerShell/vscode-PowerShell/pull/1942) - + Stop supporting 6.0 +- ✨ [vscode-PowerShell #1928](https://github.com/PowerShell/vscode-PowerShell/pull/1928) - + Add RunCode command for CodeLens providers +- 🐛 [vscode-PowerShell #1927](https://github.com/PowerShell/vscode-PowerShell/pull/1927) - + Fix change session by moving to async/await promise +- 🐛 [vscode-PowerShell #1931](https://github.com/PowerShell/vscode-PowerShell/pull/1931) - + Fix upload bug report +- 🐛 [vscode-PowerShell #1925](https://github.com/PowerShell/vscode-PowerShell/pull/1925) - + Fix error in HtmlContentView.ShowContent when no JS/CSS provided (Thanks @rkeithhill!) +- 🐛 [vscode-PowerShell #1919](https://github.com/PowerShell/vscode-PowerShell/pull/1919) - + Fix CustomViews by switching to WebViews +- 🐛 [vscode-PowerShell #1922](https://github.com/PowerShell/vscode-PowerShell/pull/1922) - + Fix small typo in Function-Inline description (Thanks @V-ed!) +- ✨ [vscode-PowerShell #1908](https://github.com/PowerShell/vscode-PowerShell/pull/1908) - + Add PowerShell version telemetry +- 📖 [vscode-PowerShell #1900](https://github.com/PowerShell/vscode-PowerShell/pull/1900) - + Small update to Azure Data Studio marketplace README (Thanks @SQLvariant!) +- 💻 [vscode-PowerShell #1871](https://github.com/PowerShell/vscode-PowerShell/pull/1871) - + Change CI to use Azure Pipelines +- 🐛 [vscode-PowerShell #1867](https://github.com/PowerShell/vscode-PowerShell/pull/1867) - + Change whitespace settings to camelCase +- 🐛 [vscode-PowerShell #1852](https://github.com/PowerShell/vscode-PowerShell/pull/1852) - + Turn `powershell.codeformatting.useCorrectCasing` setting off by default until PSScriptAnalyzer issues are fixed (Thanks @bergmeister!) +- 🐛 [vscode-powershell #1822](https://github.com/PowerShell/vscode-PowerShell/pull/1838) - + Set featureFlag default to null so that it can be resolved by settings +- 💻 [vscode-PowerShell #1839](https://github.com/PowerShell/vscode-PowerShell/pull/1839) - + Add initial credscan config ymls for CI +- 🐛 [vscode-PowerShell #1837](https://github.com/PowerShell/vscode-PowerShell/pull/1837) - + Don't use -EncodedCommand to start PowerShell on Windows +- 🐛 [vscode-PowerShell #1825](https://github.com/PowerShell/vscode-PowerShell/pull/1825) - + Switch to current lowercase names for powershell and mdlint extensions (Thanks @rkeithhill!) +- 👷 [vscode-PowerShell #1823](https://github.com/PowerShell/vscode-PowerShell/pull/1823) - + Update to official TSLint extension in extensions.json, old version deprecated (Thanks @rkeithhill!) + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- ✨ [PowerShellEditorServices #951](https://github.com/PowerShell/PowerShellEditorServices/pull/951) - + Allow passing RunspaceName +- 🚨 [PowerShellEditorServices #944](https://github.com/PowerShell/PowerShellEditorServices/pull/944) - + Add integration testing module with simple tests to verify PSES starts and stops +- 🐛 [PowerShellEditorServices #954](https://github.com/PowerShell/PowerShellEditorServices/pull/955) - + Ensure NamedPipeServerStream is assigned in Windows PowerShell +- ✨ [PowerShellEditorServices #952](https://github.com/PowerShell/PowerShellEditorServices/pull/952) - + Update to PSReadLine 2.0.0-beta4 +- ✨ [PowerShellEditorServices #877](https://github.com/PowerShell/PowerShellEditorServices/pull/877) - + Add filtering for CodeLens and References (Thanks @glennsarti!) +- 🐛 [vscode-powershell #1933](https://github.com/PowerShell/PowerShellEditorServices/pull/949) - + Stop crash when workspace doesn't exist +- 👷 [PowerShellEditorServices #878](https://github.com/PowerShell/PowerShellEditorServices/pull/878) - + Remove native named pipes implementation +- 🐛 [PowerShellEditorServices #947](https://github.com/PowerShell/PowerShellEditorServices/pull/947) - + Fix silent failure in VSCode WebViews by using Id for dictionary since multiple pages could have the same title +- 🐛 [PowerShellEditorServices #946](https://github.com/PowerShell/PowerShellEditorServices/pull/946) - + Rename to use async +- 👷 [PowerShellEditorServices #943](https://github.com/PowerShell/PowerShellEditorServices/pull/943) - + Improvements to the log parsing module (Thanks @rkeithhill!) +- 💻 [PowerShellEditorServices #921](https://github.com/PowerShell/PowerShellEditorServices/pull/921) - + Set up CI with Azure Pipelines +- 🐛 [PowerShellEditorServices #908](https://github.com/PowerShell/PowerShellEditorServices/pull/908) - + Fix issue with reference code lens not working with UNC paths (Thanks @rkeithhill!) +- 🐛 [vscode-powershell #1571](https://github.com/PowerShell/PowerShellEditorServices/pull/911) - + Fix faulty netfx check +- 🐛 [PowerShellEditorServices #906](https://github.com/PowerShell/PowerShellEditorServices/pull/906) - + Fix New-EditorFile with no folder or no files open +- ✨ [vscode-powershell #1398](https://github.com/PowerShell/PowerShellEditorServices/pull/902) - + Improve path auto-completion (Thanks @rkeithhill!) +- 🐛 [PowerShellEditorServices #910](https://github.com/PowerShell/PowerShellEditorServices/pull/910) - + Fix UseCorrectCasing to be actually configurable via `powershell.codeFormatting.useCorrectCasing` (Thanks @bergmeister!) +- 👷 [PowerShellEditorServices #909](https://github.com/PowerShell/PowerShellEditorServices/pull/909) - + Use global.json to pin .Net Core SDK version and update it from 2.1.402 to 2.1.602 (Thanks @bergmeister!) +- 👷 [PowerShellEditorServices #903](https://github.com/PowerShell/PowerShellEditorServices/pull/903) - + Move temp folder into repo to avoid state that causes build errors from time to time when rebuilding locally (and packages have updated) (Thanks @bergmeister!) +- 💻 [PowerShellEditorServices #904](https://github.com/PowerShell/PowerShellEditorServices/pull/904) - + Add initial credscan configuation ymls for CI +- 🐛 [PowerShellEditorServices #901](https://github.com/PowerShell/PowerShellEditorServices/pull/901) - + Switch to current lowercase names for powershell and mdlint exts (Thanks @rkeithhill!) + +## v2.0.0-preview.3 +### Wednesday, April 10, 2019 +#### [vscode-powershell](https://github.com/powershell/vscode-powershell) + +- [vscode-PowerShell #1865](https://github.com/PowerShell/vscode-powershell/pull/1867) - + Change casing of `powershell.codeformatting` settings for consistency: + - `powershell.codeformatting.WhitespaceInsideBrace` is now `powershell.codeformatting.whitespaceInsideBrace` + - `powershell.codeformatting.WhitespaceAroundPipe` is now `powershell.codeformatting.whitespaceAroundPipe` +- [vscode-PowerShell #1852](https://github.com/PowerShell/vscode-PowerShell/pull/1852) - + Turn `powershell.codeformatting.useCorrectCasing` setting off by default until PSSA issues are fixed (Thanks @bergmeister!) +- [vscode-PowerShell #1838](https://github.com/PowerShell/vscode-PowerShell/pull/1838) - + Set PSReadLine featureFlag default to null so that it can be resolved by settings +- [vscode-PowerShell #1837](https://github.com/PowerShell/vscode-PowerShell/pull/1837) - + Do not use -EncodedCommand on Windows +- [vscode-PowerShell #1825](https://github.com/PowerShell/vscode-PowerShell/pull/1825) - + Switch to current lowercase names for powershell and mdlint recommended extensions (Thanks @rkeithhill!) +- [vscode-PowerShell #1823](https://github.com/PowerShell/vscode-PowerShell/pull/1823) - + Update to official TSLint ext in extensions.json, old version deprecated (Thanks @rkeithhill!) + +#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) + +- [PowerShellEditorServices #902](https://github.com/PowerShell/PowerShellEditorServices/pull/902) - + Improve path auto-completion (Thanks @rkeithhill!) +- [PowerShellEditorServices #910](https://github.com/PowerShell/PowerShellEditorServices/pull/910) - + Fix UseCorrectCasing to be actually configurable via `powershell.codeFormatting.useCorrectCasing` (Thanks @bergmeister!) +- [PowerShellEditorServices #909](https://github.com/PowerShell/PowerShellEditorServices/pull/909) - + Use global.json to pin .Net Core SDK version and update it from 2.1.402 to 2.1.602 (Thanks @bergmeister!) +- [PowerShellEditorServices #903](https://github.com/PowerShell/PowerShellEditorServices/pull/903) - + Move temp folder into repo to avoid state that causes build errors from time to time when rebuilding locally (and packages have updated) (Thanks @bergmeister!) + +## v2.0.0-preview.2 +### Friday, March 29, 2019 + +### Highlights + +* `Write-Progress` work in the integrated console ⏰ +* Support for [PSScriptAnalyzer 1.18](https://github.com/PowerShell/PSScriptAnalyzer/releases/tag/1.18.0) 📝 +* The ability to debug any runspace in any process 🔎 +* PSReadLine enabled by default on Windows 🎨 +* (Bug fix!) You can open untitled workspaces/folders again! 🐛☠️ + +There are a lot more goodies in this version. Checkout the changelog below! + +#### [vscode-powershell](https://github.com/powershell/vscode-powershell) + +- [vscode-PowerShell #1794](https://github.com/PowerShell/vscode-PowerShell/pull/1794) - + Make PSReadLine default on Windows +- [vscode-PowerShell #1736](https://github.com/PowerShell/vscode-PowerShell/pull/1736) - + Enable attach to process on Linux and macOS +- [vscode-PowerShell #1729](https://github.com/PowerShell/vscode-PowerShell/pull/1729) - + Handle Pester Describe block strings with single quotes inside it (Thanks @bergmeister!) +- [vscode-PowerShell #1741](https://github.com/PowerShell/vscode-PowerShell/pull/1741) - + Update build to clear node modules directory (Thanks @corbob!) +- [vscode-PowerShell #1743](https://github.com/PowerShell/vscode-PowerShell/pull/1743) - + Fix right-click help lookup not always working (Thanks @corbob!) +- [vscode-PowerShell #1746](https://github.com/PowerShell/vscode-PowerShell/pull/1746) - + Add label property to debug config, change pkg name to lowercase (Thanks @rkeithhill!) +- [vscode-PowerShell #1749](https://github.com/PowerShell/vscode-PowerShell/pull/1749) - + Add the Install-VSCode.ps1 script to signing +- [vscode-PowerShell #1747](https://github.com/PowerShell/vscode-PowerShell/pull/1747) - + Modify `powerShellDefaultVersion` description to make clearer (Thanks @rkeithhill!) +- [vscode-PowerShell #1755](https://github.com/PowerShell/vscode-PowerShell/pull/1755) - + Speed up Travis builds by skipping the .NET Core initialization (Thanks @bergmeister!) +- [vscode-PowerShell #1773](https://github.com/PowerShell/vscode-PowerShell/pull/1773) - + Change debugger type field back to `PowerShell` from `powershell` (Thanks @rkeithhill!) +- [vscode-PowerShell #1757](https://github.com/PowerShell/vscode-PowerShell/pull/1757) - + Match Install-VSCode.ps1 script url with the one from master branch (Thanks @rafaltra!) +- [vscode-PowerShell #1774](https://github.com/PowerShell/vscode-PowerShell/pull/1774) - + Switch to `EncodedCommand` for script execution +- [vscode-PowerShell #1764](https://github.com/PowerShell/vscode-PowerShell/pull/1764) - + Added Pester, ShouldProcess and Calculated Property PS Snippets (Thanks @brettmillerb!) +- [vscode-PowerShell #1776](https://github.com/PowerShell/vscode-PowerShell/pull/1776) - + Migrate Pester version detection into an InovkePester stub script (Thanks @rkeithhill!) +- [vscode-PowerShell #1781](https://github.com/PowerShell/vscode-PowerShell/pull/1781) - + Fix initial launch config casing +- [vscode-PowerShell #1775](https://github.com/PowerShell/vscode-PowerShell/pull/1775) - + Support `-CustomPipeName`, allowing configuration of custom namedpipes for LSP transport +- [vscode-PowerShell #1787](https://github.com/PowerShell/vscode-PowerShell/pull/1787) - + Added SQL PowerShell Examples (Thanks @SQLvariant!) +- [vscode-PowerShell #1782](https://github.com/PowerShell/vscode-PowerShell/pull/1782) - + Add Debug Runspace command (Thanks @adamdriscoll!) +- [vscode-PowerShell #1800](https://github.com/PowerShell/vscode-PowerShell/pull/1800) - + Include current runspace and runspace ID 1 in the PSHostProcess picker dialog +- [vscode-PowerShell #1687](https://github.com/PowerShell/vscode-PowerShell/pull/1687) - + Add new `powershell.useCorrectCasingsettings` for new rule in PSSA 1.18: PSUseCorrectCasing (Thanks @bergmeister!) +- [vscode-PowerShell #1668](https://github.com/PowerShell/vscode-PowerShell/pull/1668) - + Add new `powershell.codeFormatting` settings for new options in PSSA 1.18: WhitespaceInsideBrace and WhitespaceAroundPipe (Thanks @bergmeister!) +- [vscode-PowerShell #1669](https://github.com/PowerShell/vscode-PowerShell/pull/1669) - + Add new `powershell.codeFormatting` settings for new options in PSSA 1.18: PipelineIndentationStyle (Thanks @bergmeister!) +- [vscode-PowerShell #1738](https://github.com/PowerShell/vscode-PowerShell/pull/1738) - + Set CommandExplorer exclusion filter to be empty array by default (Thanks @adilio!) +- [vscode-PowerShell #1686](https://github.com/PowerShell/vscode-PowerShell/pull/1686) - + Add an exclusion filter to the Command Explorer (Thanks @corbob!) +- [vscode-PowerShell #1816](https://github.com/PowerShell/vscode-PowerShell/pull/1816) - + Workaround PSSA #1187 by defaulting to NoIndentation + +#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) + +- [PowerShellEditorServices #895](https://github.com/PowerShell/PowerShellEditorServices/pull/895) - + Add warning to parameter validation set (Thanks @Benny1007!) +- [PowerShellEditorServices #897](https://github.com/PowerShell/PowerShellEditorServices/pull/897) - + Clean up and pop dead runspaces when using 'attach' debugging +- [PowerShellEditorServices #888](https://github.com/PowerShell/PowerShellEditorServices/pull/888) - + Add new ParseError level to ScriptFileMarkerLevel and filter out PSSA parse errors +- [PowerShellEditorServices #858](https://github.com/PowerShell/PowerShellEditorServices/pull/858) - + Fix XUnit warnings that better assertion operators should be used. (Thanks @bergmeister!) +- [PowerShellEditorServices #854](https://github.com/PowerShell/PowerShellEditorServices/pull/854) - + Reinstate test filtering (Thanks @glennsarti!) +- [PowerShellEditorServices #866](https://github.com/PowerShell/PowerShellEditorServices/pull/866) - + Catch NotSupportedException which can be thrown by FileStream constructor (Thanks @rkeithhill!) +- [PowerShellEditorServices #868](https://github.com/PowerShell/PowerShellEditorServices/pull/868) - + Speed up Travis builds by skipping the .NET Core initialization (Thanks @bergmeister!) +- [PowerShellEditorServices #869](https://github.com/PowerShell/PowerShellEditorServices/pull/869) - + Added `AsNewFile` switch to Out-CurrentFile (Thanks @dfinke!) +- [PowerShellEditorServices #873](https://github.com/PowerShell/PowerShellEditorServices/pull/873) - + Return the start line number for Describe block (Thanks @rkeithhill!) +- [PowerShellEditorServices #876](https://github.com/PowerShell/PowerShellEditorServices/pull/876) - + Temporarily disable deemphasized stack frames to fix VSCode issue 1750 (Thanks @rkeithhill!) +- [PowerShellEditorServices #871](https://github.com/PowerShell/PowerShellEditorServices/pull/871) - + Support -CustomPipeName, allowing configuration of custom namedpipes for LSP transport +- [PowerShellEditorServices #872](https://github.com/PowerShell/PowerShellEditorServices/pull/872) - + Fix unable to open files in problems/peek windows issue (Thanks @rkeithhill!) +- [PowerShellEditorServices #875](https://github.com/PowerShell/PowerShellEditorServices/pull/875) - + Add attach to local runspace. (Thanks @adamdriscoll!) +- [PowerShellEditorServices #881](https://github.com/PowerShell/PowerShellEditorServices/pull/881) - + Use `NamedPipeConnectionInfo` to connect to remote runspaces instead of Enter-PSHostProcess +- [PowerShellEditorServices #845](https://github.com/PowerShell/PowerShellEditorServices/pull/845) - + Enable UseCorrectCasing as a default rule (Thanks @bergmeister!) +- [PowerShellEditorServices #835](https://github.com/PowerShell/PowerShellEditorServices/pull/835) - + Map new `powershell.codeformatting` settings WhitespaceInsideBrace and WhitespaceAroundPipe to PSSA settings hashtable (Thanks @bergmeister!) +- [PowerShellEditorServices #836](https://github.com/PowerShell/PowerShellEditorServices/pull/836) - + Add PipelineIndentationStyle configuration mapping (Thanks @bergmeister!) +- [PowerShellEditorServices #887](https://github.com/PowerShell/PowerShellEditorServices/pull/887) - + Cherry pick PR 1750 merge commit to legacy/v1.x, has additional fixes (Thanks @rkeithhill!) +- [PowerShellEditorServices #874](https://github.com/PowerShell/PowerShellEditorServices/pull/874) - + Use public `InternalHost` from origin runspace (Thanks @SeeminglyScience!) +- [PowerShellEditorServices #889](https://github.com/PowerShell/PowerShellEditorServices/pull/889) - + Enhance Get-PsesRpcNotificationMessage/MessageResponseTimes to allow filtering by message name (Thanks @rkeithhill!) +- [PowerShellEditorServices #859](https://github.com/PowerShell/PowerShellEditorServices/pull/859) - + Upgrade PowerShellStandard.Library, PowerShell.SDK, NET.Test.SDK and Serilog NuGet packages to latest released version and enable AppVeyor build on any branch (Thanks @bergmeister!) +- [PowerShellEditorServices #862](https://github.com/PowerShell/PowerShellEditorServices/pull/862) - + Handle arbitrary exceptions when recursing workspace + +## v2.0.0-preview.1 +### Wednesday, January 23, 2019 + +#### Preview builds of the PowerShell extension are now available in VSCode + +We are excited to announce the PowerShell Preview extension in the VSCode marketplace! +The PowerShell Preview extension allows users on Windows PowerShell 5.1 and PowerShell Core 6 to get and test the latest updates +to the PowerShell extension and comes with some exciting features. + +The PowerShell Preview extension is a substitute for the PowerShell extension so +both the PowerShell extension and the PowerShell Preview extension should not be enabled at the same time. + +By having a preview channel, in addition to our existing stable channel, we can get new features out faster and get feedback faster from you, the users. + +##### How to Get/Use the PowerShell Preview extension + +If you dont already have VSCode, start [here](https://code.visualstudio.com/Docs/setup/setup-overview). + +Once you have VSCode open, click `Clt+Shift+X` to open the extensions marketplace. +Next, type `PowerShell Preview` in the search bar. +Click `Install` on the `PowerShell Preview` page. +Finally, click `Reload` in order to refresh VSCode. + +If you already have the PowerShell extension, please disable it to use the Powershell Preview extension. +To disable the PowerShell extension, find it in the Extensions sidebar view, specifically under the list of Enabled extensions, +Right-click on the PowerShell extension and select `Disable`. +Please note that it is important to only have either the PowerShell extension or the PowerShell Preview extension enabled at one time. +![How to Disable](https://github.com/PowerShell/powershell.github.io/blob/master/PowerShell-Blog/Images/disable-extension.jpg) + +#### What the first preview contains + +The v2.0.0-preview.1 version of the extension is built on .NET Standard +(enabling support for both Windows PowerShell and PowerShell Core from one assembly) + +It also contains PSReadLine support in the integrated console for Windows behind a feature flag. +PSReadLine provides a consistent and rich interactive experience, +including syntax coloring and multi-line editing and history, in the PowerShell console, in Cloud Shell, +and now in VSCode terminal. For more information on the benefits of PSReadLine, +check out their [documentation](https://docs.microsoft.com/en-us/powershell/module/psreadline/about/about_psreadline?view=powershell-6). + +To enable PSReadLine support in the Preview version on Windows, please add the following to your user settings: + +``` +"powershell.developer.featureFlags": [ "PSReadLine" ] +``` + +HUGE thanks to @SeeminglyScience for all his amazing work getting PSReadLine working in PowerShell Editor Services! + +#### Breaking Changes + +As stated above, this version of the PowerShell extension only works with Windows PowerShell versions 5.1 and PowerShell Core 6. + +#### [vscode-powershell](https://github.com/powershell/vscode-powershell) + +- [vscode-PowerShell #1587](https://github.com/PowerShell/vscode-PowerShell/pull/1587) - + Removed ShowOnlineHelp Command (Thanks @corbob!) + +#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) + +- [PowerShellEditorServices #792](https://github.com/PowerShell/PowerShellEditorServices/pull/792) - + Add Async suffix to async methods (Thanks @dee-see!) +- [PowerShellEditorServices #775](https://github.com/PowerShell/PowerShellEditorServices/pull/775) - + Removed ShowOnlineHelp Message (Thanks @corbob!) +- [PowerShellEditorServices #769](https://github.com/PowerShell/PowerShellEditorServices/pull/769) - + Set Runspaces to use STA when running in Windows PowerShell +- [PowerShellEditorServices #741](https://github.com/PowerShell/PowerShellEditorServices/pull/741) - + Migrate to netstandard2.0 and PSStandard +- [PowerShellEditorServices #672](https://github.com/PowerShell/PowerShellEditorServices/pull/672) - + PSReadLine integration (Thanks @SeeminglyScience!) + +## v1.10.2 +### Tuesday, December 18, 2018 + +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- [vscode-PowerShell #1632](https://github.com/PowerShell/vscode-powershell/pull/1632) - + Started [a document for ISE-like configuration of VSCode](https://github.com/PowerShell/vscode-powershell/blob/master/docs/ise_compatibility.md). + Please help us build it out by [contirbuting an edit](https://github.com/PowerShell/vscode-powershell/edit/master/docs/ise_compatibility.md). + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- [PowerShellEditorServices #811](https://github.com/PowerShell/PowerShellEditorServices/pull/805) - + Fix token-based folding (thanks @glennsarti!) +- [PowerShellEditorServices #823](https://github.com/PowerShell/PowerShellEditorServices/pull/823) - + Fix case-sensitivity of Pester CodeLens (thanks @bergmeister!) +- [PowerShellEditorServices #815](https://github.com/PowerShell/PowerShellEditorServices/pull/815) - + Fix crash when untitled files opened as PowerShell +- [PowerShellEditorServices #826](https://github.com/PowerShell/PowerShellEditorServices/pull/826) - + Fix crash when duplicate references are present in the same file + +## v1.10.1 +### Friday, December 7, 2018 + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- [PowerShellEditorServices #808](https://github.com/PowerShell/PowerShellEditorServices/pull/808) - + Fix startup crash on Windows 7 +- [PowerShellEditorServices #807](https://github.com/PowerShell/PowerShellEditorServices/pull/807) - + Fix deadlock occurring while connecting to named pipes + +## v1.10.0 +### Monday, December 3, 2018 +#### [vscode-powershell](https://github.com/PowerShell/vscode-powershell) + +- [vscode-PowerShell #1610](https://github.com/PowerShell/vscode-powershell/pull/1610) - + Remove client-side syntax folding provider in favor of server-side provider (thanks @glennsarti!) +- [vscode-PowerShell #1616](https://github.com/PowerShell/vscode-powershell/pull/1616) - + Make `Restart Current Session` always available in the session quick pick +- [vscode-PowerShell #1406](https://github.com/PowerShell/vscode-powershell/pull/1406) - + Add a Show-Command explorer (thanks @corbob!) +- [vscode-PowerShell #1615](https://github.com/PowerShell/vscode-powershell/pull/1615) - + Fix Pester CodeLens not working for running/debugging tests (thanks @rkeithhill!) +- [vscode-PowerShell #1600](https://github.com/PowerShell/vscode-powershell/pull/1608) - + Add CodeAction support to show PSSA rule documentation (thanks @rkeithhill!) +- [vscode-PowerShell #1606](https://github.com/PowerShell/vscode-powershell/pull/1606) - + Add Ctrl+Alt+J (Cmd+Alt+J on macOS) + keybinding to open up list of available snippets +- [vscode-PowerShell #1597](https://github.com/PowerShell/vscode-powershell/pull/1597) - + Make `Install-VSCode.ps1` work on macOS and Linux. Get the script [here](https://github.com/PowerShell/vscode-powershell/blob/master/scripts/Install-VSCode.ps1) +- [vscode-PowerShell #1580](https://github.com/PowerShell/vscode-powershell/pull/1580) - + `New-EditorFile` works on non-PowerShell untitled files +- [vscode-PowerShell #1557](https://github.com/PowerShell/vscode-powershell/pull/1557) - + Default to showing the last line in folded regions. Unset with `"powershell.codeFolding.showLastLine": false` + (thanks @glennsarti!) +- [vscode-PowerShell #1567](https://github.com/PowerShell/vscode-powershell/pull/1567) - + New snippet: Exchange Online connection (thanks @vmsilvamolina!) +- [vscode-PowerShell #1567](https://github.com/PowerShell/vscode-powershell/pull/1567) - + New snippet: HTML header (thanks @vmsilvamolina!) +- [vscode-PowerShell #1555](https://github.com/PowerShell/vscode-powershell/pull/1555) - + Log when language client not loaded during initialization (thanks @corbob!) +- [vscode-PowerShell #1554](https://github.com/PowerShell/vscode-powershell/pull/1554) - + Fix spacing in parameters when starting the extension (thanks @rkeithhill!) + +#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) + +- [PowerShellEditorServices #786](https://github.com/PowerShell/PowerShellEditorServices/pull/786) - + Fix #17: Add go to definition support for dot sourced file paths (Thanks @dee-see!) +- [PowerShellEditorServices #767](https://github.com/PowerShell/PowerShellEditorServices/pull/767) - + Change unhandled messages to warnings instead of errors +- [PowerShellEditorServices #765](https://github.com/PowerShell/PowerShellEditorServices/pull/765) - + Fix PowerShell wildcard escaping in debug paths +- [PowerShellEditorServices #778](https://github.com/PowerShell/PowerShellEditorServices/pull/778) - + Fix multiple occurrences of the same typo (Thanks @dee-see!) +- [PowerShellEditorServices #782](https://github.com/PowerShell/PowerShellEditorServices/pull/782) - + Fix #779: NRE on Dispose in ExecutionTimer (Thanks @dee-see!) +- [PowerShellEditorServices #772](https://github.com/PowerShell/PowerShellEditorServices/pull/772) - + Log build info +- [PowerShellEditorServices #774](https://github.com/PowerShell/PowerShellEditorServices/pull/774) - + New-EditorFile works on non-powershell untitled files +- [PowerShellEditorServices #787](https://github.com/PowerShell/PowerShellEditorServices/pull/787) - + Fix descion/decision typo in visitors (Thanks @dee-see!) +- [PowerShellEditorServices #784](https://github.com/PowerShell/PowerShellEditorServices/pull/784) - + Replace bad StringReader usage with String.Split() +- [PowerShellEditorServices #768](https://github.com/PowerShell/PowerShellEditorServices/pull/768) - + Make pipeline runtime exceptions warnings in log +- [PowerShellEditorServices #790](https://github.com/PowerShell/PowerShellEditorServices/pull/790) - + Add managed thread id to log output to add debugging threading issues (Thanks @rkeithhill!) +- [PowerShellEditorServices #794](https://github.com/PowerShell/PowerShellEditorServices/pull/794) - + Fix Pester CodeLens run/debug by not quoting params/already quoted args (Thanks @rkeithhill!) +- [PowerShellEditorServices #785](https://github.com/PowerShell/PowerShellEditorServices/pull/785) - + Adds ability to use separate pipes for reading and writing (Thanks @ant-druha!) +- [PowerShellEditorServices #796](https://github.com/PowerShell/PowerShellEditorServices/pull/796) - + Code cleanup of the start script and ESHost.cs file (Thanks @rkeithhill!) +- [PowerShellEditorServices #795](https://github.com/PowerShell/PowerShellEditorServices/pull/795) - + Fix file recursion overflow problems +- [PowerShellEditorServices #697](https://github.com/PowerShell/PowerShellEditorServices/pull/697) - + Add functionality to allow a Show-Command like panel in VS Code (Thanks @corbob!) +- [PowerShellEditorServices #777](https://github.com/PowerShell/PowerShellEditorServices/pull/777) - + Add syntax folding (Thanks @glennsarti!) +- [PowerShellEditorServices #801](https://github.com/PowerShell/PowerShellEditorServices/pull/801) - + Fix local remoting +- [PowerShellEditorServices #797](https://github.com/PowerShell/PowerShellEditorServices/pull/797) - + Start of a PSES log file analyzer (Thanks @rkeithhill!) +- [PowerShellEditorServices #789](https://github.com/PowerShell/PowerShellEditorServices/pull/789) - + Add support for a "Show Documentation" quick fix menu entry (Thanks @rkeithhill!) +- [PowerShellEditorServices #760](https://github.com/PowerShell/PowerShellEditorServices/pull/760) - + Fix exception when remoting from Windows to non-Windows (Thanks @SeeminglyScience!) + +## v1.9.0 +### Thursday, September 27, 2018 +#### [vscode-powershell](https://github.com/powershell/vscode-powershell) + +- [vscode-PowerShell #1548](https://github.com/PowerShell/vscode-PowerShell/pull/1548) - + Explicitly return `undefined` from resolveDbgConfig when session not started (Thanks @rkeithhill!) +- [vscode-PowerShell #1516](https://github.com/PowerShell/vscode-PowerShell/pull/1516) - + Change "Get Online Help" menu item label to "Get Help" (Thanks @corbob!) +- [vscode-PowerShell #1525](https://github.com/PowerShell/vscode-PowerShell/pull/1525) - + Remove duplicate/overlapping folding regions (Thanks @glennsarti!) + +#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) + +- [PowerShellEditorServices #750](https://github.com/PowerShell/PowerShellEditorServices/pull/750) - + Fix issue where # in path causes the path to resolve incorrectly +- [PowerShellEditorServices #721](https://github.com/PowerShell/PowerShellEditorServices/pull/721) - + Change Get-Help behavior to return local help when online help can't be displayed (Thanks @corbob!) +- [PowerShellEditorServices #748](https://github.com/PowerShell/PowerShellEditorServices/pull/748) - + Fix index out-of-range exception when deleting script files +- [PowerShellEditorServices #749](https://github.com/PowerShell/PowerShellEditorServices/pull/749) - + Fix crash for finding symbols on bad paths +- [PowerShellEditorServices #740](https://github.com/PowerShell/PowerShellEditorServices/pull/740) - + Fix inner help completion +- [PowerShellEditorServices #736](https://github.com/PowerShell/PowerShellEditorServices/pull/736) - + Cache the reflection call done for completions +- [PowerShellEditorServices #737](https://github.com/PowerShell/PowerShellEditorServices/pull/737) - + Remove LINQ usage in language service methods +- [PowerShellEditorServices #743](https://github.com/PowerShell/PowerShellEditorServices/pull/743) - + Remove unnecessary LINQ calls from LanguageServer + +## v1.8.4 +### Friday, August 31, 2018 +#### [vscode-powershell](https://github.com/powershell/vscode-powershell) + +- [vscode-PowerShell #1489](https://github.com/PowerShell/vscode-PowerShell/pull/1489) - + Use asynchronous logic for help completions +- [vscode-PowerShell #1477](https://github.com/PowerShell/vscode-PowerShell/pull/1477) - + Add BitsTransfer & user switch to install latest user profile insiders edition with Install-VSCode.ps1 script (Thanks @tabs-not-spaces!) +- [vscode-PowerShell #1485](https://github.com/PowerShell/vscode-PowerShell/pull/1485) - + Increase connection timeout + +#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) + +- [PowerShellEditorServices #728](https://github.com/PowerShell/PowerShellEditorServices/pull/728) - + Fix formatter crash when script contains parse errors +- [PowerShellEditorServices #730](https://github.com/PowerShell/PowerShellEditorServices/pull/730) - + Fix crash where lines appended to end of script file causes out of bounds exception +- [PowerShellEditorServices #732](https://github.com/PowerShell/PowerShellEditorServices/pull/732) - + Fix CodeLens crash when a file cannot be opened, stop unnecessary file reads in CodeLens +- [PowerShellEditorServices #729](https://github.com/PowerShell/PowerShellEditorServices/pull/729) - + Fix a null dereference when an invalid cast exception has no inner exception +- [PowerShellEditorServices #719](https://github.com/PowerShell/PowerShellEditorServices/pull/719) - + Reduce allocations in the CodeLens providers +- [PowerShellEditorServices #725](https://github.com/PowerShell/PowerShellEditorServices/pull/725) - + Fix null dereference when debugging untitlted filesj +- [PowerShellEditorServices #726](https://github.com/PowerShell/PowerShellEditorServices/pull/726) - + Fix comment-based help snippet + + +## v1.8.3 +### Wednesday, August 15, 2018 + +#### [vscode-powershell](https://github.com/powershell/vscode-powershell) + +- [PowerShell/vscode-powershell #1480](https://github.com/PowerShell/vscode-powershell/pull/1480) - + Use PowerShell signing script in VSTS builds +- [PowerShell/vscode-powershell #1460](https://github.com/PowerShell/vscode-powershell/pull/1460) - + Use newer version for preleases +- [PowerShell/vscode-powershell #1475](https://github.com/PowerShell/vscode-powershell/pull/1475) - + Change resourceLangId to editorLangId so right-click works properly with unsaved files (Thanks @corbob!) +- [PowerShell/vscode-powershell #1467](https://github.com/PowerShell/vscode-powershell/pull/1467) - + Remove region folding from non-region areas (Thanks @glennsarti!) + + #### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) + +- [PowerShell/PowerShellEditorServices #722](https://github.com/PowerShell/PowerShellEditorServices/pull/722) - + Add VSTS signing step +- [PowerShell/PowerShellEditorServices #717](https://github.com/PowerShell/PowerShellEditorServices/pull/717) - + Increment version for prerelease +- [PowerShell/PowerShellEditorServices #715](https://github.com/PowerShell/PowerShellEditorServices/pull/715) - + Reduce allocations when parsing files (Thanks @mattpwhite!) + +## v1.8.2 +### Thursday, July 26, 2018 + +#### [vscode-powershell](https://github.com/powershell/vscode-powershell) + +- [PowerShell/vscode-powershell #1438](https://github.com/PowerShell/vscode-powershell/pull/1438) - + Fix detecting contiguous comment blocks and regions (Thanks @glennsarti!) +- [PowerShell/vscode-powershell #1436](https://github.com/PowerShell/vscode-powershell/pull/1436) - + First approach to fix issue with dbg/run start before PSES running (Thanks @rkeithhill!) + +#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices) + +- [PowerShell/PowerShellEditorServices #712](https://github.com/PowerShell/PowerShellEditorServices/pull/712) - + workaround to support inmemory:// +- [PowerShell/PowerShellEditorServices #706](https://github.com/PowerShell/PowerShellEditorServices/pull/706) - + Go To Definition works with different Ast types +- [PowerShell/PowerShellEditorServices #707](https://github.com/PowerShell/PowerShellEditorServices/pull/707) - + fix stdio passing +- [PowerShell/PowerShellEditorServices #709](https://github.com/PowerShell/PowerShellEditorServices/pull/709) - + Stop Diagnostic logging from logging to stdio when the communication protocol is set to stdio +- [PowerShell/PowerShellEditorServices #710](https://github.com/PowerShell/PowerShellEditorServices/pull/710) - + stdio should only launch language service not debug +- [PowerShell/PowerShellEditorServices #705](https://github.com/PowerShell/PowerShellEditorServices/pull/705) - + Fix load order of PSSA modules +- [PowerShell/PowerShellEditorServices #704](https://github.com/PowerShell/PowerShellEditorServices/pull/704) - + Do not enable PSAvoidTrailingWhitespace rule by default as it currenly flags whitespace-only lines as well (Thanks @bergmeister!) + +## v1.8.1 +### Wednesday, July 11, 2018 + +- [PowerShell/vscode-powershell #1418](https://github.com/PowerShell/vscode-powershell/pull/1418) - + Fix code folding in documents using CRLF newlines. (Thanks @glennsarti!) + +## v1.8.0 +### Tuesday, July 10, 2018 + +- [PowerShell/vscode-powershell #1238](https://github.com/PowerShell/vscode-powershell/pull/1238) - + Added functionality to install the VSCode context menus. (Thanks @detlefs!) +- [PowerShell/vscode-powershell #1354](https://github.com/PowerShell/vscode-powershell/pull/1354) - + Edit snippet to fix issue #1353 (Thanks @kilasuit!) +- [PowerShell/vscode-powershell #1362](https://github.com/PowerShell/vscode-powershell/pull/1362) - + Updated Pester Problem Matcher (Thanks @awickham10!) +- [PowerShell/vscode-powershell #1359](https://github.com/PowerShell/vscode-powershell/pull/1359) - + (maint) Add visual ruler for line length (Thanks @glennsarti!) +- [PowerShell/vscode-powershell #1344](https://github.com/PowerShell/vscode-powershell/pull/1344) - + Update to TypeScript 2.9.x (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1323](https://github.com/PowerShell/vscode-powershell/pull/1323) - + SpecProcId - interactive var replacement supports only string type (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1327](https://github.com/PowerShell/vscode-powershell/pull/1327) - + Switch to named pipes +- [PowerShell/vscode-powershell #1321](https://github.com/PowerShell/vscode-powershell/pull/1321) - + GitHub issue template tweaks and add PSSA template (Thanks @bergmeister!) +- [PowerShell/vscode-powershell #1320](https://github.com/PowerShell/vscode-powershell/pull/1320) - + Take advantage of multiple issue templates (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1317](https://github.com/PowerShell/vscode-powershell/pull/1317) - + Change SpecifyScriptArgs command to only return string - not string[] (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1318](https://github.com/PowerShell/vscode-powershell/pull/1318) - + Update package veresion in lock file, format package.json file. (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1312](https://github.com/PowerShell/vscode-powershell/pull/1312) - + Updates to Examples PSSA settings file to include more rule config (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1305](https://github.com/PowerShell/vscode-powershell/pull/1305) - + Make SaveAs work for untitled files +- [PowerShell/vscode-powershell #1307](https://github.com/PowerShell/vscode-powershell/pull/1307) - + Added Columns, Improved readability for ToC. (Thanks @st0le!) +- [PowerShell/vscode-powershell #1368](https://github.com/PowerShell/vscode-powershell/pull/1368) - + Add new snippet for #region (#1368) (Thanks @lipkau!) +- [PowerShell/vscode-powershell #1416](https://github.com/PowerShell/vscode-powershell/pull/1416) - + (GH-1413) Resolve promise correctly in Folding feature (Thanks @glennsarti!) +- [PowerShell/vscode-powershell #1412](https://github.com/PowerShell/vscode-powershell/pull/1412) - + Set the extension's log level based on settings value (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1411](https://github.com/PowerShell/vscode-powershell/pull/1411) - + Escape paths w/single quotes before passing to powershell in single-quoted strings (#1411) (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1409](https://github.com/PowerShell/vscode-powershell/pull/1409) - + Rename file to match type name (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1408](https://github.com/PowerShell/vscode-powershell/pull/1408) - + Restore ability to start debug session when script run in PSIC hits breakpoint (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1407](https://github.com/PowerShell/vscode-powershell/pull/1407) - + Scroll the terminal to bottom for F8 executionPartial fix #1257 (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1414](https://github.com/PowerShell/vscode-powershell/pull/1414) - + Update grammar parsing for vscode-textmate v4 module (Thanks @glennsarti!) +- [PowerShell/vscode-powershell #1397](https://github.com/PowerShell/vscode-powershell/pull/1397) - + Allow debugging in interactive session with no dir change (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1402](https://github.com/PowerShell/vscode-powershell/pull/1402) - + Move lint directive after the file-header to fix lint error (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1366](https://github.com/PowerShell/vscode-powershell/pull/1366) - + Add support for side-by-side PS Core preview on Linux/macOS (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1391](https://github.com/PowerShell/vscode-powershell/pull/1391) - + Add PowerShell Online Help lookup to context menu (Thanks @corbob!) +- [PowerShell/vscode-powershell #1396](https://github.com/PowerShell/vscode-powershell/pull/1396) - + Add tslint rule file-header to enforce copyright in TS files (Thanks @rkeithhill!) +- [PowerShell/vscode-powershell #1355](https://github.com/PowerShell/vscode-powershell/pull/1355) - + Add syntax aware folding provider (Thanks @glennsarti!) +- [PowerShell/vscode-powershell #1395](https://github.com/PowerShell/vscode-powershell/pull/1395) - + Update community_snippets.md (Thanks @fullenw1!) +- [PowerShell/vscode-powershell #1382](https://github.com/PowerShell/vscode-powershell/pull/1382) - + Fix markdown syntax (Thanks @lipkau!) +- [PowerShell/vscode-powershell #1369](https://github.com/PowerShell/vscode-powershell/pull/1369) - + Update README.md with kbds and what to do if you find a vulnerability +- [PowerShell/vscode-powershell #1297](https://github.com/PowerShell/vscode-powershell/pull/1297) - + Added some snippets (#1297) (Thanks @SQLDBAWithABeard!) + +## 1.7.0 +### Wednesday, April 25, 2018 + +- [PowerShell/vscode-powershell #1285](https://github.com/PowerShell/vscode-powershell/pull/1285) - + Add a community snippet for date-annotated `Write-Verbose` messages. + +- [PowerShell/vscode-powershell #1228](https://github.com/PowerShell/vscode-powershell/issues/1228) - + Make comment-based help trigger always be `##` with a new setting `powershell.helpCompletion` to + allow you to select between help comment styles: `BlockComment` (default) or `LineComment`. + You can also specify Disabled to disable this functionality. + +- [PowerShell/vscode-powershell #603](https://github.com/PowerShell/vscode-powershell/issues/603) - + Fix PowerShell crashing on machines with IPv6 disabled. + +- [PowerShell/vscode-powershell #1243](https://github.com/PowerShell/vscode-powershell/issues/1243) - + Support custom PowerShell executable paths in user configuration which can be selected (via name) + in either user or workspace configuration. + +- [PowerShell/vscode-powershell #1264](https://github.com/PowerShell/vscode-powershell/pull/1264) - + Add support for [Visual Studio Live Share](https://code.visualstudio.com/visual-studio-live-share). + +- [PowerShell/vscode-powershell #1261](https://github.com/PowerShell/vscode-powershell/pull/1261) - + Add support for `$psEditor.GetEditorContext.CurrentFile.SaveAs("NewFileName.ps1")`. + +- [PowerShell/vscode-powershell #1252](https://github.com/PowerShell/vscode-powershell/pull/1252) - + Change the way the extension builds and runs, so that PowerShellEditorServices is self-contained. + +- [PowerShell/vscode-powershell #1248](https://github.com/PowerShell/vscode-powershell/pull/1248) - + Replace `$global:IsOSX` with `$global:IsMacOS`. + +- [PowerShell/vscode-powershell #1246](https://github.com/PowerShell/vscode-powershell/pull/1246) - + Create [community_snippets.md](./docs/community_snippets.md) for user created snippets. + +- [PowerShell/vscode-powershell #1155](https://github.com/PowerShell/vscode-powershell/issues/1155) - + Fix PSES crashes caused by running "Set PSScriptAnalyzer Rules" on an untitled file. + +- [PowerShell/vscode-powershell #1236](https://github.com/PowerShell/vscode-powershell/pull/1236) - + Stop an error occurring when VSCode trims trailing whitespace and sends document update messages. + +- [PowerShell/vscode-powershell #996](https://github.com/PowerShell/vscode-powershell/issues/996) - + Fix `Install-PSCode.ps1` crashing due to `$IsLinux` variable in older PowerShell versions. + +- [PowerShell/vscode-powershell #1234](https://github.com/PowerShell/vscode-powershell/pull/1234) - + Add snippets for Hashtable and PSCustomObject. + +- [PowerShell/vscode-powershell #1233](https://github.com/PowerShell/vscode-powershell/pull/1233) - + Add a keybinding for Show Addtional Commands to Shift-Alt-S. + +- [PowerShell/vscode-powershell #1227](https://github.com/PowerShell/vscode-powershell/pull/1227) - + Add an indicator for when PowerShell is running in the status bar. + +- [PowerShell/vscode-powershell #1225](https://github.com/PowerShell/vscode-powershell/pull/1225) - + Fix launch config not using temporary integrated console setting. + +- [PowerShell/vscode-powershell #1208](https://github.com/PowerShell/vscode-powershell/issues/1208) - + Stop configured temporary windows closing after running Pester tests. + +## 1.6.0 +### Thursday, February 22, 2018 + +#### Fixes and Improvements + +- [PowerShell/vscode-powershell #907](https://github.com/PowerShell/vscode-powershell/issues/907) - + Persist temp console debug session. + +- [PowerShell/vscode-powershell #1198](https://github.com/PowerShell/vscode-powershell/pull/1198) - + Enhance Start-EditorServices.ps1 for better logging and fix bugs. + +- [PowerShell/PowerShellEditorServices #413](https://github.com/PowerShell/PowerShellEditorServices/issues/413) - + Allow opening files as not previews to allow Open-EditorFile to open multiple files passed in. + +- [PowerShell/vscode-powershell #1177](https://github.com/PowerShell/vscode-powershell/issues/1177) - + Add function-advanced snippet. Thanks to [Benny1007](https://github.com/Benny1007)! + +- [PowerShell/vscode-powershell #1179](https://github.com/PowerShell/vscode-powershell/issues/1179) - + Switch onDebug to onDebugResolve:type for better debugging perf. + +- [PowerShell/vscode-powershell #1086](https://github.com/PowerShell/vscode-powershell/issues/1086) - + Add tslint to vscode-powershell and address all issues. + +- [PowerShell/vscode-powershell #1153](https://github.com/PowerShell/vscode-powershell/issues/1153) - + Add docs for ps remoting in vscode. + +- [PowerShell/vscode-powershell #1161](https://github.com/PowerShell/vscode-powershell/pull/1161) - + Check for the expected version of the PowerShell Editor Services module fails because of the wrong function parameters. Thanks to [ant-druha](https://github.com/ant-druha)! + +- [PowerShell/vscode-powershell #1141](https://github.com/PowerShell/vscode-powershell/pull/1141) - + Updated install script minified URL. Thanks to [tabs-not-spaces](https://github.com/tabs-not-spaces)! + +- [PowerShell/PowerShellEditorServices #258](https://github.com/PowerShell/PowerShellEditorServices/issues/258) - + add .Save() to FileContext API. + +- [PowerShell/vscode-powershell #1137](https://github.com/PowerShell/vscode-powershell/pull/1137) - + Added 64bit support & vscode-insiders install support. Thanks to [tabs-not-spaces](https://github.com/tabs-not-spaces)! + +- [PowerShell/vscode-powershell #1115](https://github.com/PowerShell/vscode-powershell/issues/1115) - + Fixed "Open in ISE" keyboard shortcut from overwriting basic editing keyboard shortcut. + +- [PowerShell/vscode-powershell #1111](https://github.com/PowerShell/vscode-powershell/issues/1111) - + Update examples tasks.json for 2.0.0 schema. + +## 1.5.1 +### Tuesday, November 14, 2017 + +- [PowerShell/vscode-powershell #1100](https://github.com/PowerShell/vscode-powershell/issues/1100) - + Fixed CodeLens on Pester test invocation fails with "Error: command 'vscode.startDebug' not found". + +- [PowerShell/vscode-powershell #1091](https://github.com/PowerShell/vscode-powershell/issues/1091) - + Fixed crash when editing remote file using psedit. + +- [PowerShell/vscode-powershell #1084](https://github.com/PowerShell/vscode-powershell/issues/1084) - + Fixed authenticode signature 'HashMismatch' on Start-EditorServices.ps1. + +- [PowerShell/vscode-powershell #1078](https://github.com/PowerShell/vscode-powershell/issues/1078) - + Fixed debug adapter process terminating when setting breakpoint in an Untitled file or in a Git diff window. + +- Update download.sh to remove macOS OpenSSL check since PowerShell Core Beta and higher no longer depend on OpenSSL. Thanks to [elovelan](https://github.com/elovelan)! + +- Get-Help -ShowWindow will no longer error in the PowerShell Integrated Console. The help window will appear but at the moment, it will appear behind VSCode. + +- Fix language server crash when processing a deep directory structure that exceeds max path. + +## 1.5.0 +### Friday, October 27, 2017 + +#### Fixes and Improvements + +- [PowerShell/vscode-powershell #820](https://github.com/PowerShell/vscode-powershell/issues/820) - + Added new "Upload Bug Report to GitHub" command to make it easy to post an issue to the vscode-powershell GitHub repo. Thanks to [Mark Schill](https://github.com/PowerSchill)! + +- [PowerShell/vscode-powershell #910](https://github.com/PowerShell/vscode-powershell/issues/910) - + Set-VSCodeHtmlContentView cmdlet now exposes `JavaScriptPaths` and `StyleSheetPaths` parameters to allow using JavaScript code and CSS stylesheets in VS Code HTML preview views. + +- [PowerShell/vscode-powershell #909](https://github.com/PowerShell/vscode-powershell/issues/909) - + Write-VSCodeHtmlContentView's AppendBodyContent now accepts input from the pipeline + +- [PowerShell/vscode-powershell #1071](https://github.com/PowerShell/vscode-powershell/pull/1071) - + Updated session menu to find PowerShell Core installs with the new pwsh.exe path + +- [PowerShell/vscode-powershell #842](https://github.com/PowerShell/vscode-powershell/issues/842) - + psedit can now open empty files in remote sessions + +- [PowerShell/vscode-powershell #1040](https://github.com/PowerShell/vscode-powershell/issues/1040) - + Non-PowerShell files opened in remote sessions using psedit can now be saved back to the remote server + +- [PowerShell/vscode-powershell #660](https://github.com/PowerShell/vscode-powershell/issues/660) - + Set/Enable/Disable/Remove-PSBreakpoint commands now cause the VS Code breakpoint UI to be updated while the debugger is active + +- [PowerShell/vscode-powershell #625](https://github.com/PowerShell/vscode-powershell/issues/625) - + Breakpoints are now cleared from the session when the debugger starts so that stale breakpoints from previous sessions are not hit + +- [PowerShell/vscode-powershell #1004](https://github.com/PowerShell/vscode-powershell/issues/1004) - + Handle exception case when finding references of a symbol + +- [PowerShell/vscode-powershell #942](https://github.com/PowerShell/vscode-powershell/issues/942) - + Temporary debugging session now does not stop responding when running "PowerShell Interactive Session" debugging configuration + +- [PowerShell/vscode-powershell #917](https://github.com/PowerShell/vscode-powershell/issues/917) - + Added PowerShell.InvokeRegisteredEditorCommand command to be used from HTML preview views for invoking editor commands registered in PowerShell. Thanks to [Kamil Kosek](https://github.com/kamilkosek)! + +- [PowerShell/vscode-powershell #872](https://github.com/PowerShell/vscode-powershell/issues/872) - + Watch variables with children are now expandable + +- [PowerShell/vscode-powershell #1060](https://github.com/PowerShell/vscode-powershell/issues/1060) - + $psEditor.Workspace.NewFile() now works again in VSC 1.18.0 Insiders builds + +- [PowerShell/vscode-powershell #1046](https://github.com/PowerShell/vscode-powershell/issues/1046) - + Debugging now works again in VSC 1.18.0 Insiders builds + +- [PowerShell/PowerShellEditorServices #342](https://github.com/PowerShell/PowerShellEditorServices/issues/342) - + Unexpected file URI schemes are now handled more reliably + +- [PowerShell/PowerShellEditorServices #396](https://github.com/PowerShell/PowerShellEditorServices/issues/396) - + Resolved errors being written to Integrated Console when running native applications while transcription is turned on + +- [PowerShell/PowerShellEditorServices #529](https://github.com/PowerShell/PowerShellEditorServices/issues/529) - + Fixed an issue with loading the PowerShellEditorServices module in PowerShell Core 6.0.0-beta3 + +- [PowerShell/PowerShellEditorServices #533](https://github.com/PowerShell/PowerShellEditorServices/pull/533) - + Added new $psEditor.GetCommand() method for getting all registered editor commands. Thanks to [Kamil Kosek](https://github.com/kamilkosek)! + +- [PowerShell/PowerShellEditorServices #535](https://github.com/PowerShell/PowerShellEditorServices/pull/535) - + Type information is now exposed on hover for variables in the Variables view + +## 1.4.3 +### Wednesday, September 13, 2017 + +- [#1016](https://github.com/PowerShell/vscode-powershell/issues/1016) - + Fixed a conflict with the "Azure Resource Manager for Visual Studio + Code" extension which prevented the PowerShell extension from loading + successfully. + +## 1.4.2 +### Tuesday, September 5, 2017 + +- [#993](https://github.com/PowerShell/vscode-powershell/issues/993) - + `powershell.powerShellExePath` using Sysnative path should be automatically + corrected when using 64-bit Visual Studio Code +- [#1008](https://github.com/PowerShell/vscode-powershell/issues/1008) - + Windows PowerShell versions (x64 and x86) are not enumerated correctly + when using 64-bit Visual Studio Code +- [#1009](https://github.com/PowerShell/vscode-powershell/issues/1009) - + PowerShell version indicator in status bar is missing tooltip +- [#1020](https://github.com/PowerShell/vscode-powershell/issues/1020) - + "Show Session Menu", "Show Integrated Console", and "Restart Current Session" + commands should cause PowerShell extension to be activated + +## 1.4.1 +### Thursday, June 22, 2017 + +- [PowerShell/PowerShellEditorServices#529](https://github.com/PowerShell/PowerShellEditorServices/issues/529) - + Fixed an issue with loading the extension with in PowerShell Core 6.0.0-beta3 + +## 1.4.0 +### Wednesday, June 21, 2017 + +#### New HTML content view commands enabling custom UI tabs + +You can now show editor tabs with custom HTML-based UI by using the +new HTML content view commands! This is the first step toward UI +extensions for VS Code written in PowerShell. + +Here's an example: + +```powershell +$view = New-VSCodeHtmlContentView -Title "My Custom View" -ShowInColumn One +Set-VSCodeHtmlContentView -View $view -Content "

Hello world!

" +Write-VSCodeHtmlContentView $view -Content "I'm adding new content!
" +``` + +And here's the result: + +![HTML view demo](https://user-images.githubusercontent.com/79405/27394133-f96c38cc-565f-11e7-8102-a3727014ea5a.GIF) + +Check out the cmdlet help for the following commands to learn more: + +- `New-VSCodeHtmlContentView` +- `Show-VSCodeHtmlContentView` +- `Close-VSCodeHtmlContentView` +- `Set-VSCodeHtmlContentView` +- `Write-VSCodeHtmlContentView` + +Since this is a first release, we've restricted the use of JavaScript +inside of the HTML. We will add this capability in a future release! + +#### Code formatting setting presets for common styles + +We've now added code formatting presets for the most common code style +conventions used in the PowerShell community: + +- **[OTBS](https://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS_.28OTBS.29)** - + Known as the "One True Brace Style". Causes `else`, `catch`, and other + keywords to be "cuddled", keeping them on the same line as the previous + closing brace: + + ```powershell + if ($var -eq $true) { + # Do the thing + } else { + # Do something else + } + ``` + +- **[Stroustrup](https://en.wikipedia.org/wiki/Indent_style#Variant:_Stroustrup)** - + Causes beginning curly braces to be placed on the same line as the statement: + + ```powershell + if ($var -eq $true) { + # Do the thing + } + else { + # Do something else + } + ``` + +- **[Allman](https://en.wikipedia.org/wiki/Indent_style#Allman_style)** - All curly braces are preceded by a newline: + + ```powershell + if ($var -eq $true) + { + # Do the thing + } + else + { + # Do something else + } + ``` + +- **Custom** - Allows full customization of the code formatting settings. + +In addition, code formatting now respects your `editor.insertSpaces` and +`editor.tabSize` settings! + +#### Debugging in a temporary PowerShell Integrated Console + +We've added the ability to debug your PowerShell code in a temporary +PowerShell Integrated Console so that you have a fresh runspace and +PowerShell process each time you hit F5! + +This setting is necessary if you are developing with PowerShell 5 +classes or modules using .NET assemblies because .NET types cannot +be reloaded inside of the same PowerShell process. This new setting +saves you from reloading your PowerShell session each time you debug +your code! + +You can configure this behavior in two ways: + +- Use the `launch.json` configuration parameter `createTemporaryIntegratedConsole`: + + ```json + { + "type": "PowerShell", + "request": "launch", + "name": "PowerShell Launch Current File in Temporary Console", + "script": "${file}", + "args": [], + "cwd": "${file}", + "createTemporaryIntegratedConsole": true + }, + ``` + +- Configure the setting `powershell.debugging.createTemporaryIntegratedConsole`: + + ```json + "powershell.debugging.createTemporaryIntegratedConsole": true, + ``` + +The default value for these settings is `false`, meaning that the temporary +console behavior is **opt-in**. + +Configuring the user or workspace setting will cause all debugging sessions +to be run in a temporary Integrated Console so it's useful if you would prefer +this to be the default behavior. The `launch.json` setting overrides the user +setting so you can always customize the behavior for a specific launch +configuration. + +#### NewFile() API and Out-CurrentFile command + +You can now create a new untitled file from within the Integrated Console +by using the `$psEditor.Workspace.NewFile()` command! Also, you can send +the formatted output of any PowerShell command to the current file by using +the `Out-CurrentFile` command: + +```powershell +Get-Process | Out-CurrentFile +``` + +Special thanks to [Doug Finke](https://github.com/dfinke) for the contribution! + +#### Other fixes and improvements + +- [#881](https://github.com/PowerShell/vscode-powershell/pull/881) - + When you select a different PowerShell version in the session menu, your choice + is persisted to the `powershell.powerShellExePath` setting. + +- [#891](https://github.com/PowerShell/vscode-powershell/issues/891) - + Pester CodeLenses now run tests without string interpolation of test names + +## 1.3.2 +### Monday, June 12, 2017 + +- [PowerShell/vscode-powershell#864](https://github.com/PowerShell/vscode-powershell/issues/864) - Improved the visibility of hyphen characters on the currently edited line in the PowerShell ISE theme (thanks [Stefan Stranger](https://github.com/stefanstranger)!) + +- [PowerShell/vscode-powershell#857](https://github.com/PowerShell/vscode-powershell/issues/855) - Typing a new function into a file no longer causes the language server to crash + +- [PowerShell/vscode-powershell#855](https://github.com/PowerShell/vscode-powershell/issues/855) - "Format Document" no longer hangs indefinitely + +- [PowerShell/vscode-powershell#859](https://github.com/PowerShell/vscode-powershell/issues/859) - Language server no longer hangs when opening a Pester test file containing dot-sourced script references + +- [PowerShell/vscode-powershell#856](https://github.com/PowerShell/vscode-powershell/issues/856) - CodeLenses for function definitions no longer count the definition itself as a reference and shows "0 references" when there are no uses of that function + +- [PowerShell/vscode-powershell#838](https://github.com/PowerShell/vscode-powershell/issues/838) - Right-clicking a debugger variable and selecting "Add to Watch" now has the desired result + +- [PowerShell/vscode-powershell#837](https://github.com/PowerShell/vscode-powershell/issues/837) - Debugger call stack now navigates correctly to the user's selected stack frame + +- [PowerShell/vscode-powershell#862](https://github.com/PowerShell/vscode-powershell/issues/862) - Terminating errors in the language server now close the Integrated Console immediately and prompt the user to restart the session + +- [PowerShell/PowerShellEditorServices#505](https://github.com/PowerShell/PowerShellEditorServices/issues/505) - Added improved cmdlet help in the PowerShellEditorServices.Commands module + +- [PowerShell/PowerShellEditorServices#509](https://github.com/PowerShell/PowerShellEditorServices/issues/509) - Importing the PowerShellEditorServices.Commands module no longer causes errors to be written about missing help languages + +## 1.3.1 +### Friday, June 9, 2017 + +#### Fixes and improvements + +- [#850](https://github.com/PowerShell/vscode-powershell/issues/850) - + Fixed an issue where lower-cased "describe" blocks were not identified by + the CodeLens feature. + +- [#851](https://github.com/PowerShell/vscode-powershell/issues/851) - + Fixed an issue where the language server would stop responding when typing out a describe + block. + +- [#852](https://github.com/PowerShell/vscode-powershell/issues/852) - + Fixed an issue where Pester test names would not be detected correctly when + other arguments like -Tags were being used on a Describe block. + +## 1.3.0 +### Friday, June 9, 2017 + +#### CodeLens for running and debugging Pester tests + +We've added two new CodeLens actions that show up above Describe blocks in +your Pester tests, "Run tests" and "Debug tests". By clicking one of these +CodeLenses, your tests will be executed in the Integrated Console with +the debugger attached. You can now set breakpoints and quickly debug a portion +of your test script: + +![Pester CodeLens](https://user-images.githubusercontent.com/79405/26988706-3c054ed0-4d05-11e7-87f0-5bbf16ee73ef.GIF) + +#### CodeLens support for finding references of a function or cmdlet + +We've also added CodeLenses for showing the number of references for a function or +cmdlet that is defined in a script. If you click this CodeLens, the references +pane will appear so that you can navigate through all of the references: + +![References CodeLens](https://user-images.githubusercontent.com/79405/26989245-384a4866-4d07-11e7-9c1e-076dbd7d6eb4.GIF) + +We will add CodeLens support for PowerShell 5+ classes and class methods in a future +update! + +#### Document symbol support for Pester tests + +We've also added document symbol support for Pester tests so that you can easily +navigate among the Describe, Context, and It blocks in large Pester script files: + +![Pester symbols](https://user-images.githubusercontent.com/79405/26989077-91e7a306-4d06-11e7-8e26-916bb78720f8.GIF) + +#### New PowerShell ISE theme + +We now include a new color theme that tries to provide a faithful interpretation +of the PowerShell ISE's style, including a blue console background! To use this +theme open the Command Palette (Ctrl+Shift+P), run the "Preferences: Color Theme" +command, then select "PowerShell ISE". + +![ISE theme](https://user-images.githubusercontent.com/79405/26988805-9769aea6-4d05-11e7-81fc-da79bf1ec3cb.png) + +This is a first attempt at making this happen so [give us feedback](https://git.io/v9jnL) +if you think that the colors can be improved! Super huge thanks to +[Matt McNabb](https://twitter.com/mcnabbmh) for putting this together! + +#### New cmdlets inside the Integrated Console + +Thanks to new PowerShell Editor Services co-maintainer [Patrick Meinecke](https://github.com/SeeminglyScience), +we've gained a new set of useful commands for interacting with the $psEditor APIs +within the Integrated Console: + +- [Find-Ast](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Find-Ast.md) +- [Get-Token](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Get-Token.md) +- [ConvertFrom-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/ConvertFrom-ScriptExtent.md) +- [ConvertTo-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/ConvertTo-ScriptExtent.md) +- [Set-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Set-ScriptExtent.md) +- [Join-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Join-ScriptExtent.md) +- [Test-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Test-ScriptExtent.md) +- [Import-EditorCommand](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Import-EditorCommand.md) + +This should also resolve the issues some people were seeing when we tried +to load the unsigned temporary script containing `Register-EditorCommand` +on machines with an AllSigned execution policy ([#784]([https://github.com/PowerShell/vscode-powershell/issues/784])). + +#### Fixes and improvements + +- [#827](https://github.com/PowerShell/vscode-powershell/issues/827) - + Fixed an issue where an Output panel will appear with an error when you close + the PowerShell Integrated Terminal + +## 1.2.1 +### Thursday, June 1, 2017 + +#### Fixes and improvements + +- [PowerShell/PowerShellEditorServices#478](https://github.com/PowerShell/PowerShellEditorServices/issues/478) - + Dynamic comment help snippets now generate parameter fields correctly + when `<#` is typed above a `param()` block. + +- [#808](https://github.com/PowerShell/vscode-powershell/issues/808) - + An extra `PS>` is no longer being written to the Integrated Console for + some users who have custom prompt functions. + +- [#813](https://github.com/PowerShell/vscode-powershell/issues/813) - + Finding references of symbols across the workspace now properly handles + inaccessible folders and file paths + +- [#810](https://github.com/PowerShell/vscode-powershell/issues/810) - + `$psEditor.GetEditorContext()` now doesn't throw exceptions when in an + untitled file + +- [#807](https://github.com/PowerShell/vscode-powershell/issues/807) - + The users's previously selected PowerShell session type is now retained + when running the "PowerShell: Restart Current Session" command. + +- [#821](https://github.com/PowerShell/vscode-powershell/issues/821) - + Note properties on PSObjects are now visible in the debugger's Variables + view + +## 1.2.0 +### Wednesday, May 31, 2017 + +#### Dynamic comment-based help snippets now work inside functions ([#763](https://github.com/PowerShell/vscode-powershell/issues/748)) + +You asked for it, you got it! Dynamic comment-based help snippets now work +inside function definitions, both above the `param()` block and at the end +of the function body: + +![Comment help GIF](https://cloud.githubusercontent.com/assets/79405/26637844/6e76cfa6-45d5-11e7-89b8-a2d6a559536b.GIF) + +*NOTE: There is an issue where parameter sections don't get generated inside of a function +with a `[CmdletBinding()]` attribute. This is being tracked at [PowerShell/PSScriptAnalyzer#768](https://github.com/PowerShell/PSScriptAnalyzer/issues/768).* + +#### Session menu now contains entries for PowerShell Core installations on Windows ([#794](https://github.com/PowerShell/vscode-powershell/issues/794)) + +It's now much easier to switch between Windows PowerShell and PowerShell Core installs +on Windows. When you run the "PowerShell: Show Session Menu" command or click the +PowerShell version indication in the status bar you'll now see PowerShell Core entries +in the menu: + +![Session menu](https://cloud.githubusercontent.com/assets/79405/26637984/d177f5f8-45d5-11e7-9def-705b3fa68953.png) + +#### Improved PSScriptAnalyzer marker display and suppression snippets ([#781](https://github.com/PowerShell/vscode-powershell/issues/781)) and ([#783](https://github.com/PowerShell/vscode-powershell/issues/783)) + +The green squiggle markers you receive from PSScriptAnalyzer now include the +name of the corresponding rule in their description: + +![Rule name](https://cloud.githubusercontent.com/assets/79405/26638073/15aaaaae-45d6-11e7-93a0-cf6d5397553e.png) + +This is really helpful with the new rule suppression snippets contributed by +[Jos Verlinde](https://github.com/Josverl)! You can access them by typing +`suppress-` and selecting one of the suppression snippet options: + +![Suppress rule](https://cloud.githubusercontent.com/assets/79405/26638390/d8c42164-45d6-11e7-8844-a34a314654a5.GIF) + +#### New built-in Pester problem matcher ([#798](https://github.com/PowerShell/vscode-powershell/issues/798)) + +We now include a built-in [problem matcher](https://code.visualstudio.com/Docs/editor/tasks#_defining-a-problem-matcher) +for Pester test output so that you don't need to define one in your `tasks.json` +file any longer! You can reference the built-in problem matcher in your test +tasks by using the name `$pester`: + +```json + { + "taskName": "Test", + "suppressTaskName": true, + "isTestCommand": true, + "showOutput": "always", + "args": [ "Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true}" ], + "problemMatcher": "$pester" + } +``` + +*NOTE: There is an issue with problem matchers when using the new `2.0.0` +version of VS Code's task runner. Pester errors may show up multiple +times in the Problems panel. This issue is being tracked at +[#797](https://github.com/PowerShell/vscode-powershell/issues/797).* + +#### Other fixes and improvements + +- [#710](https://github.com/PowerShell/vscode-powershell/issues/710) - + Variable definitions can now be found across the workspace + +- [#771](https://github.com/PowerShell/vscode-powershell/issues/771) - + Improved dynamic comment help snippet performance in scripts with many functions + +- [#786](https://github.com/PowerShell/vscode-powershell/issues/786) - + Running the "Show Integrated Console" command will now start the extension + if it isn't already started + +- [#774](https://github.com/PowerShell/vscode-powershell/issues/774) - + Pressing Enter now causes custom prompt functions to be fully evaluated + +- [#770](https://github.com/PowerShell/vscode-powershell/issues/770) - + Fixed issue where custom prompt function might be written twice when + starting the integrated console + +- [#767](https://github.com/PowerShell/vscode-powershell/issues/767) - + Fixed placeholder navigation for many built-in snippets + +- [#782](https://github.com/PowerShell/vscode-powershell/issues/782) - + Fixed extension host crash when restarting the PowerShell session + +- [#737](https://github.com/PowerShell/vscode-powershell/issues/737) - + Fixed hangs and high CPU when restarting or switching between PowerShell sessions + +- [#777](https://github.com/PowerShell/vscode-powershell/issues/777) - + Changed "Starting PowerShell" message to clearly indicate that we're in the + PowerShell Integrated Console + +## 1.1.0 +### Thursday, May 18, 2017 + +#### New dynamic snippet for adding comment-based help ([#748](https://github.com/PowerShell/vscode-powershell/issues/748)) + +We've added a really cool new feature that enables you to create comment-based +help blocks with ease! When you've defined a function in a PowerShell script +file, you can now start typing a comment block above the function definition +and it will be completed for you: + +![Help Comment GIF](https://cloud.githubusercontent.com/assets/79405/26216440/f31a47c8-3bb8-11e7-9fbc-7e3fb596c0ea.GIF) + +This comment block works like a snippet, allowing you to tab through the fields +to quickly add documentation for the parts you care about. + +This is a first pass for this feature and we plan to do more with it in the future. +Please feel free to [file feature requests](https://git.io/v9jnL) for anything else +you'd like to see! + +#### Breakpoints hit in the Integrated Console now activate the debugger UI ([#619](https://github.com/PowerShell/vscode-powershell/issues/619)) + +In previous releases it was necessary to start the "PowerShell Interactive Session" +debugging configuration before you could run a command or script from the Integrated +Console and hit breakpoints in the editor UI. We've just removed this limitation! + +Now when you set a breakpoint using `Set-PSBreakpoint` and run a script or command in the +Integrated Console, the debugger UI now gets activated: + +![Debugger Activate GIF](https://cloud.githubusercontent.com/assets/79405/26217019/d17708f2-3bba-11e7-982f-4d481c2cf533.GIF) + +Note that breakpoints set in the Integrated Console [still do not show up](https://github.com/PowerShell/vscode-powershell/issues/660) +in the editor UI; this requires [changes to VS Code](https://github.com/Microsoft/vscode/issues/8642) +that we'll be contributing for their next feature release. + +#### Improved output when loading profile scripts ([#663](https://github.com/PowerShell/vscode-powershell/issues/663) and [#689](https://github.com/PowerShell/vscode-powershell/issues/689)) + +We now write the errors and Write-Output calls that occur while loading profile +scripts so that it's easier to diagnose issues with your profile scripts. This +fix will help us identify the things missing from the Integrated Console which +cause your profile scripts to fail (like the current lack of a [PrivateData object for setting console colors](https://github.com/PowerShell/vscode-powershell/issues/571)). + +Please feel free to [file issues](https://git.io/v9jnL) for anything that causes +your profile scripts to throw errors when they get loaded! + +#### Other fixes and improvements + +- [#751](https://github.com/PowerShell/vscode-powershell/issues/751) - + Removed keybinding for the "Find PowerShell Modules from the Gallery" command + because it conflicts with VS Code's default "Format Selection" keybinding. + +- [#739](https://github.com/PowerShell/vscode-powershell/issues/739) - + Fixed wording of PowerShell extension commands to have consistent capitalization. + Thanks to [@AndySchneiderDev](https://github.com/AndySchneiderDev) for the + contribution! + +## 1.0.0 +### Wednesday, May 10, 2017 + +We are excited to announce that we've reached version 1.0! For more information, +please see the [official announcement](https://blogs.msdn.microsoft.com/powershell/2017/05/10/announcing-powershell-for-visual-studio-code-1-0/) +on the PowerShell Team Blog. + +#### New script argument UI when debugging ([#705](https://github.com/PowerShell/vscode-powershell/issues/705)) + +You can now set PowerShell debugger configurations to prompt for arguments to be +passed to your script when it is executed. This is configured using the new +`${command:SpecifyScriptArgs}` configuration variable in `launch.json`: + +```json + { + "type": "PowerShell", + "request": "launch", + "name": "PowerShell Launch DebugTest.ps1 w/Args Prompt", + "script": "${workspaceRoot}/DebugTest.ps1", + "args": [ "${command:SpecifyScriptArgs}" ], + "cwd": "${file}" + } +``` + +When you launch this configuration you will see a UI popup asking for arguments: + + +![image](https://cloud.githubusercontent.com/assets/5177512/25560503/e60e9822-2d12-11e7-9837-29464d077082.png) + +You can type your arguments to the script as you would in PowerShell: + +``` +-Count 5 +``` + +In future executions of this configuration, you will be presented with the arguments +you typed the last time you ran it so that you can easily edit them and test variations! + +#### New hash table alignment formatting rule ([#672](https://github.com/PowerShell/vscode-powershell/issues/672)) + +We've added a new code formatting rule that automatically aligns the equal sign +in assignments of keys in hash tables or DSC configurations. It also works with +nested hash tables! Here's a simple example: + +**Before** + +```powershell +$formatTest = @{ + Apple = 4 + Tangerine = @{ + Orange = 2 + CornflowerBlue = 6 + } + Banana = 3 +} +``` + +**After** + +```powershell + +$formatTest = @{ + Apple = 4 + Tangerine = @{ + Orange = 2 + CornflowerBlue = 6 + } + Banana = 3 +} +``` + +This formatting rule is enabled by default but can be disabled with the following +setting: + +``` +"powershell.codeFormatting.alignPropertyValuePairs": false +``` + +#### Added basic module-wide function references support + +In the past, finding the references or definition of a function in `FileA.ps1` only +worked if `FileA.ps1` had an explicit dot-source invocation of `FileB.ps1`. We have +removed this limitation so that you can now find definitions and references of any +function across all the script files in your project folder! This is especially +useful if you write PowerShell modules where all of the source files are dot-sourced +inside of the .psm1 file. + +This new implementation is very basic and may give unexpected results, so please [file +an issue on GitHub](https://github.com/PowerShell/vscode-powershell/issues) if you get +a result you did not expect! + +#### Other integrated console and debugger improvements + +- Fixed [#698](https://github.com/PowerShell/vscode-powershell/issues/698) - + When debugging scripts in the integrated console, the cursor position should now + be stable after stepping through your code! Please let us know if you see any + other cases where this issue appears. + +- Fixed [#626](https://github.com/PowerShell/vscode-powershell/issues/626) - + Fixed an issue where debugging a script in one VS Code window would cause that script's + output to be written to a different VS Code window in the same process. + +- Fixed [#618](https://github.com/PowerShell/vscode-powershell/issues/618) - + Pressing enter on an empty command line in the Integrated Console no longer adds the + empty line to the command history. + +- Fixed [#617](https://github.com/PowerShell/vscode-powershell/issues/617) - + Stopping the debugger during a prompt for a mandatory script parameter no + longer crashes the language server. + +- Fixed [PowerShellEditorServices #428](https://github.com/PowerShell/PowerShellEditorServices/issues/428) - + Debugger no longer hangs when you stop debugging while an input or choice prompt is + active in the integrated console. + +## 0.12.2 +### Friday, April 7, 2017 + +- Fixed [#662](https://github.com/PowerShell/vscode-powershell/issues/662) - + Changed usage of `$env:PSMODULEPATH` to `$env:PSModulePath` to conform to + a recent change in PowerShell 6 ([PowerShell/PowerShell#3255](https://github.com/PowerShell/PowerShell/pull/3255)) + which makes the casing of `PSModulePath` consistent between Windows and + the *NIX platforms. + + **NOTE: This is a breaking change for PowerShell extension users on Linux and macOS** + + If you are using PowerShell 6.0.0-alpha.17 or lower you **will** need to upgrade + to 6.0.0-alpha.18. + +- Fixed [#645](https://github.com/PowerShell/vscode-powershell/issues/645) - + "Go to Definition" or "Find References" now work in untitled scripts without + crashing the session +- Fixed [#632](https://github.com/PowerShell/vscode-powershell/issues/632) - + Debugger no longer hangs when launched while PowerShell session is still + initializing +- Fixed [#655](https://github.com/PowerShell/vscode-powershell/issues/655) - + Fixed an issue with current working directory being set incorrectly when + debugging untitled script files +- Fixed [PowerShellEditorServices #430](https://github.com/PowerShell/PowerShellEditorServices/issues/430) - + Resolved occasional IntelliSense slowness by preventing the implicit loading + of the PowerShellGet and PackageManagement modules. This change will be reverted + once a bug in PackageManagement is fixed. +- Fixed [PowerShellEditorServices #427](https://github.com/PowerShell/PowerShellEditorServices/issues/427) - + Fixed an occasional crash when requesting editor IntelliSense while running + a script in the debugger +- Fixed [PowerShellEditorServices #416](https://github.com/PowerShell/PowerShellEditorServices/issues/416) - + Cleaned up errors that would appear in the `$Errors` variable from the use + of `Get-Command` and `Get-Help` in IntelliSense results + +## 0.12.1 +### Tuesday, April 4, 2017 + +- Fixed [#648](https://github.com/PowerShell/vscode-powershell/issues/648) - + Resolved an error when launching an untitled script file in a workspace + with no launch.json or in a window without a workspace path + +## 0.12.0 +### Tuesday, April 4, 2017 + +#### Debugging untitled files ([#555](https://github.com/PowerShell/vscode-powershell/issues/555)) + +You can now debug untitled files that are set to the PowerShell language mode. When you +create a new untitled file, use the "Change Language Mode" command (Ctrl+K M) +and choose "PowerShell" from the menu that appears. You can now press F5 to start +debugging the script file without saving it. + +In the upcoming 1.11.0 release of Visual Studio Code (or in the current VS Code Insiders +release), you can configure the new `files.defaultLanguage` setting to `powershell` in either +your User or Workspace settings to cause all untitled files to be created with the PowerShell +mode by default. This will allow you to create new PowerShell scripts and debug them +immediately without saving first! + +#### New right-click context menu for Run Selection ([#581](https://github.com/PowerShell/vscode-powershell/issues/581)) + +By user request, we've also added a new "Run Selection" item in the right-click context menu +for PowerShell script files: + +![image](https://cloud.githubusercontent.com/assets/79405/24670885/a18513fe-1924-11e7-91d3-dc14c6cbfad9.png) + +#### Debugging improvements + +- Fixed [#620](https://github.com/PowerShell/vscode-powershell/issues/620) - + PowerShell session now does not crash when a breakpoint is hit outside of + debug mode + +- Fixed [#614](https://github.com/PowerShell/vscode-powershell/issues/614) - + Auto variables are now populating correctly in the debugger. **NOTE**: There is + a known issue where all of a script's variables begin to show up in the + Auto list after running a script for the first time. This is caused by + a change in 0.11.0 where we now dot-source all debugged scripts. We will + provide an option for this behavior in the future. + +- Fixed [#641](https://github.com/PowerShell/vscode-powershell/issues/641) - + PowerShell script files with capitalized extensions (.PS1, .PSM1) can now + be launched in the debugger + +- Fixed [#616](https://github.com/PowerShell/vscode-powershell/issues/616) - + Debugger now shows column position indicators when debugging pipelines or + nested expressions: + + ![image](https://cloud.githubusercontent.com/assets/79405/24316990/2157480e-10b0-11e7-8a61-19fde63edfb7.png) + +#### Integrated console improvements + +- Fixed [PowerShell/PowerShellEditorServices#411](https://github.com/PowerShell/PowerShellEditorServices/issues/411) - + Commands run outside of the integrated console prompt now interrupt the prompt + correctly. This resolves a class of issues that appear when running commands + in the extension like "New Project from Plaster Template" or any `$psEditor` + commands added with the "Register-EditorCommand" function. Running any of + these commands will now cause the current input prompt to be cancelled so that + the command's output will be written correctly. + +#### Code formatting improvements + +- Fixed [#595](https://github.com/PowerShell/vscode-powershell/issues/595) - + High CPU usage when using formatOnType has now been resolve + +- Fixed [#559](https://github.com/PowerShell/vscode-powershell/issues/559) - + The `newLineAfterCloseBrace` behavior has been improved to respect common syntax + usages + +- Fixed[PowerShell/PowerShellEditorServices#380](https://github.com/PowerShell/PowerShellEditorServices/issues/380) - + The `whitespaceBeforeOpenBrace` behavior now leaves "magic" functions with the + correct formatting. For example: `(0 .. 10).foreach{$_}` now does not have a + whitespace inserted before the `{`. + +#### New Project with Plaster improvements + +- Fixed [#643](https://github.com/PowerShell/vscode-powershell/issues/643) - + Running Plaster using the New Project command now interrupts the command prompt + correctly + +- Fixed [#504](https://github.com/PowerShell/vscode-powershell/issues/504) - + Confirming default values in Plaster input prompts by pressing Enter now works + correctly + +#### Other fixes and improvements + +- Added [#639](https://github.com/PowerShell/vscode-powershell/pull/639) and + [#640](https://github.com/PowerShell/vscode-powershell/pull/640) - + Our configuration setting descriptions have been edited for superior clarity + thanks to [June Blender](https://github.com/juneb)! + +- Fixed [#611](https://github.com/PowerShell/vscode-powershell/pull/640) - + Example-* snippets are now displaying correctly in IntelliSense results + +- Added [#624](https://github.com/PowerShell/vscode-powershell/pull/624) - + When you update the PowerShell extension after this release, you will now see + version update indicators which offer to display the changelog in a preview + tab + +## 0.11.0 +### Wednesday, March 22, 2017 + +#### Remotely edited files can now be saved + +- Added [#583](https://github.com/PowerShell/vscode-powershell/issues/583) - + When you open files in a remote PowerShell session with the `psedit` command, + their updated contents are now saved back to the remote machine when you save + them in the editor. + +#### Integrated console improvements + +- Fixed [#533](https://github.com/PowerShell/vscode-powershell/issues/533) - + The backspace key now works in the integrated console on Linux and macOS. This + fix also resolves a few usability problems with the integrated console on all + supported OSes. + +- Fixed [542](https://github.com/PowerShell/vscode-powershell/issues/542) - + Get-Credential now hides keystrokes correctly on Linux and macOS. + +We also added some new settings ([#580](https://github.com/PowerShell/vscode-powershell/issues/580), +[#588](https://github.com/PowerShell/vscode-powershell/issues/588)) to allow fine-tuning +of the integrated console experience: + +- `powershell.startAutomatically` (default: `true`) - If true, causes PowerShell extension + features to start automatically when a PowerShell file is opened. If false, the user must + initiate startup using the 'PowerShell: Restart Current Session' command. IntelliSense, + code navigation, integrated console, code formatting, and other features will not be + enabled until the extension has been started. Most users will want to leave this + setting to `true`, though it was added to save CPU cycles if you often use new VS Code + instances to quickly view PowerShell files. + +- `powershell.integratedConsole.showOnStartup` (default: `true`) - If true, causes the + integrated console to be shown automatically when the PowerShell extension is initialized. + +- `powershell.integratedConsole.focusConsoleOnExecute` (default: `true`) - If `true`, + causes the integrated console to be focused when a script selection is run or a + script file is debugged. + +#### Interactive debugging improvements + +- Added [#540](https://github.com/PowerShell/vscode-powershell/issues/540) - + The scripts that you debug are now dot-sourced into the integrated console's + session, allowing you to experiment with the results of your last execution. + +- Added [#600](https://github.com/PowerShell/vscode-powershell/issues/600) - + Debugger commands like `stepInto`, `continue`, and `quit` are now available + in the integrated console while debugging a script. + +- Fixed [#596](https://github.com/PowerShell/vscode-powershell/issues/596) - + VS Code's Debug Console now warns the user when it is used while debugging + a script. All command evaluation now happens through the integrated console + so this message should help alleviate confusion. + +#### Other fixes and improvements + +- Fixed [#579](https://github.com/PowerShell/vscode-powershell/issues/579) - + Sorting of IntelliSense results is now consistent with the PowerShell ISE +- Fixed [#591](https://github.com/PowerShell/vscode-powershell/issues/591) - + "Editor commands" registered with the `Register-EditorCommand` function are + now sorted alphabetically by their `Name` field, causing commands to be grouped + based on their source module. +- Fixed [#575](https://github.com/PowerShell/vscode-powershell/issues/575) - + The interactive console no longer starts up with errors in the `$Error` variable. +- Fixed [#599](https://github.com/PowerShell/vscode-powershell/issues/599) - + The [SSASCMDLETS module](https://msdn.microsoft.com/en-us/library/hh213141.aspx?f=255&MSPPError=-2147217396) + from SQL Server Analytics Service should now load correctly in the integrated + console. + +## 0.10.1 +### Thursday, March 16, 2017 + +#### Fixes and improvements + +- Fixed [#566](https://github.com/PowerShell/vscode-powershell/issues/566) - + Enable editor IntelliSense while stopped at a breakpoint +- Fixed [#556](https://github.com/PowerShell/vscode-powershell/issues/556) - + Running and debugging scripts in the integrated console should not steal focus from the editor +- Fixed [#543](https://github.com/PowerShell/vscode-powershell/issues/543) - + Keyboard input using AltGr Ctrl+Alt modifiers does not work +- Fixed [#421](https://github.com/PowerShell/vscode-powershell/issues/421) - + Session startup should give a helpful error message if ConstrainedLanguage mode is turned on +- Fixed [#401](https://github.com/PowerShell/vscode-powershell/issues/401) - + Session startup should indicate if current PowerShell version is unsupported (PSv1 and v2) +- Fixed [#454](https://github.com/PowerShell/vscode-powershell/issues/454) - + ExecutionPolicy set via group policy or registry key should not cause language server to crash +- Fixed [#532](https://github.com/PowerShell/vscode-powershell/issues/532) - + DEVPATH environment variable not being set for interactive console session +- Fixed [PowerShellEditorServices #387](https://github.com/PowerShell/PowerShellEditorServices/issues/387) - + Write-(Warning, Verbose, Debug) are missing message prefixes and foreground colors +- Fixed [PowerShellEditorServices #382](https://github.com/PowerShell/PowerShellEditorServices/issues/382) - + PSHostUserInterface implementation should set SupportsVirtualTerminal to true + +## 0.10.0 +### Tuesday, March 14, 2017 + +#### New interactive console experience + +We are excited to provide you with the first release of our new interactive +console experience! When you open up a PowerShell script file, you will +be greeted with a new VS Code integrated terminal window called +"PowerShell Integrated Console" + +![integrated console screenshot](https://cloud.githubusercontent.com/assets/79405/23910661/b599f2ee-0897-11e7-9426-00af794c10b5.png) + +In this console you will have an experience that falls somewhere between +the PowerShell ISE and the PowerShell console host: + +- Tab completion of commands and their parameters +- Basic command history, accessed using the up/down arrow keys +- The `psedit` command opens existing files in an editor pane +- Pressing F8 in an editor pane runs the current line or selection in the console +- Native applications like `git` are fully supported +- Script debugging shares the same console session with the editor for + a true ISE-like debugging experience + +It even works with your fancy prompt function if configured in your +VS Code profile (`$HOME\Documents\WindowsPowerShell\Microsoft.VSCode_profile.ps1`): + +![custom prompt screenshot](https://cloud.githubusercontent.com/assets/79405/23910654/b1bca66c-0897-11e7-81b1-70eff5b97c21.png) + +The integrated console is supported on PowerShell v3 through v6 and works +on Linux and macOS with PowerShell Core. By default you don't have to +configure which PowerShell to run, we will pick an appropriate default +based on your platform. If you'd like to choose a different install +of PowerShell you can always change the `powershell.developer.powerShellExePath` +setting. + +Keep in mind that this is the first release for this feature and there are +bound to be issues and missing functionality. Please feel free to file +GitHub issues for any bugs or feature requests! + +##### Known Issues and Limitations + +- [#535](https://github.com/PowerShell/vscode-powershell/issues/535) PSReadline + is currently **not** supported in the integrated console. We will enable this + in a future release. +- [#534](https://github.com/PowerShell/vscode-powershell/issues/534) Integrated console + prompt is not restarted when you stop the debugging of a local runspace in another + process. This will be addressed soon in a patch update. +- [#533](https://github.com/PowerShell/vscode-powershell/issues/533) Backspace key + does not work in the integrated console on Linux and macOS. The workaround for now + is to use Ctrl+H instead of the Backspace key. This will be addressed + soon in a patch update. +- [#536](https://github.com/PowerShell/vscode-powershell/issues/536) Integrated console + sometimes does not have a scrollbar at startup. The workaround is to resize the width + of the VS Code window slightly and the scrollbar will appear. This will be addressed + soon in a patch update. + +#### Get-Credential and PSCredential support + +Now that we have the integrated console, we have added support for the `Get-Credential` +cmdlet, `Read-Host -AsSecureString`, and any input prompt of type `SecureString` or `PSCredential`. +When you run any of these cmdlets you will be prompted inside the integrated console: + +![credential screenshot](https://cloud.githubusercontent.com/assets/79405/23910668/bac9019c-0897-11e7-80e2-eaf1b9e507f8.png) + +#### Code formatting improvements + +We now support VS Code's `editor.formatOnType` setting so that your code gets formatted +as you type! Formatting will be triggered when you press Enter or the closing curly +brace character `}`. + +Based on your feedback, we've also added new code formatting options, all of which +are turned on by default: + +- `powershell.codeFormatting.newLineAfterCloseBrace` - Causes a newline to be inserted + after a closing brace in multi-line expressions like if/else +- `powershell.codeFormatting.whitespaceBeforeOpenBrace` - Causes whitespace to be + inserted before an open brace like `Foreach-Object {` +- `powershell.codeFormatting.whitespaceBeforeOpenParen` - Causes whitespace to be + inserted before an open parentheses like `if (` +- `powershell.codeFormatting.whitespaceAroundOperator` - Causes whitespace to be + inserted around operators like `=` or `+` +- `powershell.codeFormatting.whitespaceAfterSeparator` - Causes whitespace to be + inserted around separator characters like `;` and `,` +- `powershell.codeFormatting.ignoreOneLineBlock` - Single-line expressions, like + small if/else statements, will not be expanded to multiple lines. + +We've also made many improvements to the performance and stability of the formatter. + +#### Debugging improvements + +We've added a new configuration for debugging your Pester tests. By default it +merely runs `Invoke-Pester` at the workspace path, but you can also edit the +configuation to add additional arguments to be passed through. + +We've also added support for column breakpoints. Now you can set a breakpoint +directly within a pipeline by placing your cursor at any column on a line and +running the `Debug: Column Breakpoint` command: + +![column breakpoint screenshot](https://cloud.githubusercontent.com/assets/79405/23910649/aaef70e4-0897-11e7-93b7-0d729969a1e2.png) + +For the latest PowerShell Core release ([6.0.0-alpha.17](https://github.com/PowerShell/PowerShell/releases/tag/v6.0.0-alpha.17)), +we have also added the ability to step into ScriptBlocks that are executed on another +machine using `Invoke-Command -Computer`. + +Set a breakpoint on an `Invoke-Command` line and then once it's hit: + +![Invoke-Command screenshot](https://cloud.githubusercontent.com/assets/79405/23911032/c01b8ff6-0898-11e7-89e3-02a31d419fc5.png) + +Press `F11` and you will step into the ScriptBlock. You can now continue to use +"step in" and trace the ScriptBlock's execution on the remote machine: + +![remote script listing screenshot](https://cloud.githubusercontent.com/assets/79405/23918844/ca86cf28-08b1-11e7-8014-c689cdcccf87.png) + +Note that you cannot currently set breakpoints in the script listing file as +this code is being executed without an actual script file on the remote machine. + +#### Other fixes and improvements + +- Fixed [#427](https://github.com/PowerShell/vscode-powershell/issues/427) - + The keybinding for "Expand Alias" command has been changed to Shift+Alt+E +- Fixed [#519](https://github.com/PowerShell/vscode-powershell/issues/519) - + Debugger hangs after continuing when watch expressions are set +- Fixed [#448](https://github.com/PowerShell/vscode-powershell/issues/448) - + Code formatter should keep indentation for multi-line pipelines +- Fixed [#518](https://github.com/PowerShell/vscode-powershell/issues/518) - + Code formatter fails when dollar-paren `$()` expressions are used +- Fixed [#447](https://github.com/PowerShell/vscode-powershell/issues/447) - + Code formatter crashes when run on untitled documents + +## 0.9.0 +### Thursday, January 19, 2017 + +#### New PowerShell code formatter + +We've added a formatter for PowerShell code which allows you to format an +entire file or a selection within a file. You can access this formatter by +running VS Code's `Format Document` and `Format Selection` commands inside +of a PowerShell file. + +You can configure code formatting with the following settings: + +- `powershell.codeFormatting.openBraceOnSameLine` - Places open brace on the + same line as its associated statement. Default is `true`. +- `powershell.codeFormatting.newLineAfterOpenBrace` - Ensures that a new line + occurs after an open brace (unless in a pipeline statement on the same line). + Default is `true` +- `editor.tabSize` - Specifies the indentation width for code blocks. This + is a VS Code setting but it is respected by the code formatter. +- `editor.formatOnSave` - If true, automatically formats when they are saved. + This is a VS Code setting and may also affect non-PowerShell files. + +Please note that this is only a first pass at PowerShell code formatting, it +may not format your code perfectly in all cases. If you run into any issues, +please [file an issue](https://github.com/PowerShell/vscode-powershell/issues/new) +and give us your feedback! + +#### Streamlined debugging experience - launch.json is now optional! + +**NOTE: This improvement depends on VS Code 1.9.0 which is due for release +early February!** However, you can try it out right now with the [VS Code Insiders](https://code.visualstudio.com/insiders) +release. + +Thanks to a new improvement in VS Code's debugging APIs, we are now able to +launch the PowerShell debugger on a script file without the need for a `launch.json` +file. You can even debug individual PowerShell scripts without opening a +workspace folder! Don't worry, you can still use a `launch.json` file to configure +specific debugging scenarios. + +We've also made debugger startup much more reliable. You will no longer see the +dreaded "Debug adapter terminated unexpectedly" message when you try to launch +the debugger while the language server is still starting up. + +#### Support for debugging remote and attached runspaces + +We now support remote PowerShell sessions via the [`Enter-PSSession`](https://msdn.microsoft.com/en-us/powershell/reference/5.0/microsoft.powershell.core/enter-pssession) +cmdlet. This cmdlet allows you to create a PowerShell session on another machine +so that you can run commands or debug scripts there. The full debugging +experience works with these remote sessions on PowerShell 4 and above, allowing +you to set breakpoints and see remote files be opened locally when those breakpoints +are hit. + +For PowerShell 5 and above, we also support attaching to local and remote PowerShell +host processes using the [`Enter-PSHostProcess`](https://msdn.microsoft.com/en-us/powershell/reference/5.0/microsoft.powershell.core/enter-pshostprocess) +and [`Debug-Runspace`](https://msdn.microsoft.com/en-us/powershell/reference/5.0/microsoft.powershell.utility/debug-runspace) +cmdlets. This allows you to jump into another process and then debug a script that +is already running in one of the runspaces in that process. The debugger will break +execution of the running script and then the associated script file will be opened +in the editor so that you can set breakpoints and step through its execution. + +We've also added a new `launch.json` configuration for debugging PowerShell host processes: + +![Process launch configuration screenshot](https://cloud.githubusercontent.com/assets/79405/22089468/391e8120-dda0-11e6-950c-64f81b364c35.png) + +When launched, the default "attach" configuration will prompt you with a list of +PowerShell host processes on the local machine so that you can easily select one +to be debugged: + +![Process selection UI screenshot](https://cloud.githubusercontent.com/assets/79405/22081037/c205e516-dd76-11e6-834a-66f4c38e181d.png) + +You can also edit the launch configuration to hardcode the launch parameters, even +setting a remote machine to connect to before attaching to the remote process: + +```json + { + "type": "PowerShell", + "request": "attach", + "name": "PowerShell Attach to Host Process", + "computerName": "my-remote-machine", + "processId": "12345", + "runspaceId": 1 + } +``` + +Please note that we currently do not yet support initiating remote sessions from Linux +or macOS. This will be supported in an upcoming release. + +#### Initial support for remote file opening using `psedit` + +Another nice improvement is that we now support the `psedit` command in remote and +attached sessions. This command allows you to open a file in a local or remote session +so that you can set breakpoints in it using the UI before launching it. For now these +remotely-opened files will not be saved back to the remote session when you edit and +save them. We plan to add this capability in the next feature update. + +#### New "interactive session" debugging mode + +You can now create a new launch configuration which drops you directly into the +debug console so that you can debug your scripts and modules however you wish. +You can call Set-PSBreakpoint to set any type of breakpoint and then invoke your +code through the console to see those breakpoints get hit. This mode can also be +useful for debugging remote sessions. + +![Interactive session config screenshot](https://cloud.githubusercontent.com/assets/79405/22089502/5e56b4c6-dda0-11e6-8a51-f24e29ce7988.png) + +Please note that this is NOT a replacement for a true interactive console experience. +We've added this debugging configuration to enable a few other debugging scenarios, like +debugging PowerShell modules, while we work on a true interactive console experience using +VS Code's Terminal interface. + +#### New document symbol support for PSD1 files + +We've extended our document symbol support to `.psd1` files to make it really easy to +navigate through them. When you have a `.psd1` file open, run the `Go to Symbol in File...` +command (Ctrl + Shift + O) and you'll see this popup: + +![psd1 symbol screenshot](https://cloud.githubusercontent.com/assets/79405/22094872/85c7d9a2-ddc5-11e6-9bee-5fc8c3dae097.png) + +You can type a symbol name or navigate using your arrow keys. Once you select one of the +symbol names, the editor pane will jump directly to that line. + +#### Other fixes and improvements + +- Added a new `Open Examples Folder` command to easily open the extension's + example script folder. +- Added a new setting `powershell.developer.powerShellExeIsWindowsDevBuild` + which, when true, indicates that the `powerShellExePath` points to a Windows + PowerShell development build. +- Fixed [#395](https://github.com/PowerShell/vscode-powershell/issues/395): + Quick Fix for PSAvoidUsingAliases rule replaces the entire command +- Fixed [#396](https://github.com/PowerShell/vscode-powershell/issues/396): + Extension commands loaded in PowerShell profile are not being registered +- Fixed [#391](https://github.com/PowerShell/vscode-powershell/issues/391): + DSC IntelliSense can cause the language server to crash +- Fixed [#400](https://github.com/PowerShell/vscode-powershell/issues/400): + Language server can crash when selecting PSScriptAnalyzer rules +- Fixed [#408](https://github.com/PowerShell/vscode-powershell/issues/408): + Quick fix requests meant for other extensions crash the language server +- Fixed [#401](https://github.com/PowerShell/vscode-powershell/issues/401): + Extension startup should indicate if the current PowerShell version is unsupported +- Fixed [#314](https://github.com/PowerShell/vscode-powershell/issues/314): + Errors/Warnings still show up in Problems window when file is closed +- Fixed [#388](https://github.com/PowerShell/vscode-powershell/issues/388): + Syntax errors are not reported when powershell.scriptAnalysis.enable is set to false + +## 0.8.0 +### Friday, December 16, 2016 + +#### Improved PowerShell session management + +It's now much easier to manage the active PowerShell session. We've added a +new item to the status bar to indicate the state of the session and the version +of PowerShell you're using: + +![Screenshot of status indicator](https://cloud.githubusercontent.com/assets/79405/21247551/fcf2777c-c2e4-11e6-9659-7349c35adbcd.png) + +When this status item is clicked, a new menu appears to give you some session +management options: + +![Screenshot of session menu](https://cloud.githubusercontent.com/assets/79405/21247555/009fa64c-c2e5-11e6-8171-76914d3366a0.png) + +You can restart the active session, switch between 32-bit and 64-bit PowerShell on +Windows or switch to another PowerShell process (like a 6.0 alpha build) that +you've configured with the `powershell.developer.powerShellExePath`. + +We've also improved the overall experience of loading and using the extension: + +- It will prompt to restart the PowerShell session if it crashes for any reason +- It will also prompt to restart the session if you change any relevant PowerShell + configuration setting like the aforementioned `powershell.developer.powerShellExePath`. +- You can easily access the logs of the current session by running the command + `Open PowerShell Extension Logs Folder`. + +#### Create new modules with Plaster + +In this release we've added integration with the [Plaster](https://github.com/PowerShell/Plaster) +module to provide a `Create New Project from Plaster Template` command. This command will +walk you through the experience of selecting a template and filling in all of +the project details: + +![Screenshot of Plaster template selection](https://cloud.githubusercontent.com/assets/79405/21247560/087b47a4-c2e5-11e6-86e7-ba3727b5e36d.png) + +![Screenshot of Plaster input](https://cloud.githubusercontent.com/assets/79405/21247562/0a79b130-c2e5-11e6-97e9-cfd672803f75.png) + +We include one basic project template by default and will add more in the very +near future. However, you won't need to update the PowerShell extension to get these +new templates, they will appear when you install an update to the Plaster module from +the [PowerShell Gallery](https://www.powershellgallery.com/). + +Check out [Plaster's documentation](https://github.com/PowerShell/Plaster/tree/master/docs/en-US) +for more details on how it can be used and how you can create your own templates. + +#### New "quick fix" actions for PSScriptAnalyzer rules + +The PowerShell extension now uses any "suggested corrections" which are returned with +a rule violation in your script file to provide a "quick fix" option for the affected +section of code. For example, when the `PSAvoidUsingCmdletAliases` rule finds the use +of a non-whitelisted alias, you will see a light bulb icon that gives the option to +change to the full name (right click or Ctrl+. on the marker): + +![Screenshot of PSScriptAnalyzer quick fix](https://cloud.githubusercontent.com/assets/79405/21247558/05887e86-c2e5-11e6-9c67-e4558a7e2dba.png) + +If you'd like to see more quick fixes for PowerShell code, head over to the +[PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) GitHub page and +get involved! + +#### Easily enable and disable PSScriptAnalyzer rules + +Another improvement related to PSScriptAnalyzer is the ability to change the active +PSScriptAnalyzer rules in the current editing session using a helpful selection menu: + +![Screenshot of PSScriptAnalyzer rule selection](https://cloud.githubusercontent.com/assets/79405/21247557/037888b6-c2e5-11e6-816f-6732e13cddb7.png) + +You can enable and disable active rules by running the `Select PSScriptAnalyzer Rules` +command. For now this only changes the active session but in a future release we will +modify your PSScriptAnalyzer settings file so that the changes are persisted to future +editing sessions. + +#### New "hit count" breakpoints in the debugger + +When debugging PowerShell scripts you can now set "hit count" breakpoints which +cause the debugger to stop only after the breakpoint has been encountered a specified +number of times. + +![Screenshot of a hit count breakpoint](https://cloud.githubusercontent.com/assets/79405/21247563/0c159202-c2e5-11e6-8c91-36791c4fa804.png) + +#### Other fixes and improvements + +- We now provide snippets for the `launch.json` configuration file which make it easier + to add new PowerShell debugging configurations for your project. +- In PowerShell `launch.json` configurations, the `program` parameter has now been + renamed to `script`. Configurations still using `program` will continue to work. +- Fixed #353: Cannot start PowerShell debugger on Windows when offline +- Fixed #217: PowerShell output window should be shown when F8 is pressed +- Fixed #292: Check for Homebrew's OpenSSL libraries correctly on macOS +- Fixed #384: PowerShell snippets broken in VS Code 1.8.0 + +## 0.7.2 +### Friday, September 2, 2016 + +- Fixed #243: Debug adapter process has terminated unexpectedly +- Fixed #264: Add check for OpenSSL on OS X before starting the language service +- Fixed #271: PSScriptAnalyzer settings path isn't being passed along +- Fixed #273: Debugger crashes after multiple runs +- Fixed #274: Extension crashes on Ctrl+Hover + +## 0.7.1 +### Tuesday, August 23, 2016 + +- "Auto" variable scope in debugger UI now expands by default +- Fixed #244: Extension fails to load if username contains spaces +- Fixed #246: Restore default PSScriptAnalyzer ruleset +- Fixed #248: Extension fails to load on Windows 7 with PowerShell v3 + +## 0.7.0 +### Thursday, August 18, 2016 + +#### Introducing support for Linux and macOS! + +This release marks the beginning of our support for Linux and macOS via +the new [cross-platform release of PowerShell](https://github.com/PowerShell/PowerShell). +You can find installation and usage instructions at the [PowerShell GitHub repository](https://github.com/PowerShell/PowerShell). + +## 0.6.2 +### Friday, August 12, 2016 + +- Fixed #231: In VS Code 1.4.0, IntelliSense has stopped working +- Fixed #193: Typing "n" breaks intellisense +- Fixed #187: Language server sometimes crashes then $ErrorActionPreference = "Stop" + +## 0.6.1 +### Monday, May 16, 2016 + +- Fixed #180: Profile loading should be enabled by default +- Fixed #183: Language server sometimes fails to initialize preventing IntelliSense, etc from working +- Fixed #182: Using 'Run Selection' on a line without a selection only runs to the cursor position +- Fixed #184: When running a script in the debugger, $host.Version reports wrong extension version + +## 0.6.0 +### Thursday, May 12, 2016 + +#### Added a new cross-editor extensibility model + +- We've added a new extensibility model which allows you to write PowerShell + code to add new functionality to Visual Studio Code and other editors with + a single API. If you've used `$psISE` in the PowerShell ISE, you'll feel + right at home with `$psEditor`. Check out the [documentation](https://powershell.github.io/PowerShellEditorServices/guide/extensions.html) + for more details! + +#### Support for user and system-wide profiles + +- We've now introduced the `$profile` variable which contains the expected + properties that you normally see in `powershell.exe` and `powershell_ise.exe`: + - `AllUsersAllHosts` + - `AllUsersCurrentHost` + - `CurrentUserAllHosts` + - `CurrentUserCurrentHost` +- In Visual Studio Code the profile name is `Microsoft.VSCode_profile.ps1`. +- `$host.Name` now returns "Visual Studio Code Host" and `$host.Version` returns + the version of the PowerShell extension that is being used. + +#### Other improvements + +- IntelliSense for static methods and properties now works correctly. If you + type `::` after a type such as `[System.Guid]` you will now get the correct + completion results. This also works if you press `Ctrl+Space` after the `::` + characters. +- `$env` variables now have IntelliSense complete correctly. +- Added support for new VSCode command `Debug: Start Without Debugging`. Shortcut + for this command is Ctrl+F5. +- Changed the keyboard shortcut for `PowerShell: Expand Alias` from Ctrl+F5 to Ctrl+Alt+e. +- Added support for specifying a PSScriptAnalyzer settings file by + providing a full path in your User Settings for the key `powershell.scriptAnalysis.settingsPath`. + You can also configure the same setting in your project's `.vscode\settings.json` + file to contain a workspace-relative path. If present, this workspace-level setting + overrides the one in your User Settings file. See the extension's `examples\.vscode\settings.json` + file for an example. +- The debug adapter now does not crash when you attempt to add breakpoints + for files that have been moved or don't exist. +- Fixed an issue preventing output from being written in the debugger if you + don't set a breakpoint before running a script. + +#### New configuration settings + +- `powershell.scriptAnalysis.settingsPath`: Specifies the path to a PowerShell Script Analyzer settings file. Use either an absolute path (to override the default settings for all projects) or use a path relative to your workspace. + +## 0.5.0 +### Thursday, March 10, 2016 + +#### Support for PowerShell v3 and v4 + +- Support for PowerShell v3 and v4 is now complete! Note that for this release, + Script Analyzer support has been disabled for PS v3 and v4 until we implement + a better strategy for integrating it as a module dependency + +#### Debugging improvements + +- Added support for command breakpoints. + + Hover over the Debug workspace's 'Breakpoints' list header and click the 'Add' + button then type a command name (like `Write-Output`) in the new text box that + appears in the list. + +- Added support for conditional breakpoints. + + Right click in the breakpoint margin to the left of the code editor and click + 'Add conditional breakpoint' then enter a PowerShell expression in the text box + that appears in the editor. + +#### Other improvements + +- Added a preview of a possible project template for PowerShell Gallery modules in + the `examples` folder. Includes a PSake build script with Pester test, clean, + build, and publish tasks. See the `examples\README.md` file for instructions. + Check it out and give your feedback on GitHub! +- `using 'module'` now resolves relative paths correctly, removing a syntax error that + previously appeared when relative paths were used +- Calling `Read-Host -AsSecureString` or `Get-Credential` from the console now shows an + appropriate "not supported" error message instead of crashing the language service. + Support for these commands will be added in a later release. + +#### New configuration settings + +- `powershell.useX86Host`: If true, causes the 32-bit language service to be used on 64-bit Windows. On 32-bit Windows this setting has no effect. + +## 0.4.1 +### Wednesday, February 17, 2016 + +- Updated PSScriptAnalyzer 1.4.0 for improved rule marker extents +- Added example Pester task for running tests in the examples folder +- Fixed #94: Scripts fail to launch in the debugger if the working directory path contains spaces + +## 0.4.0 +### Tuesday, February 9, 2016 + +#### Debugging improvements + +[@rkeithhill](https://github.com/rkeithhill) spent a lot of time polishing the script debugging experience for this release: + +- You can now pass arguments to scripts in the debugger with the `args` parameter in launch.json +- You can also run your script with the 32-bit debugger by changing the `type` parameter in launch.json to "PowerShell x86" (also thanks to [@adamdriscoll](https://github.com/adamdriscoll)!) +- The new default PowerShell debugger configuration now launches the active file in the editor +- You can also set the working directory where the script is run by setting the `cwd` parameter in launch.json to an absolute path. If you need a workspace relative path, use ${workspaceRoot} to create an absolute path e.g. `"${workspaceRoot}/modules/foo.psm1"`. + +We recommend deleting any existing `launch.json` file you're using so that a new one will +be generated with the new defaults. + +#### Console improvements + +- Improved PowerShell console output formatting and performance + - The console prompt is now displayed after a command is executed + - Command execution errors are now displayed correctly in more cases + - Console output now wraps at 120 characters instead of 80 characters + +- Added choice and input prompt support + - When executing code using the 'Run Selection' command, choice and input prompts appear as VS Code UI popups + - When executing code in the debugger, choice and input prompts appear in the Debug Console + +#### New commands + +- "Find/Install PowerShell modules from the gallery" (`Ctrl+K Ctrl+F`): Enables you to find and install modules from the PowerShell Gallery (thanks [@dfinke](https://github.com/dfinke)!) +- "Open current file in PowerShell ISE" (`Ctrl+Shift+i`): Opens the current file in the PowerShell ISE (thanks [@janegilring](https://github.com/janegilring)!) + +#### Editor improvements + +- Path auto-completion lists show just the current directory's contents instead of the full path (which had resulted in clipped text) +- Parameter auto-completion lists are now sorted in the same order as they are in PowerShell ISE where command-specific parameters preceed the common parameters +- Parameter auto-completion lists show the parameter type +- Command auto-completion lists show the resolved command for aliases and the path for executables +- Many improvements to the PowerShell snippets, more clearly separating functional and example snippets (all of the latter are prefixed with `ex-`) +- Added some additional example script files in the `examples` folder + +#### New configuration settings + +- `powershell.developer.editorServicesLogLevel`: configures the logging verbosity for PowerShell Editor Services. The default log level will now write less logs, improving overall performance + +## 0.3.1 +### Thursday, December 17, 2015 + +- Fix issue #49, Debug Console does not receive script output + +## 0.3.0 +### Tuesday, December 15, 2015 + +- Major improvements in variables retrieved from the debugging service: + - Global and script scope variables are now accessible + - New "Auto" scope which shows only the variables defined within the current scope + - Greatly improved representation of variable values, especially for dictionaries and + objects that implement the ToString() method +- Added new "Expand Alias" command which resolves command aliases used in a file or + selection and updates the source text with the resolved command names +- Reduced default Script Analyzer rules to a minimal list +- Fixed a wide array of completion text replacement bugs +- Improved extension upgrade experience + +## 0.2.0 +### Monday, November 23, 2015 + +- (Experimental) Added a new "Run selection" (F8) command which executes the current code selection and displays the output +- Added a new online help command! Press Ctrl+F1 to get help for the symbol under the cursor. +- Enabled PowerShell language features for untitled and in-memory (e.g. in Git diff viewer) PowerShell files +- Added `powershell.scriptAnalysis.enable` configuration variable to allow disabling script analysis for performance (issue #11) +- Fixed issue where user's custom PowerShell snippets did not show up +- Fixed high CPU usage when completing or hovering over an application path + +## 0.1.0 +### Wednesday, November 18, 2015 + +Initial release with the following features: + +- Syntax highlighting +- Code snippets +- IntelliSense for cmdlets and more +- Rule-based analysis provided by PowerShell Script Analyzer +- Go to Definition of cmdlets and variables +- Find References of cmdlets and variables +- Document and workspace symbol discovery +- Local script debugging and basic interactive console support diff --git a/package.json b/package.json index 5ead2b8299..887a461f09 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2020.4.3", + "version": "2020.5.0", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", From 46ce28fc21229888bda8a392481e7b9a80f3d1ba Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Sat, 9 May 2020 17:24:15 +0100 Subject: [PATCH 146/166] Update package-lock.json (#2684) --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index b813b4de5a..8bbfc53cba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "powershell-preview", - "version": "2020.4.3", + "version": "2020.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { From caf21357617e86a61fd20c810484ba52d836245b Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Mon, 11 May 2020 21:13:07 +0100 Subject: [PATCH 147/166] Cleanup unused variables (#2686) Co-authored-by: Christoph Bergmeister --- src/features/GenerateBugReport.ts | 2 - src/features/HelpCompletion.ts | 2 - src/main.ts | 5 --- src/session.ts | 9 ++-- .../updateExtensionVersions.ps1 | 42 ------------------- 5 files changed, 3 insertions(+), 57 deletions(-) diff --git a/src/features/GenerateBugReport.ts b/src/features/GenerateBugReport.ts index 6904095096..dd29ef673f 100644 --- a/src/features/GenerateBugReport.ts +++ b/src/features/GenerateBugReport.ts @@ -2,7 +2,6 @@ * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ -import cp = require("child_process"); import os = require("os"); import vscode = require("vscode"); import { IFeature, LanguageClient } from "../feature"; @@ -30,7 +29,6 @@ const extensions = export class GenerateBugReportFeature implements IFeature { private command: vscode.Disposable; - private powerShellProcess: cp.ChildProcess; constructor(private sessionManager: SessionManager) { this.command = vscode.commands.registerCommand("PowerShell.GenerateBugReport", () => { diff --git a/src/features/HelpCompletion.ts b/src/features/HelpCompletion.ts index 5dcfb3bcd8..97255bfc67 100644 --- a/src/features/HelpCompletion.ts +++ b/src/features/HelpCompletion.ts @@ -127,7 +127,6 @@ class TriggerFinder { class HelpCompletionProvider { private triggerFinderHelpComment: TriggerFinder; - private lastChangeText: string; private lastChangeRange: Range; private lastDocument: TextDocument; private langClient: LanguageClient; @@ -148,7 +147,6 @@ class HelpCompletionProvider { public updateState(document: TextDocument, changeText: string, changeRange: Range): void { this.lastDocument = document; - this.lastChangeText = changeText; this.lastChangeRange = changeRange; this.triggerFinderHelpComment.updateState(document, changeText); } diff --git a/src/main.ts b/src/main.ts index f5c25465c8..a51407300e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -40,10 +40,6 @@ import utils = require("./utils"); // tslint:disable-next-line: no-var-requires const PackageJSON: any = require("../../package.json"); -// NOTE: We will need to find a better way to deal with the required -// PS Editor Services version... -const requiredEditorServicesVersion = "2.0.0"; - // the application insights key (also known as instrumentation key) used for telemetry. const AI_KEY: string = "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217"; @@ -132,7 +128,6 @@ export function activate(context: vscode.ExtensionContext): void { sessionManager = new SessionManager( - requiredEditorServicesVersion, logger, documentSelector, PackageJSON.displayName, diff --git a/src/session.ts b/src/session.ts index a65484ecc1..024f52e10d 100644 --- a/src/session.ts +++ b/src/session.ts @@ -54,7 +54,6 @@ export class SessionManager implements Middleware { private sessionSettings: Settings.ISettings = undefined; private sessionDetails: utils.IEditorServicesSessionDetails; private bundledModulesPath: string; - private telemetryReporter: TelemetryReporter; // Initialized by the start() method, since this requires settings private powershellExeFinder: PowerShellExeFinder; @@ -66,18 +65,16 @@ export class SessionManager implements Middleware { vscode.env.sessionId === "someValue.sessionId"; constructor( - private requiredEditorServicesVersion: string, private log: Logger, private documentSelector: DocumentSelector, - private hostName: string, - private version: string, - private reporter: TelemetryReporter) { + hostName: string, + version: string, + private telemetryReporter: TelemetryReporter) { this.platformDetails = getPlatformDetails(); this.HostName = hostName; this.HostVersion = version; - this.telemetryReporter = reporter; const osBitness = this.platformDetails.isOS64Bit ? "64-bit" : "32-bit"; const procBitness = this.platformDetails.isProcess64Bit ? "64-bit" : "32-bit"; diff --git a/tools/postReleaseScripts/updateExtensionVersions.ps1 b/tools/postReleaseScripts/updateExtensionVersions.ps1 index 974a6e43f7..0d8d376046 100644 --- a/tools/postReleaseScripts/updateExtensionVersions.ps1 +++ b/tools/postReleaseScripts/updateExtensionVersions.ps1 @@ -116,23 +116,6 @@ function FindPackageJsonVersionSpan throw 'Did not find package.json version field' } -function FindRequiredPsesVersionSpan -{ - param( - [Parameter(Mandatory)] - [string] - $MainTsContent - ) - - $pattern = [regex]'const\s+requiredEditorServicesVersion\s+=\s+"(.*)"' - $versionGroup = $pattern.Match($MainTsContent).Groups[1] - - return @{ - Start = $versionGroup.Index - End = $versionGroup.Index + $versionGroup.Length - } -} - function FindVstsBuildVersionSpan { param( @@ -150,27 +133,6 @@ function FindVstsBuildVersionSpan } } -function UpdateMainTsPsesVersion -{ - param( - [Parameter(Mandatory)] - [string] - $MainTsPath, - - [Parameter(Mandatory)] - [version] - $Version - ) - - $mainTsContent = Get-Content -Raw $MainTsPath - $mainTsVersionSpan = FindRequiredPsesVersionSpan $mainTsContent - $newMainTsContent = New-StringWithSegment -String $mainTsContent -NewSegment $Version -StartIndex $mainTsVersionSpan.Start -EndIndex $mainTsVersionSpan.End - if ($newMainTsContent -ne $mainTsContent) - { - Set-Content -Path $MainTsPath -Value $newMainTsContent -Encoding utf8NoBOM -NoNewline - } -} - function UpdateDockerFileVersion { param( @@ -247,16 +209,12 @@ if (-not $PRDescription) } # Get the marketplace/non-semver versions for various files -$psesVersion = Get-VersionFromSemVer -SemVer $NewVersion $marketPlaceVersion = GetMarketplaceVersionFromSemVer -SemVer $NewVersion # Finally create the new package.json file $newPkgJsonContent = New-StringWithSegment -String $packageJson -NewSegment $NewVersion -StartIndex $pkgJsonVersionOffsetSpan.Start -EndIndex $pkgJsonVersionOffsetSpan.End Set-Content -Path $paths.packageJson -Value $newPkgJsonContent -Encoding utf8NoBOM -NoNewline -# Create the new content for the main.ts required version file -UpdateMainTsPsesVersion -MainTsPath $paths.mainTs -Version $psesVersion - # Create the new content for the VSTS dockerfile UpdateDockerFileVersion -DockerFilePath $paths.vstsDockerFile -Version $marketPlaceVersion From c59f3ebc30f7ac8983a08f1a2aaa81cc3e6c2084 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Tue, 12 May 2020 00:03:54 +0100 Subject: [PATCH 148/166] Respect user choice when dismissing the powerShellExePath dialog (#2688) --- src/session.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/session.ts b/src/session.ts index 024f52e10d..9c723d86fb 100644 --- a/src/session.ts +++ b/src/session.ts @@ -326,7 +326,7 @@ export class SessionManager implements Middleware { const choice = await vscode.window.showWarningMessage(warningMessage, "Let's do it!"); - if (choice === "") { + if (choice === undefined) { // They hit the 'x' to close the dialog. return; } From 0a1dab2674fffbe6ee0e4f0384255f5681e34bae Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 16:13:15 -0700 Subject: [PATCH 149/166] Bump vscode-extension-telemetry from 0.1.5 to 0.1.6 (#2691) Bumps [vscode-extension-telemetry](https://github.com/Microsoft/vscode-extension-telemetry) from 0.1.5 to 0.1.6. - [Release notes](https://github.com/Microsoft/vscode-extension-telemetry/releases) - [Commits](https://github.com/Microsoft/vscode-extension-telemetry/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8bbfc53cba..321497d2e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2146,9 +2146,9 @@ } }, "vscode-extension-telemetry": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.5.tgz", - "integrity": "sha512-/qTvBV6IJxavF16EWJKbjVRm5YLByAOMg+YRii8y1uyQKl2Ea/SIwyC5/Pxh3NQKHrahp2zL2U6ZW3Z023NjkA==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.6.tgz", + "integrity": "sha512-rbzSg7k4NnsCdF4Lz0gI4jl3JLXR0hnlmfFgsY8CSDYhXgdoIxcre8jw5rjkobY0xhSDhbG7xCjP8zxskySJ/g==", "requires": { "applicationinsights": "1.7.4" } diff --git a/package.json b/package.json index 887a461f09..91672256d2 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "dependencies": { "node-fetch": "^2.6.0", "semver": "^7.3.2", - "vscode-extension-telemetry": "~0.1.5", + "vscode-extension-telemetry": "~0.1.6", "vscode-languageclient": "~5.2.1" }, "devDependencies": { From 4db9e34da298b8e7667a536416ecddf16efb3a57 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Tue, 12 May 2020 17:54:59 +0100 Subject: [PATCH 150/166] =?UTF-8?q?=F0=9F=94=A7=F0=9F=9A=97=20Migrate=20se?= =?UTF-8?q?tting=20value=20of=20codeFormatting.whitespaceAroundPipe=20(if?= =?UTF-8?q?=20present)=20to=20new=20setting=20codeFormatting.addWhitespace?= =?UTF-8?q?AroundPipe=20automatically.=20(#2689)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Migrate setting value of codeFormatting.whitespaceAroundPipe to new setting codeFormatting.addWhitespaceAroundPipe automatically. * fix code analysis warnings * add comment to getConfigurationTarget and rename it to getEffectiveConfigurationTarget * try use quotes around undefined to see if it fixes codacy warning * Update src/session.ts Co-authored-by: Christoph Bergmeister --- src/session.ts | 14 ++++++++++++++ src/settings.ts | 30 +++++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/session.ts b/src/session.ts index 9c723d86fb..792bf3a026 100644 --- a/src/session.ts +++ b/src/session.ts @@ -123,6 +123,8 @@ export class SessionManager implements Middleware { this.promptPowerShellExeSettingsCleanup(); + this.migrateWhitespaceAroundPipeSetting(); + try { let powerShellExeDetails; if (this.sessionSettings.powerShellDefaultVersion) { @@ -317,6 +319,18 @@ export class SessionManager implements Middleware { return resolvedCodeLens; } + // During preview, populate a new setting value but not remove the old value. + // TODO: When the next stable extension releases, then the old value can be safely removed. Tracked in this issue: https://github.com/PowerShell/vscode-powershell/issues/2693 + private async migrateWhitespaceAroundPipeSetting() { + const configuration = vscode.workspace.getConfiguration(utils.PowerShellLanguageId); + const deprecatedSetting = 'codeFormatting.whitespaceAroundPipe' + if (configuration.has(deprecatedSetting) && !configuration.has('codeFormatting.addWhitespaceAroundPipe')) { + const configurationTarget = await Settings.getEffectiveConfigurationTarget(deprecatedSetting); + const value = configuration.get(deprecatedSetting, configurationTarget) + await Settings.change('codeFormatting.addWhitespaceAroundPipe', value, configurationTarget); + } + } + private async promptPowerShellExeSettingsCleanup() { if (this.sessionSettings.powerShellExePath) { let warningMessage = "The 'powerShell.powerShellExePath' setting is no longer used. "; diff --git a/src/settings.ts b/src/settings.ts index a5f4cbd51e..5ed9fb6fdb 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -245,12 +245,32 @@ export function load(): ISettings { }; } -export async function change(settingName: string, newValue: any, global: boolean = false): Promise { - const configuration: vscode.WorkspaceConfiguration = - vscode.workspace.getConfiguration( - utils.PowerShellLanguageId); +// Get the ConfigurationTarget (read: scope) of where the *effective* setting value comes from +export async function getEffectiveConfigurationTarget(settingName: string): Promise { + const configuration = vscode.workspace.getConfiguration(utils.PowerShellLanguageId); + + const detail = configuration.inspect(settingName); + let configurationTarget = null; + if (typeof detail.workspaceFolderValue !== "undefined") { + configurationTarget = vscode.ConfigurationTarget.WorkspaceFolder; + } + else if (typeof detail.workspaceValue !== "undefined") { + configurationTarget = vscode.ConfigurationTarget.Workspace; + } + else if (typeof detail.globalValue !== "undefined") { + configurationTarget = vscode.ConfigurationTarget.Global; + } + return configurationTarget; +} + +export async function change( + settingName: string, + newValue: any, + configurationTarget?: vscode.ConfigurationTarget | boolean): Promise { + + const configuration = vscode.workspace.getConfiguration(utils.PowerShellLanguageId); - await configuration.update(settingName, newValue, global); + await configuration.update(settingName, newValue, configurationTarget); } function getWorkspaceSettingsWithDefaults( From e2541cdfd7c9fe8e29990e73508326aa27637aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Tue, 12 May 2020 23:43:34 +0200 Subject: [PATCH 151/166] Add debug output option for Pester (#2670) * Add debug output option for Pester * remove space * improve option description --- package.json | 13 ++++++++++++- src/features/PesterTests.ts | 7 ++++++- src/settings.ts | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 91672256d2..10f52f151e 100644 --- a/package.json +++ b/package.json @@ -784,11 +784,22 @@ "type": "string", "enum": [ "FromPreference", + "Minimal", "Normal", - "Minimal" + "Diagnostic" ], "default": "FromPreference", "description": "Defines the verbosity of output to be used. For Pester 5 and newer the default value FromPreference, will use the Output settings from the $PesterPreference defined in the caller context, and will default to Normal if there is none. For Pester 4 the FromPreference and Normal options map to All, and Minimal option maps to Fails." + }, + "powershell.pester.debugOutputVerbosity": { + "type": "string", + "enum": [ + "Minimal", + "Normal", + "Diagnostic" + ], + "default": "Diagnostic", + "description": "Defines the verbosity of output to be used when debugging a test or a block. For Pester 5 and newer the default value Diagnostic will print additional information about discovery, skipped and filtered tests, mocking and more." } } }, diff --git a/src/features/PesterTests.ts b/src/features/PesterTests.ts index de53100992..24ddf5759f 100644 --- a/src/features/PesterTests.ts +++ b/src/features/PesterTests.ts @@ -113,7 +113,12 @@ export class PesterTestsFeature implements IFeature { launchConfig.args.push("-MinimumVersion5"); } - launchConfig.args.push("-Output", `'${settings.pester.outputVerbosity}'`); + if (launchType === LaunchType.Debug) { + launchConfig.args.push("-Output", `'${settings.pester.debugOutputVerbosity}'`); + } + else { + launchConfig.args.push("-Output", `'${settings.pester.outputVerbosity}'`); + } return launchConfig; } diff --git a/src/settings.ts b/src/settings.ts index 5ed9fb6fdb..50445d5281 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -122,6 +122,7 @@ export interface ISideBarSettings { export interface IPesterSettings { useLegacyCodeLens?: boolean; outputVerbosity?: string; + debugOutputVerbosity?: string; } export function load(): ISettings { @@ -194,6 +195,7 @@ export function load(): ISettings { const defaultPesterSettings: IPesterSettings = { useLegacyCodeLens: true, outputVerbosity: "FromPreference", + debugOutputVerbosity: "Diagnostic", }; return { From 4a539531b0e2db8c712dde534d03c306be5d649a Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Tue, 12 May 2020 18:29:37 -0700 Subject: [PATCH 152/166] [Ignore] update CL with new items --- CHANGELOG.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 954fb9f008..899d52104c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,22 @@ # PowerShell Extension Release History -## v2020.5.0 -### Wednesday, May 06, 2020 +## v2020.5.0-preview +### Wednesday, May 13, 2020 #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) -- [vscode-powershell #2676](https://github.com/PowerShell/vscode-powershell/pull/2676) - +- ✨🐢 [vscode-powershell #2670](https://github.com/PowerShell/vscode-powershell/pull/2670) + Add debug output setting for Pester. (Thanks @nohwnd!) +- ✨🔧 [vscode-powershell #2689](https://github.com/PowerShell/vscode-powershell/pull/2689) + Migrate setting value of `powershell.codeFormatting.whitespaceAroundPipe` to `powershell.codeFormatting.addWhitespaceAroundPipe` automatically. (Thanks @bergmeister!) +- 🐛🔧 [vscode-powershell #2688](https://github.com/PowerShell/vscode-powershell/pull/2688) + Respect user choice when dismissing the `powerShellExePath` dialog. (Thanks @bergmeister!) +- ✨👷 [vscode-powershell #2686](https://github.com/PowerShell/vscode-powershell/pull/2686) - + Code clean up around some unused variables. (Thanks @bergmeister!) +- 🐛🐢 [vscode-powershell #2676](https://github.com/PowerShell/vscode-powershell/pull/2676) - Fix Pester invocation for 3x versions. (Thanks @nohwnd!) -- [vscode-powershell #2674](https://github.com/PowerShell/vscode-powershell/pull/2674) - +- ✨👮‍ [vscode-powershell #2674](https://github.com/PowerShell/vscode-powershell/pull/2674) - Add additional settings for PSScriptAnalyzer 1.19. (Thanks @bergmeister!) -- [vscode-powershell #2672](https://github.com/PowerShell/vscode-powershell/pull/2672) - +- ⚡️🔍 [vscode-powershell #2672](https://github.com/PowerShell/vscode-powershell/pull/2672) - Use in-memory debug adapter instead of spinning up new process. #### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices) From f435da4ac374ac54cf109ac71dea700a26b74ac3 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 12 May 2020 19:40:23 -0700 Subject: [PATCH 153/166] [Ignore] dashes in CL --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 899d52104c..d8e4f1cb05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,11 @@ ### Wednesday, May 13, 2020 #### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) -- ✨🐢 [vscode-powershell #2670](https://github.com/PowerShell/vscode-powershell/pull/2670) +- ✨🐢 [vscode-powershell #2670](https://github.com/PowerShell/vscode-powershell/pull/2670) - Add debug output setting for Pester. (Thanks @nohwnd!) -- ✨🔧 [vscode-powershell #2689](https://github.com/PowerShell/vscode-powershell/pull/2689) +- ✨🔧 [vscode-powershell #2689](https://github.com/PowerShell/vscode-powershell/pull/2689) - Migrate setting value of `powershell.codeFormatting.whitespaceAroundPipe` to `powershell.codeFormatting.addWhitespaceAroundPipe` automatically. (Thanks @bergmeister!) -- 🐛🔧 [vscode-powershell #2688](https://github.com/PowerShell/vscode-powershell/pull/2688) +- 🐛🔧 [vscode-powershell #2688](https://github.com/PowerShell/vscode-powershell/pull/2688) - Respect user choice when dismissing the `powerShellExePath` dialog. (Thanks @bergmeister!) - ✨👷 [vscode-powershell #2686](https://github.com/PowerShell/vscode-powershell/pull/2686) - Code clean up around some unused variables. (Thanks @bergmeister!) From 939379d13c1fbc1e1ce87cbc46606ba02e2b314d Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Wed, 13 May 2020 23:11:30 +0100 Subject: [PATCH 154/166] Change default of powershell.codeFormatting.pipelineIndentationStyle from None back to NoIndentation due to PSSA bug (#2698) * Change default of powershell.codeFormatting.pipelineIndentationStyle from None back to NoIndentation due to PSSA bug * re-trigger CI Co-authored-by: Christoph Bergmeister --- package.json | 4 ++-- src/settings.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 10f52f151e..aa59cc55e1 100644 --- a/package.json +++ b/package.json @@ -657,8 +657,8 @@ "NoIndentation", "None" ], - "default": "None", - "description": "Multi-line pipeline style settings (default: None)." + "default": "NoIndentation", + "description": "Multi-line pipeline style settings (default: NoIndentation)." }, "powershell.codeFormatting.whitespaceBeforeOpenBrace": { "type": "boolean", diff --git a/src/settings.ts b/src/settings.ts index 50445d5281..00c98f326f 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -162,7 +162,7 @@ export function load(): ISettings { openBraceOnSameLine: true, newLineAfterOpenBrace: true, newLineAfterCloseBrace: true, - pipelineIndentationStyle: PipelineIndentationStyle.None, + pipelineIndentationStyle: PipelineIndentationStyle.NoIndentation, whitespaceBeforeOpenBrace: true, whitespaceBeforeOpenParen: true, whitespaceAroundOperator: true, From f6b06ccce9d91a471e2408b6cf4a2d813295ba34 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 18 May 2020 09:19:08 -0700 Subject: [PATCH 155/166] Bump typescript from 3.5.3 to 3.8.3 (#2513) * Bump typescript from 3.5.3 to 3.8.3 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.5.3 to 3.8.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v3.5.3...v3.8.3) Signed-off-by: dependabot-preview[bot] * update node types as well Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Tyler James Leonhardt --- package-lock.json | 6 +++--- package.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 321497d2e8..8484441727 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2050,9 +2050,9 @@ } }, "typescript": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", - "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", "dev": true }, "uc.micro": { diff --git a/package.json b/package.json index aa59cc55e1..ae3581e83b 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@types/glob": "^7.1.1", "@types/mocha": "~7.0.2", "@types/mock-fs": "~4.10.0", - "@types/node": "~10.11.0", + "@types/node": "~12.12.39", "@types/node-fetch": "~2.5.7", "@types/rewire": "~2.5.28", "@types/semver": "~7.1.0", @@ -65,7 +65,7 @@ "rewire": "~5.0.0", "sinon": "~9.0.2", "tslint": "~6.1.2", - "typescript": "~3.5.3", + "typescript": "~3.8.3", "vsce": "~1.75.0", "vscode-test": "~1.3.0" }, From 3256d4eea3ff08f2cfd937d0668e427a7fabbdb4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 18 May 2020 09:46:03 -0700 Subject: [PATCH 156/166] Bump vscode-languageclient from 5.2.1 to 6.1.3 (#2580) Bumps [vscode-languageclient](https://github.com/Microsoft/vscode-languageserver-node/tree/HEAD/client) from 5.2.1 to 6.1.3. - [Release notes](https://github.com/Microsoft/vscode-languageserver-node/releases) - [Commits](https://github.com/Microsoft/vscode-languageserver-node/commits/release/client/6.1.3/client) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 44 ++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8484441727..dfa7fb50dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -122,9 +122,9 @@ } }, "@types/node": { - "version": "10.11.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.11.7.tgz", - "integrity": "sha512-yOxFfkN9xUFLyvWaeYj90mlqTJ41CsQzWKS3gXdOMOyPVacUsymejKxJ4/pMW7exouubuEeZLJawGgcNGYlTeg==", + "version": "12.12.39", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.39.tgz", + "integrity": "sha512-pADGfwnDkr6zagDwEiCVE4yQrv7XDkoeVa4OfA9Ju/zRTk6YNDLGtQbkdL4/56mCQQCs4AhNrBIag6jrp7ZuOg==", "dev": true }, "@types/node-fetch": { @@ -2154,39 +2154,39 @@ } }, "vscode-jsonrpc": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz", - "integrity": "sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-5.0.1.tgz", + "integrity": "sha512-JvONPptw3GAQGXlVV2utDcHx0BiY34FupW/kI6mZ5x06ER5DdPG/tXWMVHjTNULF5uKPOUUD0SaXg5QaubJL0A==" }, "vscode-languageclient": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-5.2.1.tgz", - "integrity": "sha512-7jrS/9WnV0ruqPamN1nE7qCxn0phkH5LjSgSp9h6qoJGoeAKzwKz/PF6M+iGA/aklx4GLZg1prddhEPQtuXI1Q==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-6.1.3.tgz", + "integrity": "sha512-YciJxk08iU5LmWu7j5dUt9/1OLjokKET6rME3cI4BRpiF6HZlusm2ZwPt0MYJ0lV5y43sZsQHhyon2xBg4ZJVA==", "requires": { - "semver": "^5.5.0", - "vscode-languageserver-protocol": "3.14.1" + "semver": "^6.3.0", + "vscode-languageserver-protocol": "^3.15.3" }, "dependencies": { "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" } } }, "vscode-languageserver-protocol": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz", - "integrity": "sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g==", + "version": "3.15.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.3.tgz", + "integrity": "sha512-zrMuwHOAQRhjDSnflWdJG+O2ztMWss8GqUUB8dXLR/FPenwkiBNkMIJJYfSN6sgskvsF0rHAoBowNQfbyZnnvw==", "requires": { - "vscode-jsonrpc": "^4.0.0", - "vscode-languageserver-types": "3.14.0" + "vscode-jsonrpc": "^5.0.1", + "vscode-languageserver-types": "3.15.1" } }, "vscode-languageserver-types": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz", - "integrity": "sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==" + "version": "3.15.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.15.1.tgz", + "integrity": "sha512-+a9MPUQrNGRrGU630OGbYVQ+11iOIovjCkqxajPa9w57Sd5ruK8WQNsslzpa0x/QJqC8kRc2DUxWjIFwoNm4ZQ==" }, "vscode-test": { "version": "1.3.0", diff --git a/package.json b/package.json index ae3581e83b..4ef930e51e 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "node-fetch": "^2.6.0", "semver": "^7.3.2", "vscode-extension-telemetry": "~0.1.6", - "vscode-languageclient": "~5.2.1" + "vscode-languageclient": "~6.1.3" }, "devDependencies": { "@types/glob": "^7.1.1", From 252a2c56935031b466ddfd6b7384abe4afb64b00 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Mon, 18 May 2020 18:34:12 +0100 Subject: [PATCH 157/166] Tweak whitespaceAroundPipe settings migration logic to do it only once (#2703) * Tweak whitespaceAroundPipe settings migration logic to do it only once * refactor Co-authored-by: Christoph Bergmeister --- src/session.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/session.ts b/src/session.ts index 792bf3a026..2a496daeea 100644 --- a/src/session.ts +++ b/src/session.ts @@ -324,10 +324,12 @@ export class SessionManager implements Middleware { private async migrateWhitespaceAroundPipeSetting() { const configuration = vscode.workspace.getConfiguration(utils.PowerShellLanguageId); const deprecatedSetting = 'codeFormatting.whitespaceAroundPipe' - if (configuration.has(deprecatedSetting) && !configuration.has('codeFormatting.addWhitespaceAroundPipe')) { + const newSetting = 'codeFormatting.addWhitespaceAroundPipe' + const configurationTargetOfNewSetting = await Settings.getEffectiveConfigurationTarget(newSetting); + if (configuration.has(deprecatedSetting) && configurationTargetOfNewSetting === null) { const configurationTarget = await Settings.getEffectiveConfigurationTarget(deprecatedSetting); const value = configuration.get(deprecatedSetting, configurationTarget) - await Settings.change('codeFormatting.addWhitespaceAroundPipe', value, configurationTarget); + await Settings.change(newSetting, value, configurationTarget); } } From 78bbb83d201d9892f36aae0291d6dd158d27c663 Mon Sep 17 00:00:00 2001 From: MartinGC94 <42123497+MartinGC94@users.noreply.github.com> Date: Tue, 19 May 2020 19:29:01 +0200 Subject: [PATCH 158/166] Add buttons for moving the terminal around. (#2704) * Add buttons for moving the terminal around. * Add button visibility options. * Simplified button visibility options. --- package.json | 56 +++++++++++++++++++++++++++-- resources/dark/ClosePanel.svg | 9 +++++ resources/dark/MovePanelBottom.svg | 10 ++++++ resources/dark/MovePanelLeft.svg | 10 ++++++ resources/light/ClosePanel.svg | 9 +++++ resources/light/MovePanelBottom.svg | 10 ++++++ resources/light/MovePanelLeft.svg | 10 ++++++ src/features/ISECompatibility.ts | 1 + src/settings.ts | 13 +++++++ 9 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 resources/dark/ClosePanel.svg create mode 100644 resources/dark/MovePanelBottom.svg create mode 100644 resources/dark/MovePanelLeft.svg create mode 100644 resources/light/ClosePanel.svg create mode 100644 resources/light/MovePanelBottom.svg create mode 100644 resources/light/MovePanelLeft.svg diff --git a/package.json b/package.json index 4ef930e51e..43d7f069e4 100644 --- a/package.json +++ b/package.json @@ -265,6 +265,33 @@ "command": "PowerShell.InvokeRegisteredEditorCommand", "title": "Invoke Registered Editor Command", "category": "PowerShell" + }, + { + "command": "workbench.action.closePanel", + "title": "Close panel", + "category": "PowerShell", + "icon": { + "light": "resources/light/ClosePanel.svg", + "dark": "resources/dark/ClosePanel.svg" + } + }, + { + "command": "workbench.action.positionPanelLeft", + "title": "Move panel left", + "category": "PowerShell", + "icon": { + "light": "resources/light/MovePanelLeft.svg", + "dark": "resources/dark/MovePanelLeft.svg" + } + }, + { + "command": "workbench.action.positionPanelBottom", + "title": "Move panel to bottom", + "category": "PowerShell", + "icon": { + "light": "resources/light/MovePanelBottom.svg", + "dark": "resources/dark/MovePanelBottom.svg" + } } ], "menus": { @@ -306,12 +333,27 @@ ], "editor/title": [ { - "when": "editorLangId == powershell", + "when": "editorLangId == powershell && config.powershell.buttons.showPanelMovementButtons", + "command": "workbench.action.positionPanelBottom", + "group": "navigation@97" + }, + { + "when": "editorLangId == powershell && config.powershell.buttons.showPanelMovementButtons", + "command": "workbench.action.positionPanelLeft", + "group": "navigation@98" + }, + { + "when": "editorLangId == powershell && config.powershell.buttons.showPanelMovementButtons", + "command": "workbench.action.closePanel", + "group": "navigation@99" + }, + { + "when": "editorLangId == powershell && config.powershell.buttons.showRunButtons", "command": "workbench.action.debug.start", "group": "navigation@100" }, { - "when": "editorLangId == powershell", + "when": "editorLangId == powershell && config.powershell.buttons.showRunButtons", "command": "PowerShell.RunSelection", "group": "navigation@101" } @@ -800,6 +842,16 @@ ], "default": "Diagnostic", "description": "Defines the verbosity of output to be used when debugging a test or a block. For Pester 5 and newer the default value Diagnostic will print additional information about discovery, skipped and filtered tests, mocking and more." + }, + "powershell.buttons.showRunButtons": { + "type": "boolean", + "default": true, + "description": "Show the Run and Run Selection buttons in the editor titlebar." + }, + "powershell.buttons.showPanelMovementButtons": { + "type": "boolean", + "default": false, + "description": "Show buttons in the editor titlebar for moving the panel around." } } }, diff --git a/resources/dark/ClosePanel.svg b/resources/dark/ClosePanel.svg new file mode 100644 index 0000000000..2feafe7c06 --- /dev/null +++ b/resources/dark/ClosePanel.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/resources/dark/MovePanelBottom.svg b/resources/dark/MovePanelBottom.svg new file mode 100644 index 0000000000..8284a0976d --- /dev/null +++ b/resources/dark/MovePanelBottom.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/resources/dark/MovePanelLeft.svg b/resources/dark/MovePanelLeft.svg new file mode 100644 index 0000000000..d7f7797e4c --- /dev/null +++ b/resources/dark/MovePanelLeft.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/resources/light/ClosePanel.svg b/resources/light/ClosePanel.svg new file mode 100644 index 0000000000..5db309662e --- /dev/null +++ b/resources/light/ClosePanel.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/resources/light/MovePanelBottom.svg b/resources/light/MovePanelBottom.svg new file mode 100644 index 0000000000..739c933e30 --- /dev/null +++ b/resources/light/MovePanelBottom.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/resources/light/MovePanelLeft.svg b/resources/light/MovePanelLeft.svg new file mode 100644 index 0000000000..06c569437b --- /dev/null +++ b/resources/light/MovePanelLeft.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/features/ISECompatibility.ts b/src/features/ISECompatibility.ts index 6bdf3f1edf..4e8d8d07dc 100644 --- a/src/features/ISECompatibility.ts +++ b/src/features/ISECompatibility.ts @@ -24,6 +24,7 @@ export class ISECompatibilityFeature implements IFeature { { path: "powershell.integratedConsole", name: "focusConsoleOnExecute", value: false }, { path: "files", name: "defaultLanguage", value: "powershell" }, { path: "workbench", name: "colorTheme", value: "PowerShell ISE" }, + { path: "powershell.buttons", name: "showPanelMovementButtons", value: true } ]; private iseCommandRegistration: vscode.Disposable; private defaultCommandRegistration: vscode.Disposable; diff --git a/src/settings.ts b/src/settings.ts index 00c98f326f..defbdd9e7a 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -100,6 +100,7 @@ export interface ISettings { bugReporting?: IBugReportingSettings; sideBar?: ISideBarSettings; pester?: IPesterSettings; + buttons?: IButtonSettings; } export interface IStartAsLoginShellSettings { @@ -125,6 +126,11 @@ export interface IPesterSettings { debugOutputVerbosity?: string; } +export interface IButtonSettings { + showRunButtons?: boolean; + showPanelMovementButtons?: boolean; +} + export function load(): ISettings { const configuration: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration( @@ -192,6 +198,11 @@ export function load(): ISettings { CommandExplorerVisibility: true, }; + const defaultButtonSettings: IButtonSettings = { + showRunButtons: true, + showPanelMovementButtons: false + }; + const defaultPesterSettings: IPesterSettings = { useLegacyCodeLens: true, outputVerbosity: "FromPreference", @@ -237,6 +248,8 @@ export function load(): ISettings { configuration.get("sideBar", defaultSideBarSettings), pester: configuration.get("pester", defaultPesterSettings), + buttons: + configuration.get("buttons", defaultButtonSettings), startAsLoginShell: // tslint:disable-next-line // We follow the same convention as VS Code - https://github.com/microsoft/vscode/blob/ff00badd955d6cfcb8eab5f25f3edc86b762f49f/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts#L105-L107 From 3d7befa729086fdd66da771936a68183080c4f16 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 19 May 2020 13:27:32 -0700 Subject: [PATCH 159/166] Bump @types/sinon from 9.0.0 to 9.0.1 (#2709) Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 9.0.0 to 9.0.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index dfa7fb50dd..67c1c81bfd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -153,9 +153,9 @@ } }, "@types/sinon": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-9.0.0.tgz", - "integrity": "sha512-v2TkYHkts4VXshMkcmot/H+ERZ2SevKa10saGaJPGCJ8vh3lKrC4u663zYEeRZxep+VbG6YRDtQ6gVqw9dYzPA==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-9.0.1.tgz", + "integrity": "sha512-vqWk3K1HYJExooYgORUdiGX1EdCWQxPi7P/OEIetdaJn4jNvEYoRRGLG/HwomtbzZ4IP9Syz2k4N50CItv6w6g==", "dev": true, "requires": { "@types/sinonjs__fake-timers": "*" diff --git a/package.json b/package.json index 43d7f069e4..d49c25d988 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@types/node-fetch": "~2.5.7", "@types/rewire": "~2.5.28", "@types/semver": "~7.1.0", - "@types/sinon": "~9.0.0", + "@types/sinon": "~9.0.1", "@types/vscode": "1.43.0", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.3", From d654b657ff6bcf885575fb0eb9a84b7600a874c3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 19 May 2020 13:28:04 -0700 Subject: [PATCH 160/166] Bump typescript from 3.8.3 to 3.9.2 (#2711) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.8.3 to 3.9.2. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v3.8.3...v3.9.2) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 67c1c81bfd..7cad46613e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2050,9 +2050,9 @@ } }, "typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.2.tgz", + "integrity": "sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==", "dev": true }, "uc.micro": { diff --git a/package.json b/package.json index d49c25d988..7a9dd44eb3 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "rewire": "~5.0.0", "sinon": "~9.0.2", "tslint": "~6.1.2", - "typescript": "~3.8.3", + "typescript": "~3.9.2", "vsce": "~1.75.0", "vscode-test": "~1.3.0" }, From e529f19342a18a627181f6d9e47a2b99ea2fc65c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 19 May 2020 14:26:56 -0700 Subject: [PATCH 161/166] Bump @types/semver from 7.1.0 to 7.2.0 (#2710) Bumps [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) from 7.1.0 to 7.2.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7cad46613e..9cbfa2cf17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -144,9 +144,9 @@ "dev": true }, "@types/semver": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.1.0.tgz", - "integrity": "sha512-pOKLaubrAEMUItGNpgwl0HMFPrSAFic8oSVIvfu1UwcgGNmNyK9gyhBHKmBnUTwwVvpZfkzUC0GaMgnL6P86uA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.2.0.tgz", + "integrity": "sha512-TbB0A8ACUWZt3Y6bQPstW9QNbhNeebdgLX4T/ZfkrswAfUzRiXrgd9seol+X379Wa589Pu4UEx9Uok0D4RjRCQ==", "dev": true, "requires": { "@types/node": "*" diff --git a/package.json b/package.json index 7a9dd44eb3..b02634fd7d 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "@types/node": "~12.12.39", "@types/node-fetch": "~2.5.7", "@types/rewire": "~2.5.28", - "@types/semver": "~7.1.0", + "@types/semver": "~7.2.0", "@types/sinon": "~9.0.1", "@types/vscode": "1.43.0", "mocha": "~5.2.0", From bf189e5c83af6a88b8545ff580b9b7bfb8bf0564 Mon Sep 17 00:00:00 2001 From: MJECloud <22131101+MJECloud@users.noreply.github.com> Date: Tue, 19 May 2020 23:30:41 +0200 Subject: [PATCH 162/166] Add coloring for $ and wordSepartors (#2702) * Set colour for variables dollar * include $ when double click a variable --- src/features/ISECompatibility.ts | 1 + themes/theme-psise/theme.json | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/features/ISECompatibility.ts b/src/features/ISECompatibility.ts index 4e8d8d07dc..28767ac0b9 100644 --- a/src/features/ISECompatibility.ts +++ b/src/features/ISECompatibility.ts @@ -24,6 +24,7 @@ export class ISECompatibilityFeature implements IFeature { { path: "powershell.integratedConsole", name: "focusConsoleOnExecute", value: false }, { path: "files", name: "defaultLanguage", value: "powershell" }, { path: "workbench", name: "colorTheme", value: "PowerShell ISE" }, + { path: "editor", name: "wordSeparators", value: "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?" }, { path: "powershell.buttons", name: "showPanelMovementButtons", value: true } ]; private iseCommandRegistration: vscode.Disposable; diff --git a/themes/theme-psise/theme.json b/themes/theme-psise/theme.json index a4b39d9f48..9f78182bf5 100644 --- a/themes/theme-psise/theme.json +++ b/themes/theme-psise/theme.json @@ -93,7 +93,9 @@ "name": "Variables", "scope": [ "variable", - "support.variable" + "support.variable", + "punctuation.definition.variable.powershell", + "variable.other.readwrite.powershell" ], "settings": { "foreground": "#FF4500" From 55ebbafeb8939cbea7ff9a8ea175c79181b1187b Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 21 May 2020 16:47:54 -0700 Subject: [PATCH 163/166] Move to lowercase now that we use Omnisharp's serializer (#2705) --- src/session.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/session.ts b/src/session.ts index 2a496daeea..f391eb75cd 100644 --- a/src/session.ts +++ b/src/session.ts @@ -294,15 +294,15 @@ export class SessionManager implements Middleware { codeLensToFix.command.arguments = [ vscode.Uri.parse(oldArgs[0]), - new vscode.Position(oldArgs[1].Line, oldArgs[1].Character), + new vscode.Position(oldArgs[1].line, oldArgs[1].character), oldArgs[2].map((position) => { return new vscode.Location( - vscode.Uri.parse(position.Uri), + vscode.Uri.parse(position.uri), new vscode.Range( - position.Range.Start.Line, - position.Range.Start.Character, - position.Range.End.Line, - position.Range.End.Character)); + position.range.start.line, + position.range.start.character, + position.range.end.line, + position.range.end.character)); }), ]; } From c20f32c2cb919da8f7822cf7601124b091fef877 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 27 May 2020 17:33:33 -0700 Subject: [PATCH 164/166] Bump typescript from 3.9.2 to 3.9.3 (#2722) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.2 to 3.9.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v3.9.2...v3.9.3) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9cbfa2cf17..66bd4e8bd6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2050,9 +2050,9 @@ } }, "typescript": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.2.tgz", - "integrity": "sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==", + "version": "3.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.3.tgz", + "integrity": "sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==", "dev": true }, "uc.micro": { diff --git a/package.json b/package.json index b02634fd7d..730628d5b1 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "rewire": "~5.0.0", "sinon": "~9.0.2", "tslint": "~6.1.2", - "typescript": "~3.9.2", + "typescript": "~3.9.3", "vsce": "~1.75.0", "vscode-test": "~1.3.0" }, From be26db7510b3dcbbd6bddaec28945e73095d001b Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 27 May 2020 17:34:02 -0700 Subject: [PATCH 165/166] Bump @types/sinon from 9.0.1 to 9.0.4 (#2723) Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 9.0.1 to 9.0.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 66bd4e8bd6..92d9c7ae73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -153,9 +153,9 @@ } }, "@types/sinon": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-9.0.1.tgz", - "integrity": "sha512-vqWk3K1HYJExooYgORUdiGX1EdCWQxPi7P/OEIetdaJn4jNvEYoRRGLG/HwomtbzZ4IP9Syz2k4N50CItv6w6g==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-9.0.4.tgz", + "integrity": "sha512-sJmb32asJZY6Z2u09bl0G2wglSxDlROlAejCjsnor+LzBMz17gu8IU7vKC/vWDnv9zEq2wqADHVXFjf4eE8Gdw==", "dev": true, "requires": { "@types/sinonjs__fake-timers": "*" diff --git a/package.json b/package.json index 730628d5b1..722f4a44d1 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@types/node-fetch": "~2.5.7", "@types/rewire": "~2.5.28", "@types/semver": "~7.2.0", - "@types/sinon": "~9.0.1", + "@types/sinon": "~9.0.4", "@types/vscode": "1.43.0", "mocha": "~5.2.0", "mocha-junit-reporter": "~1.23.3", From a210bb4b47841f0ddb2515e85d99363fc6799b00 Mon Sep 17 00:00:00 2001 From: Justin Grote Date: Thu, 28 May 2020 10:04:23 -0700 Subject: [PATCH 166/166] Add new Pester 5 GA Output Types (#2726) New Pester 5 Output Types were added last-minute to GA. These should also be available in the extension. https://github.com/pester/Pester/blob/v5.0/README.md#actual-breaking-changes --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 722f4a44d1..87da48b6e0 100644 --- a/package.json +++ b/package.json @@ -826,8 +826,10 @@ "type": "string", "enum": [ "FromPreference", + "None", "Minimal", "Normal", + "Detailed", "Diagnostic" ], "default": "FromPreference", @@ -836,8 +838,10 @@ "powershell.pester.debugOutputVerbosity": { "type": "string", "enum": [ + "None", "Minimal", "Normal", + "Detailed", "Diagnostic" ], "default": "Diagnostic",