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" 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. - ---- - - 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. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..5acadf6e2c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +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. + - 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" 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", 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/.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/.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 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 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/ci-general.yml b/.vsts-ci/templates/ci-general.yml index d37ef417c5..c3b24a7397 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -1,10 +1,30 @@ 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') + - 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/.vsts-ci/templates/release-general.yml b/.vsts-ci/templates/release-general.yml new file mode 100644 index 0000000000..ebf8c3b53f --- /dev/null +++ b/.vsts-ci/templates/release-general.yml @@ -0,0 +1,143 @@ +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') + +- 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: single + artifactName: 'PowerShellEditorServices' + 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 + +- 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 + 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/CHANGELOG.md b/CHANGELOG.md index c3b5f9b22b..d8e4f1cb05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2166 +1,2655 @@ -# PowerShell Preview Extension Release History - -## 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 hang 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 hang 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-preview +### Wednesday, May 13, 2020 +#### [vscode-PowerShell](https://github.com/PowerShell/vscode-PowerShell) + +- ✨🐢 [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) - + 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/InvokePesterStub.ps1 b/InvokePesterStub.ps1 index 8b6f204cce..b1bcb75f61 100755 --- a/InvokePesterStub.ps1 +++ b/InvokePesterStub.ps1 @@ -47,36 +47,115 @@ 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 + 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 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. 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 } } -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: Use 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 + } + 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')) { - 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/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_ | 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!) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 5f064c5be5..0d0fb5f853 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 @@ -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): @@ -178,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. @@ -185,6 +182,30 @@ 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 + +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 @@ -240,7 +261,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 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. diff --git a/extension-dev.code-workspace b/extension-dev.code-workspace new file mode 100644 index 0000000000..edcd3d2b4e --- /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" + } +} diff --git a/package-lock.json b/package-lock.json index 7343638e42..92d9c7ae73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,22 @@ { "name": "powershell-preview", - "version": "2019.5.0", + "version": "2020.5.0", "lockfileVersion": 1, "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.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.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "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", @@ -32,79 +32,196 @@ } } }, + "@sinonjs/commons": { + "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.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" + } + }, + "@sinonjs/formatio": { + "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": "^5.0.2" + } + }, + "@sinonjs/samsam": { + "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", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } + }, + "@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/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", + "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", - "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", + "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": { + "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", - "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": { + "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": "*", + "form-data": "^3.0.0" + } + }, "@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 }, - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", - "dev": true + "@types/semver": { + "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": "*" + } }, - "acorn-jsx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "@types/sinon": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-9.0.4.tgz", + "integrity": "sha512-sJmb32asJZY6Z2u09bl0G2wglSxDlROlAejCjsnor+LzBMz17gu8IU7vKC/vWDnv9zEq2wqADHVXFjf4eE8Gdw==", "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 - } + "@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": { + "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": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "dev": true + }, + "acorn-jsx": { + "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", - "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" } }, "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", @@ -113,20 +230,41 @@ "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", - "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": { @@ -138,19 +276,10 @@ "sprintf-js": "~1.0.2" } }, - "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": { + "astral-regex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, "async-hook-jl": { @@ -168,6 +297,13 @@ "requires": { "semver": "^5.3.0", "shimmer": "^1.1.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } } }, "asynckit": { @@ -176,18 +312,6 @@ "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", @@ -200,68 +324,12 @@ "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", "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", @@ -290,37 +358,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=", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, "chalk": { @@ -346,9 +393,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": { @@ -371,19 +418,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": { @@ -400,14 +441,15 @@ "async-hook-jl": "^1.7.6", "emitter-listener": "^1.0.1", "semver": "^5.4.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } } }, - "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", @@ -444,18 +486,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", @@ -465,21 +495,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": { @@ -506,15 +540,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", @@ -548,18 +573,19 @@ "integrity": "sha1-zJmvlhLCP7H/8TYSxy8sv6qNWhc=", "requires": { "semver": "^5.3.0" + }, + "dependencies": { + "semver": { + "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==" - }, - "didyoumean": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.1.tgz", - "integrity": "sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=", - "dev": true + "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", @@ -568,9 +594,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" @@ -611,16 +637,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", @@ -629,6 +645,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", @@ -637,13 +659,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": { @@ -657,75 +679,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": "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": { @@ -735,9 +804,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" @@ -753,9 +822,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": { @@ -764,39 +833,27 @@ "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", - "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" } }, - "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", - "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": { @@ -815,50 +872,48 @@ } }, "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" } }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "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": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "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.6", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, @@ -874,15 +929,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", @@ -897,83 +943,30 @@ "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 - }, - "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 - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "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==", + "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": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - }, - "dependencies": { - "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", - "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 - } + "is-glob": "^4.0.1" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "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 - } + "type-fest": "^0.8.1" } }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -998,49 +991,25 @@ "entities": "^1.1.1", "inherits": "^2.0.1", "readable-stream": "^3.1.1" - }, - "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==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } } }, "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.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "version": "2.2.4", + "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.1.0", + "agent-base": "^4.3.0", "debug": "^3.1.0" } }, @@ -1054,11 +1023,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", @@ -1082,25 +1061,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": { @@ -1109,34 +1141,37 @@ "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 - }, - "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", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "isexe": { @@ -1145,18 +1180,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", - "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", @@ -1167,22 +1190,10 @@ "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", - "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": { @@ -1191,23 +1202,17 @@ "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=", + "just-extend": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.0.tgz", + "integrity": "sha512-ApcjaOdVTJ7y4r08xI5wIqpvwS48Q0PBG4DJROcEkH1f8MdAiNFyFxz3xoL0LWAVwjrwPYZdVHHxhRHcx/uGLA==", "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" - } + "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", @@ -1234,27 +1239,31 @@ "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", "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" - } + "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 }, "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": { @@ -1281,24 +1290,24 @@ "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==", + "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.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "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.40.0" + "mime-db": "1.44.0" } }, "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": { @@ -1345,9 +1354,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.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", @@ -1378,6 +1387,12 @@ "lodash": "^4.16.4" } }, + "mock-fs": { + "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": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -1385,9 +1400,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": { @@ -1396,6 +1411,30 @@ "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", + "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/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "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", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + }, "nth-check": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", @@ -1405,18 +1444,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", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1427,26 +1454,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": { @@ -1477,6 +1504,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", @@ -1484,6 +1520,14 @@ "dev": true, "requires": { "semver": "^5.1.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "parse5": { @@ -1501,10 +1545,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": { @@ -1513,72 +1557,39 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-to-regexp": { + "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" + } + }, "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "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", - "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=", - "dev": true - }, - "psl": { - "version": "1.1.33", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.33.tgz", - "integrity": "sha512-LTDP2uSrsc7XCb5lO7A8BI1qYxRe/8EqlRvMeEl6rsnYAqDOl8xHR+8lSAIVfrNaSAlTPTNOCgNjWcoUL3AZsw==", - "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", @@ -1589,102 +1600,54 @@ } }, "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==", + "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": { - "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" + "inherits": "^2.0.3", + "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==", - "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", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "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=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "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.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" } }, "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": { @@ -1713,33 +1676,27 @@ } }, "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": { - "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": { @@ -1749,9 +1706,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": "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", @@ -1779,29 +1736,70 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, - "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==", + "sinon": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.2.tgz", + "integrity": "sha512-0uF8Q/QHkizNUmbK3LRFqx5cpTttEVXudywY9Uwzy8bTfZUhljZ7ARzSxnRHWYWtVTeh4Cw+tTb3iU21FQVO9A==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.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", + "nise": "^4.0.1", + "supports-color": "^7.1.0" + }, + "dependencies": { + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "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": "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" + } + } } }, - "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.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==", + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "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": { @@ -1810,45 +1808,46 @@ "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", "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": { - "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": { @@ -1861,9 +1860,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": { @@ -1876,17 +1875,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": { @@ -1910,49 +1947,60 @@ "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", - "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": "5.18.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", - "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", + "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", "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", - "mkdirp": "^0.5.1", + "mkdirp": "^0.5.3", "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.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "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", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "tsutils": { @@ -1970,21 +2018,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", @@ -1994,6 +2027,18 @@ "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 + }, + "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", @@ -2004,16 +2049,10 @@ "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.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.2.tgz", - "integrity": "sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==", + "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": { @@ -2043,43 +2082,22 @@ "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==", + "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 }, - "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.65.0", - "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.65.0.tgz", - "integrity": "sha512-1bGyeoaxjhNVz9fVAqUzGWc1e5CxsxZFpVSnS/anRVyZju0y4DJCPi685WkBsRYU/lfp3AI1smpatuSfb2Lllg==", + "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", @@ -2087,10 +2105,10 @@ "cheerio": "^1.0.0-rc.1", "commander": "^2.8.1", "denodeify": "^1.2.1", - "didyoumean": "^1.2.1", "glob": "^7.0.6", - "lodash": "^4.17.10", - "markdown-it": "^8.3.1", + "leven": "^3.1.0", + "lodash": "^4.17.15", + "markdown-it": "^10.0.0", "mime": "^1.3.4", "minimatch": "^3.0.3", "osenv": "^0.1.3", @@ -2104,6 +2122,18 @@ "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", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "tmp": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz", @@ -2115,65 +2145,58 @@ } } }, - "vscode": { - "version": "1.1.35", - "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.35.tgz", - "integrity": "sha512-xPnxzQU40LOS2yPyzWW+WKpTV6qA3z16TcgpZ9O38UWLA157Zz4GxUx5H7Gd07pxzw0GqvusbF4D+5GBgNxvEQ==", - "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" - } - }, "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.6", + "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.6.tgz", + "integrity": "sha512-rbzSg7k4NnsCdF4Lz0gI4jl3JLXR0hnlmfFgsY8CSDYhXgdoIxcre8jw5rjkobY0xhSDhbG7xCjP8zxskySJ/g==", "requires": { - "applicationinsights": "1.4.0" + "applicationinsights": "1.7.4" } }, "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": "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": "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": { @@ -2185,10 +2208,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": { @@ -2198,9 +2221,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" @@ -2212,12 +2235,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 b2fca99db9..87da48b6e0 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "powershell-preview", "displayName": "PowerShell Preview", - "version": "2019.5.0", + "version": "2020.5.0", "preview": true, "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", "engines": { - "vscode": "^1.34.0" + "vscode": "^1.43.0" }, "license": "SEE LICENSE IN LICENSE.txt", "homepage": "https://github.com/PowerShell/vscode-powershell/blob/master/README.md", @@ -27,7 +27,8 @@ }, "main": "./out/src/main", "activationEvents": [ - "onDebugResolve:powershell", + "onDebugInitialConfigurations", + "onDebugResolve:PowerShell", "onLanguage:powershell", "onCommand:PowerShell.NewProjectFromTemplate", "onCommand:PowerShell.OpenExamplesFolder", @@ -37,24 +38,36 @@ "onCommand:PowerShell.ShowSessionConsole", "onCommand:PowerShell.ShowSessionMenu", "onCommand:PowerShell.RestartSession", + "onCommand:PowerShell.EnableISEMode", + "onCommand:PowerShell.DisableISEMode", "onView:PowerShellCommands" ], "dependencies": { - "vscode-extension-telemetry": "~0.1.2", - "vscode-languageclient": "~5.2.1" + "node-fetch": "^2.6.0", + "semver": "^7.3.2", + "vscode-extension-telemetry": "~0.1.6", + "vscode-languageclient": "~6.1.3" }, "devDependencies": { - "@types/mocha": "~5.2.7", - "@types/node": "~10.11.0", - "@types/rewire": "^2.5.28", + "@types/glob": "^7.1.1", + "@types/mocha": "~7.0.2", + "@types/mock-fs": "~4.10.0", + "@types/node": "~12.12.39", + "@types/node-fetch": "~2.5.7", + "@types/rewire": "~2.5.28", + "@types/semver": "~7.2.0", + "@types/sinon": "~9.0.4", + "@types/vscode": "1.43.0", "mocha": "~5.2.0", - "mocha-junit-reporter": "~1.23.0", + "mocha-junit-reporter": "~1.23.3", "mocha-multi-reporters": "~1.1.7", - "rewire": "~4.0.1", - "tslint": "~5.18.0", - "typescript": "~3.5.2", - "vsce": "~1.65.0", - "vscode": "~1.1.35" + "mock-fs": "~4.12.0", + "rewire": "~5.0.0", + "sinon": "~9.0.2", + "tslint": "~6.1.2", + "typescript": "~3.9.3", + "vsce": "~1.75.0", + "vscode-test": "~1.3.0" }, "extensionDependencies": [ "vscode.powershell" @@ -62,15 +75,19 @@ "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": [ + { + "language": "powershell" + } + ], "viewsContainers": { "activitybar": [ { "id": "PowerShellCommandExplorer", - "title": "PowerShell Command Explorer", + "title": "(Preview) PowerShell Command Explorer", "icon": "media/pwsh.svg" } ] @@ -119,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", @@ -151,10 +178,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", @@ -196,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", @@ -225,6 +260,38 @@ "command": "PowerShell.OpenExamplesFolder", "title": "Open Examples Folder", "category": "PowerShell" + }, + { + "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": { @@ -236,6 +303,20 @@ { "command": "PowerShell.RefreshCommandsExplorer", "when": "config.powershell.sideBar.CommandExplorerVisibility" + }, + { + "command": "PowerShell.InvokeRegisteredEditorCommand", + "when": "false" + } + ], + "explorer/context": [ + { + "command": "PowerShell.RunPesterTestsFromFile", + "when": "resourceFilename =~ /\\.tests\\.ps1$/i" + }, + { + "command": "PowerShell.DebugPesterTestsFromFile", + "when": "resourceFilename =~ /\\.tests\\.ps1$/i" } ], "editor/context": [ @@ -250,6 +331,33 @@ "group": "2_powershell" } ], + "editor/title": [ + { + "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 && config.powershell.buttons.showRunButtons", + "command": "PowerShell.RunSelection", + "group": "navigation@101" + } + ], "editor/title/context": [ { "when": "resourceFilename =~ /\\.tests\\.ps1$/i", @@ -294,9 +402,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 } ] } @@ -311,13 +419,6 @@ { "type": "PowerShell", "label": "PowerShell", - "enableBreakpointsFor": { - "languageIds": [ - "powershell" - ] - }, - "program": "./out/src/debugAdapter.js", - "runtime": "node", "variables": { "PickPSHostProcess": "PowerShell.PickPSHostProcess", "PickRunspace": "PowerShell.PickRunspace", @@ -329,70 +430,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 +470,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 +490,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 +540,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": { @@ -542,12 +557,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.", @@ -573,7 +582,33 @@ }, "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", + "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, + "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", @@ -612,7 +647,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": { @@ -625,6 +660,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": [ @@ -656,10 +696,11 @@ "enum": [ "IncreaseIndentationForFirstPipeline", "IncreaseIndentationAfterEveryPipeline", - "NoIndentation" + "NoIndentation", + "None" ], "default": "NoIndentation", - "description": "Multi-line pipeline style settings." + "description": "Multi-line pipeline style settings (default: NoIndentation)." }, "powershell.codeFormatting.whitespaceBeforeOpenBrace": { "type": "boolean", @@ -686,10 +727,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", @@ -716,6 +767,20 @@ "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.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.integratedConsole.suppressStartupBanner": { + "type": "boolean", + "default": false, + "description": "Do not show the Powershell Integrated Console banner on launch" + }, "powershell.debugging.createTemporaryIntegratedConsole": { "type": "boolean", "default": false, @@ -747,10 +812,50 @@ "default": null, "description": "An array of strings that enable experimental features in the PowerShell extension." }, - "powershell.developer.powerShellExeIsWindowsDevBuild": { + "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, + "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", + "enum": [ + "FromPreference", + "None", + "Minimal", + "Normal", + "Detailed", + "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": [ + "None", + "Minimal", + "Normal", + "Detailed", + "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." + }, + "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": "Indicates that the powerShellExePath points to a developer build of Windows PowerShell and configures it for development." + "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/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/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/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 @@ + + + diff --git a/scripts/Install-VSCode.ps1 b/scripts/Install-VSCode.ps1 index 8dd3ab88ca..cacb817cb8 100644 --- a/scripts/Install-VSCode.ps1 +++ b/scripts/Install-VSCode.ps1 @@ -1,6 +1,6 @@ <#PSScriptInfo -.VERSION 1.3 +.VERSION 1.4.1 .GUID 539e5585-7a02-4dd6-b9a6-5dd288d0a5d0 @@ -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 @@ -25,6 +25,10 @@ .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. -- 15/08/2018 - added functionality to install the new "User Install" variant of Insiders Edition. @@ -53,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. @@ -128,12 +132,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 +170,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 +203,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 +230,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 +327,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 +347,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 +407,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 +436,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 +458,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 6)) { + throw 'User builds are not available for non-Windows systems' } try { @@ -506,7 +530,7 @@ try { } switch ($BuildEdition) { - 'Stable' { + 'Stable-System' { & $pacMan install -y code } @@ -550,7 +574,7 @@ try { break } - Install-VSCodeFromTar -TarPath $installerPath -Insiders:($BuildEdition -ne 'Stable') + Install-VSCodeFromTar -TarPath $installerPath -Insiders:($BuildEdition -ne 'Stable-System') break } diff --git a/src/debugAdapter.ts b/src/debugAdapter.ts index 5fca22b01a..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); - - // Delete the session file after it has been read so that - // it isn't used mistakenly by another debug session - utils.deleteSessionFile(debugSessionFilePath); - - // 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/Console.ts b/src/features/Console.ts index cedeb37769..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); } @@ -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"); diff --git a/src/features/DebugSession.ts b/src/features/DebugSession.ts index 64826ca90e..b82596ae4c 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"; @@ -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() { @@ -42,6 +61,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, @@ -62,7 +164,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(); @@ -109,7 +216,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 = @@ -139,6 +246,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. @@ -161,13 +274,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; } @@ -181,14 +294,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 @@ -199,7 +304,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider const sessionFilePath = utils.getDebugSessionFilePath(); - if (createNewIntegratedConsole) { + if (config.createTemporaryIntegratedConsole) { if (this.tempDebugProcess) { this.tempDebugProcess.dispose(); } @@ -209,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()); } @@ -487,7 +590,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/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/features/GenerateBugReport.ts b/src/features/GenerateBugReport.ts index d66487bc35..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", () => { @@ -43,7 +41,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 @@ -113,7 +111,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/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/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/features/ISECompatibility.ts b/src/features/ISECompatibility.ts new file mode 100644 index 0000000000..28767ac0b9 --- /dev/null +++ b/src/features/ISECompatibility.ts @@ -0,0 +1,72 @@ +/*--------------------------------------------------------- + * 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" }, + { path: "editor", name: "wordSeparators", value: "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?" }, + { path: "powershell.buttons", name: "showPanelMovementButtons", value: true } + ]; + 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/features/PesterTests.ts b/src/features/PesterTests.ts index ea2c5fea9f..24ddf5759f 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); @@ -109,6 +109,17 @@ export class PesterTestsFeature implements IFeature { launchConfig.args.push("-TestName", `'${testName}'`); } + if (!settings.pester.useLegacyCodeLens) { + launchConfig.args.push("-MinimumVersion5"); + } + + 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/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/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/features/UpdatePowerShell.ts b/src/features/UpdatePowerShell.ts new file mode 100644 index 0000000000..f5c5e81620 --- /dev/null +++ b/src/features/UpdatePowerShell.ts @@ -0,0 +1,192 @@ +/*--------------------------------------------------------- + * 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 * 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 = + "https://api.github.com/repos/PowerShell/PowerShell/releases"; + +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. + const response = await fetch( + preview ? PowerShellGitHubPrereleasesUrl : PowerShellGitHubReleasesUrl, + requestConfig); + + if (!response.ok) { + const json = await response.json(); + throw new Error(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); + } + + 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( + sessionManager: SessionManager, + 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 result = await window.showInformationMessage( + `${commonText} Would you like to update the version? ${ + 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. + if (!result) { return; } + + // Yes choice. + switch (result.id) { + // Yes choice. + case 0: + if (isWindows) { + const msiMatcher = arch === "x86" ? + "win-x86.msi" : "win-x64.msi"; + + const asset = release.assets.filter((a: any) => a.name.indexOf(msiMatcher) >= 0)[0]; + const msiDownloadPath = path.join(os.tmpdir(), asset.name); + + 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(); + + // 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]); + + 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, + }); + } + + break; + + // Never choice. + case 2: + await Settings.change("promptToUpdatePowerShell", false, true); + break; + default: + break; + } +} diff --git a/src/logging.ts b/src/logging.ts index 62d26a56a4..50d2b8d74a 100644 --- a/src/logging.ts +++ b/src/logging.ts @@ -114,6 +114,29 @@ export class Logger implements ILogger { }); } + public async writeAndShowErrorWithActions( + message: string, + actions: { 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/main.ts b/src/main.ts index dd6148df42..a51407300e 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"; @@ -24,12 +23,12 @@ 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"; 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"; @@ -41,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"; @@ -133,9 +128,9 @@ export function activate(context: vscode.ExtensionContext): void { sessionManager = new SessionManager( - requiredEditorServicesVersion, logger, documentSelector, + PackageJSON.displayName, PackageJSON.version, telemetryReporter); @@ -147,17 +142,16 @@ 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), new RunCodeFeature(sessionManager), new ExtensionCommandsFeature(logger), - new SelectPSSARulesFeature(logger), new CodeActionsFeature(logger), new NewFileOrProjectFeature(), - new DocumentFormatterFeature(logger, documentSelector), new RemoteFilesFeature(), - new DebugSessionFeature(context, sessionManager), + new DebugSessionFeature(context, sessionManager, logger), new PickPSHostProcessFeature(), new SpecifyScriptArgsFeature(context), new HelpCompletionFeature(logger), diff --git a/src/platform.ts b/src/platform.ts index 2cede17892..e2c4244694 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,439 @@ 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 altWinPS = this.findWinPS({ useAlternateBitness: true }); + + if (!altWinPS) { + return configuredPowerShellPath; + } + + const lowerAltWinPSPath = altWinPS.exePath.toLocaleLowerCase(); + const lowerConfiguredPath = configuredPowerShellPath.toLocaleLowerCase(); + + if (lowerConfiguredPath === lowerAltWinPSPath) { + return this.findWinPS().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; + } + + // Look for the .NET global tool + // 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(); + + 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); + } + } + + // 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); } - 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); + // 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; + } + + 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; } - return paths; + public exists(): boolean { + if (this.knownToExist === undefined) { + this.knownToExist = fs.existsSync(this.exePath); + } + return this.knownToExist; + } } diff --git a/src/process.ts b/src/process.ts index ec1b73b1b0..80b849ef48 100644 --- a/src/process.ts +++ b/src/process.ts @@ -17,139 +17,124 @@ 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(); 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 startScriptPath = - path.resolve( - __dirname, - this.bundledModulesPath, - "PowerShellEditorServices/Start-EditorServices.ps1"); - - 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})`; - - const powerShellArgs = [ - "-NoProfile", - "-NonInteractive", - ]; - - // Only add ExecutionPolicy param on Windows - if (utils.isWindowsOS()) { - powerShellArgs.push("-ExecutionPolicy", "Bypass"); - } - - const startEditorServices = "& '" + - PowerShellProcess.escapeSingleQuotes(startScriptPath) + - "' " + this.startArgs; - - if (utils.isWindowsOS()) { - powerShellArgs.push( - "-Command", - startEditorServices); - } else { - // Use -EncodedCommand for better quote support on non-Windows - powerShellArgs.push( - "-EncodedCommand", - 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: " + startScriptPath + " " + this.startArgs); - - // Make sure no old session file exists - utils.deleteSessionFile(this.sessionFilePath); - - // Launch PowerShell in the integrated terminal - this.consoleTerminal = - vscode.window.createTerminal( - this.title, - powerShellExePath, - powerShellArgs); - - if (this.sessionSettings.integratedConsole.showOnStartup) { - 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, }); + + 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 + this.log.write("Registering terminal PID log callback"); + this.consoleTerminal.processId.then((pid) => this.logTerminalPid(pid, pwshName)); + + return sessionDetails; } public showConsole(preserveFocus: boolean) { @@ -174,4 +159,63 @@ export class PowerShellProcess { this.consoleTerminal = undefined; } } + + 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 + // 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; + } + + private sleep(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + 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"); + 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) { + if (terminal !== this.consoleTerminal) { + return; + } + + this.log.write("powershell.exe terminated or terminal UI was closed"); + this.onExitedEmitter.fire(); + } } diff --git a/src/session.ts b/src/session.ts index a5eb85ace0..f391eb75cd 100644 --- a/src/session.ts +++ b/src/session.ts @@ -2,13 +2,10 @@ * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ -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"; @@ -19,13 +16,14 @@ 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 { - fixWindowsPowerShellPath, getAvailablePowerShellExes, getDefaultPowerShellPath, - getPlatformDetails, IPlatformDetails, OperatingSystem } from "./platform"; + getPlatformDetails, IPlatformDetails, IPowerShellExeDetails, + OperatingSystem, PowerShellExeFinder } from "./platform"; export enum SessionStatus { NeverStarted, @@ -37,11 +35,11 @@ export enum SessionStatus { } export class SessionManager implements Middleware { + public HostName: string; 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; @@ -56,7 +54,9 @@ 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; // When in development mode, VS Code's session ID is a fake // value of "someValue.machineId". Use that to detect dev @@ -65,22 +65,23 @@ export class SessionManager implements Middleware { vscode.env.sessionId === "someValue.sessionId"; constructor( - private requiredEditorServicesVersion: string, private log: Logger, private documentSelector: DocumentSelector, - 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"; 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. @@ -103,57 +104,109 @@ 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); + // 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(); + this.promptPowerShellExeSettingsCleanup(); - this.suppressRestartPrompt = false; + this.migrateWhitespaceAroundPipeSetting(); + + try { + let powerShellExeDetails; + if (this.sessionSettings.powerShellDefaultVersion) { + for (const details of this.powershellExeFinder.enumeratePowerShellInstallations()) { + // 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; + } + } + } - if (this.powerShellExePath) { + this.PowerShellExeDetails = powerShellExeDetails || + this.powershellExeFinder.getFirstAvailablePowerShellInstallation(); - this.bundledModulesPath = path.resolve(__dirname, this.sessionSettings.bundledModulesPath); + } catch (e) { + this.log.writeError(`Error occurred while searching for a PowerShell executable:\n${e}`); + } - if (this.inDevelopmentMode) { - const devBundledModulesPath = - path.resolve( - __dirname, - this.sessionSettings.developer.bundledModulesPath); + this.suppressRestartPrompt = false; - // 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`); - } - } + if (!this.PowerShellExeDetails) { + 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.editorServicesArgs = - `-HostName 'Visual Studio Code Host' ` + - `-HostProfileId 'Microsoft.VSCode' ` + - `-HostVersion '${this.HostVersion}' ` + - `-AdditionalModules @('PowerShellEditorServices.VSCode') ` + - `-BundledModulesPath '${PowerShellProcess.escapeSingleQuotes(this.bundledModulesPath)}' ` + - `-EnableConsoleRepl `; + this.bundledModulesPath = path.resolve(__dirname, this.sessionSettings.bundledModulesPath); - if (this.sessionSettings.developer.editorServicesWaitForDebugger) { - this.editorServicesArgs += "-WaitForDebugger "; - } - if (this.sessionSettings.developer.editorServicesLogLevel) { - this.editorServicesArgs += `-LogLevel '${this.sessionSettings.developer.editorServicesLogLevel}' `; + 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`); } + } + + this.editorServicesArgs = + `-HostName 'Visual Studio Code Host' ` + + `-HostProfileId 'Microsoft.VSCode' ` + + `-HostVersion '${this.HostVersion}' ` + + `-AdditionalModules @('PowerShellEditorServices.VSCode') ` + + `-BundledModulesPath '${PowerShellProcess.escapeSingleQuotes(this.bundledModulesPath)}' ` + + `-EnableConsoleRepl `; - this.startPowerShell(); + if (this.sessionSettings.integratedConsole.suppressStartupBanner) { + this.editorServicesArgs += "-StartupBanner '' "; } else { - this.setSessionFailure("PowerShell could not be started, click 'Show Logs' for more details."); + const startupBanner = `=====> ${this.HostName} Integrated Console v${this.HostVersion} <===== +`; + this.editorServicesArgs += `-StartupBanner "${startupBanner}" `; + } + + if (this.sessionSettings.developer.editorServicesWaitForDebugger) { + this.editorServicesArgs += "-WaitForDebugger "; + } + if (this.sessionSettings.developer.editorServicesLogLevel) { + this.editorServicesArgs += `-LogLevel '${this.sessionSettings.developer.editorServicesLogLevel}' `; } + + this.startPowerShell(); } public stop() { @@ -187,6 +240,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; } @@ -205,7 +263,7 @@ export class SessionManager implements Middleware { this.debugSessionProcess = new PowerShellProcess( - this.powerShellExePath, + this.PowerShellExeDetails.exePath, this.bundledModulesPath, "[TEMP] PowerShell Integrated Console", this.log, @@ -216,123 +274,6 @@ export class SessionManager implements Middleware { return this.debugSessionProcess; } - 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; - }); - } - }); - } - - // 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(); - - // 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 (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; - } - } - - return powerShellExePath.length > 0 - ? this.resolvePowerShellPath(powerShellExePath) - : getDefaultPowerShellPath(this.platformDetails, this.sessionSettings.useX86Host); - } - // ----- LanguageClient middleware methods ----- public resolveCodeLens( @@ -378,6 +319,48 @@ 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' + 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(newSetting, value, configurationTarget); + } + } + + 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."; + + const choice = await vscode.window.showWarningMessage(warningMessage, "Let's do it!"); + + if (choice === undefined) { + // They hit the 'x' to close the dialog. + return; + } + + this.suppressRestartPrompt = true; + try { + await Settings.change("powerShellExePath", undefined, true); + } finally { + this.suppressRestartPrompt = false; + } + + // Show the session menu at the end if they don't have a PowerShellDefaultVersion. + if (!this.sessionSettings.powerShellDefaultVersion) { + await vscode.commands.executeCommand(this.ShowSessionMenuCommandName); + } + } + } + private onConfigurationUpdated() { const settings = Settings.load(); @@ -385,15 +368,16 @@ 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() !== - 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?", @@ -446,7 +430,7 @@ export class SessionManager implements Middleware { this.languageServerProcess = new PowerShellProcess( - this.powerShellExePath, + this.PowerShellExeDetails.exePath, this.bundledModulesPath, "PowerShell Integrated Console", this.log, @@ -494,7 +478,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() { @@ -527,7 +515,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: { @@ -558,7 +547,7 @@ export class SessionManager implements Middleware { this.languageServerClient .sendRequest(PowerShellVersionRequestType) .then( - (versionDetails) => { + async (versionDetails) => { this.versionDetails = versionDetails; if (!this.inDevelopmentMode) { @@ -571,6 +560,32 @@ 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, + this.languageServerClient, + localVersion, + this.versionDetails.architecture, + release); + } catch (e) { + // best effort. This probably failed to fetch the data from GitHub. + this.log.writeWarning(e.message); + } }); // Send the new LanguageClient to extension features @@ -597,11 +612,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 @@ -651,51 +661,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)) { - this.setSessionFailure( - "powershell.exe cannot be found or is not accessible at path " + resolvedPath); - - return null; - } + await Settings.change("powerShellDefaultVersion", exePath.displayName, true); - 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) { @@ -705,9 +679,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; @@ -719,11 +691,11 @@ 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 ? - currentPowerShellExe.versionName : + currentPowerShellExe.displayName : `PowerShell ${this.versionDetails.displayVersion} ` + `(${this.versionDetails.architecture}) ${this.versionDetails.edition} Edition ` + `[${this.versionDetails.version}]`; @@ -741,11 +713,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.versionName}`, - () => { this.changePowerShellExePath(item.exePath); }); + `Switch to: ${item.displayName}`, + () => { this.changePowerShellDefaultVersion(item); }); }); const menuItems: SessionMenuItem[] = [ @@ -753,16 +725,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 c537b3a98d..defbdd9e7a 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -18,6 +18,7 @@ enum PipelineIndentationStyle { IncreaseIndentationForFirstPipeline, IncreaseIndentationAfterEveryPipeline, NoIndentation, + None, } export enum HelpCompletion { @@ -41,6 +42,7 @@ export interface ICodeFoldingSettings { } export interface ICodeFormattingSettings { + autoCorrectAliases: boolean; preset: CodeFormattingPreset; openBraceOnSameLine: boolean; newLineAfterOpenBrace: boolean; @@ -50,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; @@ -68,18 +72,21 @@ export interface IDebuggingSettings { export interface IDeveloperSettings { featureFlags?: string[]; - powerShellExePath?: string; bundledModulesPath?: string; editorServicesLogLevel?: string; editorServicesWaitForDebugger?: boolean; - powerShellExeIsWindowsDevBuild?: boolean; + waitForSessionFileTimeoutSeconds?: number; } 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; + promptToUpdatePackageManagement?: boolean; bundledModulesPath?: string; + startAsLoginShell?: IStartAsLoginShellSettings; startAutomatically?: boolean; useX86Host?: boolean; enableProfileLoading?: boolean; @@ -91,11 +98,37 @@ export interface ISettings { codeFormatting?: ICodeFormattingSettings; integratedConsole?: IIntegratedConsoleSettings; bugReporting?: IBugReportingSettings; + sideBar?: ISideBarSettings; + pester?: IPesterSettings; + buttons?: IButtonSettings; +} + +export interface IStartAsLoginShellSettings { + osx?: boolean; + linux?: boolean; } export interface IIntegratedConsoleSettings { showOnStartup?: boolean; focusConsoleOnExecute?: boolean; + useLegacyReadLine?: boolean; + forceClearScrollbackBuffer?: boolean; + suppressStartupBanner?: boolean; +} + +export interface ISideBarSettings { + CommandExplorerVisibility?: boolean; +} + +export interface IPesterSettings { + useLegacyCodeLens?: boolean; + outputVerbosity?: string; + debugOutputVerbosity?: string; +} + +export interface IButtonSettings { + showRunButtons?: boolean; + showPanelMovementButtons?: boolean; } export function load(): ISettings { @@ -109,26 +142,19 @@ export function load(): ISettings { const defaultScriptAnalysisSettings: IScriptAnalysisSettings = { enable: true, - settingsPath: "", + settingsPath: "PSScriptAnalyzerSettings.psd1", }; const defaultDebuggingSettings: IDebuggingSettings = { createTemporaryIntegratedConsole: false, }; - // TODO: Remove when PSReadLine is out of preview - const featureFlags = []; - if (utils.isWindowsOS()) { - featureFlags.push("PSReadLine"); - } - const defaultDeveloperSettings: IDeveloperSettings = { - featureFlags, - powerShellExePath: undefined, + featureFlags: [], bundledModulesPath: "../../../PowerShellEditorServices/module", editorServicesLogLevel: "Normal", editorServicesWaitForDebugger: false, - powerShellExeIsWindowsDevBuild: false, + waitForSessionFileTimeoutSeconds: 240, }; const defaultCodeFoldingSettings: ICodeFoldingSettings = { @@ -137,6 +163,7 @@ export function load(): ISettings { }; const defaultCodeFormattingSettings: ICodeFormattingSettings = { + autoCorrectAliases: false, preset: CodeFormattingPreset.Custom, openBraceOnSameLine: true, newLineAfterOpenBrace: true, @@ -146,16 +173,40 @@ export function load(): ISettings { whitespaceBeforeOpenParen: true, whitespaceAroundOperator: true, whitespaceAfterSeparator: true, + whitespaceBetweenParameters: false, whitespaceInsideBrace: true, - whitespaceAroundPipe: true, + addWhitespaceAroundPipe: true, + trimWhitespaceAroundPipe: false, ignoreOneLineBlock: true, alignPropertyValuePairs: true, useCorrectCasing: false, }; + const defaultStartAsLoginShellSettings: IStartAsLoginShellSettings = { + osx: true, + linux: false, + }; + const defaultIntegratedConsoleSettings: IIntegratedConsoleSettings = { showOnStartup: true, focusConsoleOnExecute: true, + useLegacyReadLine: false, + forceClearScrollbackBuffer: false, + }; + + const defaultSideBarSettings: ISideBarSettings = { + CommandExplorerVisibility: true, + }; + + const defaultButtonSettings: IButtonSettings = { + showRunButtons: true, + showPanelMovementButtons: false + }; + + const defaultPesterSettings: IPesterSettings = { + useLegacyCodeLens: true, + outputVerbosity: "FromPreference", + debugOutputVerbosity: "Diagnostic", }; return { @@ -167,6 +218,10 @@ export function load(): ISettings { configuration.get("powerShellDefaultVersion", undefined), powerShellExePath: configuration.get("powerShellExePath", undefined), + promptToUpdatePowerShell: + configuration.get("promptToUpdatePowerShell", true), + promptToUpdatePackageManagement: + configuration.get("promptToUpdatePackageManagement", true), bundledModulesPath: "../../modules", useX86Host: @@ -189,15 +244,48 @@ export function load(): ISettings { configuration.get("integratedConsole", defaultIntegratedConsoleSettings), bugReporting: configuration.get("bugReporting", defaultBugReportingSettings), + sideBar: + 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 + // "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), }; } -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( diff --git a/src/utils.ts b/src/utils.ts index 8604c26deb..bf3c107a66 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 @@ -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"); @@ -116,6 +96,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; 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/features/UpdatePowerShell.test.ts b/test/features/UpdatePowerShell.test.ts new file mode 100644 index 0000000000..8a96765cee --- /dev/null +++ b/test/features/UpdatePowerShell.test.ts @@ -0,0 +1,28 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ + +import * as assert from "assert"; +import { GitHubReleaseInformation } from "../../src/features/UpdatePowerShell"; + +// 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."); + }); + }); +} 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/platform.test.ts b/test/platform.test.ts index 398ca7560b..f6226f634e 100644 --- a/test/platform.test.ts +++ b/test/platform.test.ts @@ -3,119 +3,638 @@ *--------------------------------------------------------*/ 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); + }); + } + }); + + 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); + } + }); + } + }); }); 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/settings.test.ts b/test/settings.test.ts index ecbaedfb48..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", () => { @@ -10,16 +11,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(() => @@ -32,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); }); }); 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/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" 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..1323e5e1e4 --- /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/$psesRepoName" } +} +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( 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 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 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/setVstsVariables.ps1 b/tools/releaseBuild/setVstsVariables.ps1 index f08fcc4a9d..ace8d35f0b 100644 --- a/tools/releaseBuild/setVstsVariables.ps1 +++ b/tools/releaseBuild/setVstsVariables.ps1 @@ -1,10 +1,17 @@ $vstsVariables = @{ PSES_BRANCH = 'master' + PSES_FORK = 'PowerShell' } # 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" 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..d28de46347 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 { @@ -188,15 +187,20 @@ 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 + + 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