Skip to content

Commit

Permalink
Fix UNC intellisense backslash (PowerShell#1044)
Browse files Browse the repository at this point in the history
* fix UNC intellisense backslash

* use here string

* here everywhere
  • Loading branch information
TylerLeonhardt committed Oct 3, 2019
1 parent 00a5e6d commit 8332631
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2010,8 +2010,13 @@ private static CompletionItem CreateCompletionItem(
// This causes the editing cursor to be placed *before* the final quote after completion,
// which makes subsequent path completions work. See this part of the LSP spec for details:
// https://microsoft.github.io/language-server-protocol/specification#textDocument_completion
int len = completionDetails.CompletionText.Length;
completionText = completionDetails.CompletionText.Insert(len - 1, "$0");

// Since we want to use a "tab stop" we need to escape a few things for Textmate to render properly.
var sb = new StringBuilder(completionDetails.CompletionText)
.Replace(@"\", @"\\")
.Replace(@"}", @"\}")
.Replace(@"$", @"\$");
completionText = sb.Insert(sb.Length - 1, "$0").ToString();
insertTextFormat = InsertTextFormat.Snippet;
}

Expand Down

0 comments on commit 8332631

Please sign in to comment.