mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-22 08:09:42 +01:00
Merge pull request #224429 from microsoft/tyriar/excl_question
Also exclude $ from comletions from start logic
This commit is contained in:
@@ -232,11 +232,12 @@ function Send-Completions {
|
||||
# Adjust the completion prefix and cursor index such that tab expansion will be requested
|
||||
# immediately after the last whitespace. This allows the client to perform fuzzy filtering
|
||||
# such that requesting completions in the middle of a word should show the same completions
|
||||
# as at the start. This only happens when the last word does not include `/` and `\` as
|
||||
# often it will significantly change completions like when navigating directories.
|
||||
# as at the start. This only happens when the last word does not include special characters:
|
||||
# - `/` and `\`: Completions change when navigating directories.
|
||||
# - `$`: Completions change when variables.
|
||||
$lastWhitespaceIndex = $completionPrefix.LastIndexOf(' ')
|
||||
$lastWord = $completionPrefix.Substring($lastWhitespaceIndex + 1)
|
||||
if ($lastWord.Contains('/') -eq $false -and $lastWord.Contains('\\') -eq $false) {
|
||||
if ($lastWord -notmatch '[/\\$]') {
|
||||
if ($lastWhitespaceIndex -ne -1 -and $lastWhitespaceIndex -lt $cursorIndex) {
|
||||
$newCursorIndex = $lastWhitespaceIndex + 1
|
||||
$completionPrefix = $completionPrefix.Substring(0, $newCursorIndex)
|
||||
|
||||
Reference in New Issue
Block a user