mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-20 15:19:54 +01:00
Merge pull request #243754 from microsoft/tyriar/240891
Remove boolean support for terminal quickSuggestions
This commit is contained in:
@@ -261,7 +261,7 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
|
||||
this._requestedCompletionsIndex = this._currentPromptInputState.cursorIndex;
|
||||
|
||||
const quickSuggestionsConfig = this._configurationService.getValue<ITerminalSuggestConfiguration>(terminalSuggestConfigSection).quickSuggestions;
|
||||
const allowFallbackCompletions = explicitlyInvoked || quickSuggestionsConfig === true || typeof quickSuggestionsConfig === 'object' && quickSuggestionsConfig.unknown === 'on';
|
||||
const allowFallbackCompletions = explicitlyInvoked || quickSuggestionsConfig.unknown === 'on';
|
||||
const providedCompletions = await this._terminalCompletionService.provideCompletions(this._currentPromptInputState.prefix, this._currentPromptInputState.cursorIndex, allowFallbackCompletions, this.shellType, this._capabilities, token, doNotRequestExtensionCompletions);
|
||||
|
||||
if (token.isCancellationRequested) {
|
||||
@@ -413,9 +413,8 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
|
||||
if (!this._terminalSuggestWidgetVisibleContextKey.get()) {
|
||||
const commandLineHasSpace = promptInputState.prefix.trim().match(/\s/);
|
||||
if (
|
||||
(typeof config.quickSuggestions === 'boolean' && config.quickSuggestions) ||
|
||||
(typeof config.quickSuggestions === 'object' && !commandLineHasSpace && config.quickSuggestions.commands !== 'off') ||
|
||||
(typeof config.quickSuggestions === 'object' && commandLineHasSpace && config.quickSuggestions.arguments !== 'off')
|
||||
(!commandLineHasSpace && config.quickSuggestions.commands !== 'off') ||
|
||||
(commandLineHasSpace && config.quickSuggestions.arguments !== 'off')
|
||||
) {
|
||||
if (promptInputState.prefix.match(/[^\s]$/)) {
|
||||
sent = this._requestTriggerCharQuickSuggestCompletions();
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ export const terminalSuggestConfigSection = 'terminal.integrated.suggest';
|
||||
|
||||
export interface ITerminalSuggestConfiguration {
|
||||
enabled: boolean;
|
||||
quickSuggestions: /*Legacy - was this when experimental*/boolean | {
|
||||
quickSuggestions: {
|
||||
commands: 'off' | 'on';
|
||||
arguments: 'off' | 'on';
|
||||
unknown: 'off' | 'on';
|
||||
|
||||
Reference in New Issue
Block a user