File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/PowerShellEditorServices.Protocol/Server Expand file tree Collapse file tree 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(
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
You can’t perform that action at this time.
0 commit comments