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 @@ -2010,8 +2010,13 @@ private static CompletionItem CreateCompletionItem(
2010
2010
// This causes the editing cursor to be placed *before* the final quote after completion,
2011
2011
// which makes subsequent path completions work. See this part of the LSP spec for details:
2012
2012
// 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 ( ) ;
2015
2020
insertTextFormat = InsertTextFormat . Snippet ;
2016
2021
}
2017
2022
You can’t perform that action at this time.
0 commit comments