@optique/core 1.0.15-dev.2809 → 1.0.15-dev.2812
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/completion.cjs +4 -16
- package/dist/completion.js +4 -16
- package/package.json +1 -1
package/dist/completion.cjs
CHANGED
|
@@ -1279,23 +1279,11 @@ Register-ArgumentCompleter -Native -CommandName ${programName} -ScriptBlock {
|
|
|
1279
1279
|
\$arguments = @()
|
|
1280
1280
|
\$commandElements = \$commandAst.CommandElements
|
|
1281
1281
|
|
|
1282
|
-
#
|
|
1283
|
-
#
|
|
1284
|
-
\$
|
|
1285
|
-
if (\$commandElements.Count -gt 1) {
|
|
1286
|
-
\$lastElement = \$commandElements[\$commandElements.Count - 1]
|
|
1287
|
-
\$lastText = if (\$lastElement -is [System.Management.Automation.Language.StringConstantExpressionAst]) {
|
|
1288
|
-
\$lastElement.Value
|
|
1289
|
-
} else {
|
|
1290
|
-
\$lastElement.Extent.Text
|
|
1291
|
-
}
|
|
1292
|
-
if (\$lastText -eq \$wordToComplete) {
|
|
1293
|
-
\$maxIndex = \$commandElements.Count - 2
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
for (\$i = 1; \$i -le \$maxIndex; \$i++) {
|
|
1282
|
+
# Keep only complete arguments before the cursor. The current word
|
|
1283
|
+
# (including a token ending exactly at the cursor) is appended below.
|
|
1284
|
+
for (\$i = 1; \$i -lt \$commandElements.Count; \$i++) {
|
|
1298
1285
|
\$element = \$commandElements[\$i]
|
|
1286
|
+
if (\$element.Extent.EndOffset -ge \$cursorPosition) { break }
|
|
1299
1287
|
|
|
1300
1288
|
if (\$element -is [System.Management.Automation.Language.StringConstantExpressionAst]) {
|
|
1301
1289
|
\$arguments += \$element.Value
|
package/dist/completion.js
CHANGED
|
@@ -1279,23 +1279,11 @@ Register-ArgumentCompleter -Native -CommandName ${programName} -ScriptBlock {
|
|
|
1279
1279
|
\$arguments = @()
|
|
1280
1280
|
\$commandElements = \$commandAst.CommandElements
|
|
1281
1281
|
|
|
1282
|
-
#
|
|
1283
|
-
#
|
|
1284
|
-
\$
|
|
1285
|
-
if (\$commandElements.Count -gt 1) {
|
|
1286
|
-
\$lastElement = \$commandElements[\$commandElements.Count - 1]
|
|
1287
|
-
\$lastText = if (\$lastElement -is [System.Management.Automation.Language.StringConstantExpressionAst]) {
|
|
1288
|
-
\$lastElement.Value
|
|
1289
|
-
} else {
|
|
1290
|
-
\$lastElement.Extent.Text
|
|
1291
|
-
}
|
|
1292
|
-
if (\$lastText -eq \$wordToComplete) {
|
|
1293
|
-
\$maxIndex = \$commandElements.Count - 2
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
for (\$i = 1; \$i -le \$maxIndex; \$i++) {
|
|
1282
|
+
# Keep only complete arguments before the cursor. The current word
|
|
1283
|
+
# (including a token ending exactly at the cursor) is appended below.
|
|
1284
|
+
for (\$i = 1; \$i -lt \$commandElements.Count; \$i++) {
|
|
1298
1285
|
\$element = \$commandElements[\$i]
|
|
1286
|
+
if (\$element.Extent.EndOffset -ge \$cursorPosition) { break }
|
|
1299
1287
|
|
|
1300
1288
|
if (\$element -is [System.Management.Automation.Language.StringConstantExpressionAst]) {
|
|
1301
1289
|
\$arguments += \$element.Value
|