@optique/core 1.0.0-dev.483 → 1.0.0-dev.487
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/modifiers.cjs +2 -3
- package/dist/modifiers.js +2 -3
- package/dist/primitives.cjs +2 -0
- package/dist/primitives.js +2 -0
- package/package.json +1 -1
package/dist/modifiers.cjs
CHANGED
|
@@ -495,7 +495,6 @@ function multiple(parser, options = {}) {
|
|
|
495
495
|
});
|
|
496
496
|
},
|
|
497
497
|
suggest(context, prefix) {
|
|
498
|
-
const innerState = context.state.length > 0 ? context.state.at(-1) : parser.initialState;
|
|
499
498
|
const selectedValues = /* @__PURE__ */ new Set();
|
|
500
499
|
for (const s of context.state) {
|
|
501
500
|
const completed = syncParser.complete(s);
|
|
@@ -511,12 +510,12 @@ function multiple(parser, options = {}) {
|
|
|
511
510
|
return require_mode_dispatch.dispatchIterableByMode(parser.$mode, function* () {
|
|
512
511
|
for (const s of syncParser.suggest({
|
|
513
512
|
...context,
|
|
514
|
-
state:
|
|
513
|
+
state: parser.initialState
|
|
515
514
|
}, prefix)) if (shouldInclude(s)) yield s;
|
|
516
515
|
}, async function* () {
|
|
517
516
|
const suggestions = parser.suggest({
|
|
518
517
|
...context,
|
|
519
|
-
state:
|
|
518
|
+
state: parser.initialState
|
|
520
519
|
}, prefix);
|
|
521
520
|
for await (const s of suggestions) if (shouldInclude(s)) yield s;
|
|
522
521
|
});
|
package/dist/modifiers.js
CHANGED
|
@@ -495,7 +495,6 @@ function multiple(parser, options = {}) {
|
|
|
495
495
|
});
|
|
496
496
|
},
|
|
497
497
|
suggest(context, prefix) {
|
|
498
|
-
const innerState = context.state.length > 0 ? context.state.at(-1) : parser.initialState;
|
|
499
498
|
const selectedValues = /* @__PURE__ */ new Set();
|
|
500
499
|
for (const s of context.state) {
|
|
501
500
|
const completed = syncParser.complete(s);
|
|
@@ -511,12 +510,12 @@ function multiple(parser, options = {}) {
|
|
|
511
510
|
return dispatchIterableByMode(parser.$mode, function* () {
|
|
512
511
|
for (const s of syncParser.suggest({
|
|
513
512
|
...context,
|
|
514
|
-
state:
|
|
513
|
+
state: parser.initialState
|
|
515
514
|
}, prefix)) if (shouldInclude(s)) yield s;
|
|
516
515
|
}, async function* () {
|
|
517
516
|
const suggestions = parser.suggest({
|
|
518
517
|
...context,
|
|
519
|
-
state:
|
|
518
|
+
state: parser.initialState
|
|
520
519
|
}, prefix);
|
|
521
520
|
for await (const s of suggestions) if (shouldInclude(s)) yield s;
|
|
522
521
|
});
|
package/dist/primitives.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_message = require('./message.cjs');
|
|
2
2
|
const require_dependency = require('./dependency.cjs');
|
|
3
|
+
const require_mode_dispatch = require('./mode-dispatch.cjs');
|
|
3
4
|
const require_usage = require('./usage.cjs');
|
|
4
5
|
const require_suggestion = require('./suggestion.cjs');
|
|
5
6
|
const require_usage_internals = require('./usage-internals.cjs');
|
|
@@ -835,6 +836,7 @@ function argument(valueParser, options = {}) {
|
|
|
835
836
|
};
|
|
836
837
|
},
|
|
837
838
|
suggest(context, prefix) {
|
|
839
|
+
if (context.state != null) return require_mode_dispatch.dispatchIterableByMode(valueParser.$mode, function* () {}, async function* () {});
|
|
838
840
|
if (isAsync) return suggestArgumentAsync(valueParser, require_usage.isSuggestionHidden(options.hidden), prefix, context.dependencyRegistry);
|
|
839
841
|
return suggestArgumentSync(valueParser, require_usage.isSuggestionHidden(options.hidden), prefix, context.dependencyRegistry);
|
|
840
842
|
},
|
package/dist/primitives.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { message, metavar, optionName, optionNames, text, valueSet } from "./message.js";
|
|
2
2
|
import { createDeferredParseState, createDependencySourceState, createPendingDependencySourceState, dependencyId, getDefaultValuesFunction, getDependencyIds, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isPendingDependencySourceState, suggestWithDependency } from "./dependency.js";
|
|
3
|
+
import { dispatchIterableByMode } from "./mode-dispatch.js";
|
|
3
4
|
import { extractOptionNames, isDocHidden, isSuggestionHidden } from "./usage.js";
|
|
4
5
|
import { DEFAULT_FIND_SIMILAR_OPTIONS, createErrorWithSuggestions, createSuggestionMessage, findSimilar } from "./suggestion.js";
|
|
5
6
|
import { extractLeadingCommandNames } from "./usage-internals.js";
|
|
@@ -835,6 +836,7 @@ function argument(valueParser, options = {}) {
|
|
|
835
836
|
};
|
|
836
837
|
},
|
|
837
838
|
suggest(context, prefix) {
|
|
839
|
+
if (context.state != null) return dispatchIterableByMode(valueParser.$mode, function* () {}, async function* () {});
|
|
838
840
|
if (isAsync) return suggestArgumentAsync(valueParser, isSuggestionHidden(options.hidden), prefix, context.dependencyRegistry);
|
|
839
841
|
return suggestArgumentSync(valueParser, isSuggestionHidden(options.hidden), prefix, context.dependencyRegistry);
|
|
840
842
|
},
|