Skip to content

Commit 5788cf9

Browse files
author
Benjamin Pasero
committed
quick access - switch to handler automatically from help when typing prefix to preserve todays behaviour
1 parent dc17cef commit 5788cf9

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/vs/platform/quickinput/browser/helpQuickAccess.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { IQuickPick, IQuickPickItem, IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
77
import { IQuickAccessProvider, IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess';
88
import { Registry } from 'vs/platform/registry/common/platform';
9-
import { CancellationToken } from 'vs/base/common/cancellation';
109
import { localize } from 'vs/nls';
1110
import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';
1211

@@ -33,6 +32,15 @@ export class HelpQuickAccessProvider implements IQuickAccessProvider {
3332
}
3433
}));
3534

35+
// Also open a picker when we detect the user typed the exact
36+
// name of a provider (e.g. `?term` for terminals)
37+
disposables.add(picker.onDidChangeValue(value => {
38+
const providerDescriptor = this.registry.getQuickAccessProvider(value.substr(HelpQuickAccessProvider.PREFIX.length));
39+
if (providerDescriptor && providerDescriptor.prefix !== HelpQuickAccessProvider.PREFIX) {
40+
this.quickInputService.quickAccess.show(providerDescriptor.prefix);
41+
}
42+
}));
43+
3644
// Fill in all providers separated by editor/global scope
3745
const { editorProviders, globalProviders } = this.getQuickAccessProviders();
3846
picker.items = editorProviders.length === 0 || globalProviders.length === 0 ?

0 commit comments

Comments
 (0)