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 @@ -2010,8 +2010,13 @@ private static CompletionItem CreateCompletionItem(
20102010 // This causes the editing cursor to be placed *before* the final quote after completion,
20112011 // which makes subsequent path completions work. See this part of the LSP spec for details:
20122012 // https://microsoft.github.io/language-server-protocol/specification#textDocument_completion
2013- int len = completionDetails . CompletionText . Length ;
2014- completionText = completionDetails . CompletionText . Insert ( len - 1 , "$0" ) ;
2013+
2014+ // Since we want to use a "tab stop" we need to escape a few things for Textmate to render properly.
2015+ var sb = new StringBuilder ( completionDetails . CompletionText )
2016+ . Replace ( @"\" , @"\\" )
2017+ . Replace ( @"}" , @"\}" )
2018+ . Replace ( @"$" , @"\$" ) ;
2019+ completionText = sb . Insert ( sb . Length - 1 , "$0" ) . ToString ( ) ;
20152020 insertTextFormat = InsertTextFormat . Snippet ;
20162021 }
20172022
You can’t perform that action at this time.
0 commit comments