File tree 1 file changed +7
-2
lines changed
src/PowerShellEditorServices.Protocol/Server
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1987,8 +1987,13 @@ private static CompletionItem CreateCompletionItem(
1987
1987
// This causes the editing cursor to be placed *before* the final quote after completion,
1988
1988
// which makes subsequent path completions work. See this part of the LSP spec for details:
1989
1989
// 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 ( ) ;
1992
1997
insertTextFormat = InsertTextFormat . Snippet ;
1993
1998
}
1994
1999
You can’t perform that action at this time.
0 commit comments