Skip to content

Commit 6cc518c

Browse files
author
Christoph Bergmeister
committed
Merge branch 'legacy/1.x' of https://github.com/powershell/powershelleditorservices into legacy/1.x
2 parents 74320f7 + 2ddcd13 commit 6cc518c

File tree

7 files changed

+65
-10
lines changed

7 files changed

+65
-10
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# PowerShell Editor Services Release History
22

3+
## v1.13.1
4+
### Friday, November 1, 2019
5+
6+
- 📟 [PowerShellEditorServices #1077](https://github.com/PowerShell/PowerShellEditorServices/pull/1077) -
7+
Support new console color configuration in PowerShell 7.
8+
- 🐛 [vscode-powershell #2116](https://github.com/PowerShell/PowerShellEditorServices/pull/1044) -
9+
Fix UNC intellisense backslash.
10+
- 🐛 [vscode-powershell #2214](https://github.com/PowerShell/PowerShellEditorServices/pull/1050) -
11+
Fix issue where PipelineIndentationStyle setting is ignored. (Thanks @bergmeister!)
12+
- ⚙️ [PowerShellEditorServices #1052](https://github.com/PowerShell/PowerShellEditorServices/pull/1052) -
13+
Update minimum PSSA version to 1.18.3. (Thanks @bergmeister!)
14+
315
## v1.13.0
416
### Monday, September 23, 2019
517

PowerShellEditorServices.Common.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<VersionPrefix>1.13.0</VersionPrefix>
3+
<VersionPrefix>1.13.1</VersionPrefix>
44
<Company>Microsoft</Company>
55
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
66
<PackageTags>PowerShell;editor;development;language;debugging</PackageTags>

PowerShellEditorServices.build.ps1

+9-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if ($PSVersionTable.PSEdition -ne "Core") {
3434

3535
task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, TestPowerShellApi {
3636

37-
$requiredSdkVersion = "2.0.0"
37+
$minRequiredSdkVersion = "2.0.0"
3838

3939
$dotnetPath = "$PSScriptRoot/.dotnet"
4040
$dotnetExePath = if ($script:IsUnix) { "$dotnetPath/dotnet" } else { "$dotnetPath/dotnet.exe" }
@@ -54,8 +54,11 @@ task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, TestP
5454
if ($dotnetExePath) {
5555
# dotnet --version can return a semver that System.Version can't handle
5656
# e.g.: 2.1.300-preview-01. The replace operator is used to remove any build suffix.
57-
$version = (& $dotnetExePath --version) -replace '[+-].*$',''
58-
if ([version]$version -ge [version]$requiredSdkVersion) {
57+
$version = [version]((& $dotnetExePath --version) -replace '[+-].*$','')
58+
$maxRequiredSdkVersion = [version]::Parse("3.0.0")
59+
60+
# $minRequiredSdkVersion <= version < $maxRequiredSdkVersion
61+
if ($version -ge [version]$minRequiredSdkVersion -and $version -lt $maxRequiredSdkVersion) {
5962
$script:dotnetExe = $dotnetExePath
6063
}
6164
else {
@@ -70,7 +73,7 @@ task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, TestP
7073

7174
if ($script:dotnetExe -eq $null) {
7275

73-
Write-Host "`n### Installing .NET CLI $requiredSdkVersion...`n" -ForegroundColor Green
76+
Write-Host "`n### Installing .NET CLI $minRequiredSdkVersion...`n" -ForegroundColor Green
7477

7578
# The install script is platform-specific
7679
$installScriptExt = if ($script:IsUnix) { "sh" } else { "ps1" }
@@ -81,10 +84,10 @@ task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, TestP
8184
$env:DOTNET_INSTALL_DIR = "$PSScriptRoot/.dotnet"
8285

8386
if (!$script:IsUnix) {
84-
& $installScriptPath -Version $requiredSdkVersion -InstallDir "$env:DOTNET_INSTALL_DIR"
87+
& $installScriptPath -Version $minRequiredSdkVersion -InstallDir "$env:DOTNET_INSTALL_DIR"
8588
}
8689
else {
87-
& /bin/bash $installScriptPath -Version $requiredSdkVersion -InstallDir "$env:DOTNET_INSTALL_DIR"
90+
& /bin/bash $installScriptPath -Version $minRequiredSdkVersion -InstallDir "$env:DOTNET_INSTALL_DIR"
8891
$env:PATH = $dotnetExeDir + [System.IO.Path]::PathSeparator + $env:PATH
8992
}
9093

module/PowerShellEditorServices/PowerShellEditorServices.psd1

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'PowerShellEditorServices.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.13.0'
15+
ModuleVersion = '1.13.1'
1616

1717
# ID used to uniquely identify this module
1818
GUID = '9ca15887-53a2-479a-9cda-48d26bcb6c47'

src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1987,8 +1987,13 @@ private static CompletionItem CreateCompletionItem(
19871987
// This causes the editing cursor to be placed *before* the final quote after completion,
19881988
// which makes subsequent path completions work. See this part of the LSP spec for details:
19891989
// https://microsoft.github.io/language-server-protocol/specification#textDocument_completion
1990-
int len = completionDetails.CompletionText.Length;
1991-
completionText = completionDetails.CompletionText.Insert(len - 1, "$0");
1990+
1991+
// Since we want to use a "tab stop" we need to escape a few things for Textmate to render properly.
1992+
var sb = new StringBuilder(completionDetails.CompletionText)
1993+
.Replace(@"\", @"\\")
1994+
.Replace(@"}", @"\}")
1995+
.Replace(@"$", @"\$");
1996+
completionText = sb.Insert(sb.Length - 1, "$0").ToString();
19921997
insertTextFormat = InsertTextFormat.Snippet;
19931998
}
19941999

src/PowerShellEditorServices/Session/Host/EditorServicesPSHost.cs

+32
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,38 @@ internal ConsoleColorProxy(EditorServicesPSHostUserInterface hostUserInterface)
8787
_hostUserInterface = hostUserInterface;
8888
}
8989

90+
/// <summary>
91+
/// The Accent Color for Formatting
92+
/// </summary>
93+
public ConsoleColor FormatAccentColor
94+
{
95+
get
96+
{
97+
return _hostUserInterface.FormatAccentColor;
98+
}
99+
100+
set
101+
{
102+
_hostUserInterface.FormatAccentColor = value;
103+
}
104+
}
105+
106+
/// <summary>
107+
/// The Accent Color for Error
108+
/// </summary>
109+
public ConsoleColor ErrorAccentColor
110+
{
111+
get
112+
{
113+
return _hostUserInterface.ErrorAccentColor;
114+
}
115+
116+
set
117+
{
118+
_hostUserInterface.ErrorAccentColor = value;
119+
}
120+
}
121+
90122
/// <summary>
91123
/// The ForegroundColor for Error
92124
/// </summary>

src/PowerShellEditorServices/Session/Host/EditorServicesPSHostUserInterface.cs

+3
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,9 @@ private void WriteDebuggerBanner(DebuggerStopEventArgs eventArgs)
690690

691691
internal static ConsoleColor BackgroundColor { get; set; }
692692

693+
internal ConsoleColor FormatAccentColor { get; set; } = ConsoleColor.Green;
694+
internal ConsoleColor ErrorAccentColor { get; set; } = ConsoleColor.Cyan;
695+
693696
internal ConsoleColor ErrorForegroundColor { get; set; } = ConsoleColor.Red;
694697
internal ConsoleColor ErrorBackgroundColor { get; set; } = BackgroundColor;
695698

0 commit comments

Comments
 (0)