From aeff3f0e91cf849f5602822e327a392e4d245c2c Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Thu, 3 Oct 2019 00:23:16 +0100 Subject: [PATCH 1/3] Fix PipelineIndentation configuration issue (#1050) --- .../Server/LanguageServerSettings.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PowerShellEditorServices.Protocol/Server/LanguageServerSettings.cs b/src/PowerShellEditorServices.Protocol/Server/LanguageServerSettings.cs index 6106fb25c..2c1d0b7df 100644 --- a/src/PowerShellEditorServices.Protocol/Server/LanguageServerSettings.cs +++ b/src/PowerShellEditorServices.Protocol/Server/LanguageServerSettings.cs @@ -264,6 +264,7 @@ private Hashtable GetCustomPSSASettingsHashtable(int tabSize, bool insertSpaces) {"PSUseConsistentIndentation", new Hashtable { {"Enable", true}, {"IndentationSize", tabSize}, + {"PipelineIndentation", PipelineIndentationStyle }, {"Kind", insertSpaces ? "space" : "tab"} }}, {"PSUseConsistentWhitespace", new Hashtable { From 74320f7c2242f3f565602fa7e54d1bb7d712197d Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Thu, 3 Oct 2019 21:00:17 +0100 Subject: [PATCH 2/3] legacy/1.x: Update minimum PSSA version to 1.18.3 (#1052) --- modules.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.json b/modules.json index 8777ca207..df8ff6935 100644 --- a/modules.json +++ b/modules.json @@ -1,6 +1,6 @@ { "PSScriptAnalyzer":{ - "MinimumVersion":"1.18.2", + "MinimumVersion":"1.18.3", "MaximumVersion":"1.99", "AllowPrerelease":false }, From a7eb192b559f57ae64441714021668538824d8d4 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Thu, 3 Oct 2019 21:12:58 +0100 Subject: [PATCH 3/3] legacy/1.x: Backport #909 and update .Net SDK version to be the same as in master --- PowerShellEditorServices.build.ps1 | 8 +++----- global.json | 5 +++++ 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 global.json diff --git a/PowerShellEditorServices.build.ps1 b/PowerShellEditorServices.build.ps1 index 458e88ce1..e67e1c63f 100644 --- a/PowerShellEditorServices.build.ps1 +++ b/PowerShellEditorServices.build.ps1 @@ -34,7 +34,7 @@ if ($PSVersionTable.PSEdition -ne "Core") { task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, TestPowerShellApi { - $requiredSdkVersion = "2.0.0" + $requiredSdkVersion = (Get-Content (Join-Path $PSScriptRoot 'global.json') | ConvertFrom-Json).sdk.version $dotnetPath = "$PSScriptRoot/.dotnet" $dotnetExePath = if ($script:IsUnix) { "$dotnetPath/dotnet" } else { "$dotnetPath/dotnet.exe" } @@ -52,10 +52,8 @@ task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, TestP # Make sure the dotnet we found is the right version if ($dotnetExePath) { - # dotnet --version can return a semver that System.Version can't handle - # e.g.: 2.1.300-preview-01. The replace operator is used to remove any build suffix. - $version = (& $dotnetExePath --version) -replace '[+-].*$','' - if ([version]$version -ge [version]$requiredSdkVersion) { + # dotnet --version can write to stderr, which causes builds to abort, therefore use --list-sdks instead + if ((& $dotnetExePath --list-sdks | ForEach-Object { $_.Split()[0] } ) -contains $requiredSdkVersion) { $script:dotnetExe = $dotnetExePath } else { diff --git a/global.json b/global.json new file mode 100644 index 000000000..0c8476678 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "2.1.801" + } +}