bugfix docs pwsh completion, escaping "

This commit is contained in:
silverqx
2022-07-05 11:34:10 +02:00
parent 9ea178e9b0
commit 5c8cdbe540

View File

@@ -119,8 +119,8 @@ For the `pwsh` paste the following code to the pwsh profile (works on Linux or W
Register-ArgumentCompleter -Native -CommandName tom,tom_testdata -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
[Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new()
$Local:word = $wordToComplete.Replace('"', '""')
$Local:ast = $commandAst.ToString().Replace('"', '""')
$Local:word = $wordToComplete.Replace('"', '\"')
$Local:ast = $commandAst.ToString().Replace('"', '\"')
tom complete --word="$Local:word" --commandline="$Local:ast" --position=$cursorPosition | ForEach-Object {
$completionText, $listText, $toolTip = $_ -split ';', 3
$listText ??= $completionText