Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
x24git authored Apr 11, 2020
2 parents 64bc3d7 + 433380c commit ee1b1df
Show file tree
Hide file tree
Showing 20 changed files with 144 additions and 129 deletions.
2 changes: 1 addition & 1 deletion extensions/git/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"config.enableSmartCommit": "Commit all changes when there are no staged changes.",
"config.smartCommitChanges": "Control which changes are automatically staged by Smart Commit.",
"config.smartCommitChanges.all": "Automatically stage all changes.",
"config.smartCommitChanges.tracked": "Automatically staged tracked changes only.",
"config.smartCommitChanges.tracked": "Automatically stage tracked changes only.",
"config.suggestSmartCommit": "Suggests to enable smart commit (commit all changes when there are no staged changes).",
"config.enableCommitSigning": "Enables commit signing with GPG.",
"config.discardAllScope": "Controls what changes are discarded by the `Discard all changes` command. `all` discards all changes. `tracked` discards only tracked files. `prompt` shows a prompt dialog every time the action is run.",
Expand Down
12 changes: 11 additions & 1 deletion extensions/typescript-language-features/src/features/refactor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import FormattingOptionsManager from './fileConfigurationManager';

const localize = nls.loadMessageBundle();

interface RefactorActionInfo extends Proto.RefactorActionInfo {
error?: string
}

class ApplyRefactoringCommand implements Command {
public static readonly ID = '_typescript.applyRefactoring';
Expand Down Expand Up @@ -280,13 +283,20 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider {
}

private refactorActionToCodeAction(
action: Proto.RefactorActionInfo,
action: RefactorActionInfo,
document: vscode.TextDocument,
info: Proto.ApplicableRefactorInfo,
rangeOrSelection: vscode.Range | vscode.Selection,
allActions: readonly Proto.RefactorActionInfo[],
) {
const codeAction = new vscode.CodeAction(action.description, TypeScriptRefactorProvider.getKind(action));

// https://github.com/microsoft/TypeScript/pull/37871
if (action.error) {
codeAction.disabled = { reason: action.error };
return codeAction;
}

codeAction.command = {
title: action.description,
command: ApplyRefactoringCommand.ID,
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.45.0",
"distro": "d97879255c4f6590c5ccccfd1df6996018dfe0e5",
"distro": "ddd4867681e6629e7cb8802b084ee2354a59f14e",
"author": {
"name": "Microsoft Corporation"
},
Expand Down Expand Up @@ -56,11 +56,11 @@
"vscode-ripgrep": "^1.5.8",
"vscode-sqlite3": "4.0.9",
"vscode-textmate": "4.4.0",
"xterm": "4.5.0-beta.21",
"xterm-addon-search": "0.6.0-beta.2",
"xterm": "4.5.0",
"xterm-addon-search": "0.6.0",
"xterm-addon-unicode11": "0.2.0-beta.2",
"xterm-addon-web-links": "0.3.0-beta.5",
"xterm-addon-webgl": "0.6.0-beta.3",
"xterm-addon-web-links": "0.3.0",
"xterm-addon-webgl": "0.6.0",
"yauzl": "^2.9.2",
"yazl": "^2.4.3"
},
Expand Down
8 changes: 4 additions & 4 deletions remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"vscode-proxy-agent": "^0.5.2",
"vscode-ripgrep": "^1.5.8",
"vscode-textmate": "4.4.0",
"xterm": "4.5.0-beta.21",
"xterm-addon-search": "0.6.0-beta.2",
"xterm": "4.5.0",
"xterm-addon-search": "0.6.0",
"xterm-addon-unicode11": "0.2.0-beta.2",
"xterm-addon-web-links": "0.3.0-beta.5",
"xterm-addon-webgl": "0.6.0-beta.3",
"xterm-addon-web-links": "0.3.0",
"xterm-addon-webgl": "0.6.0",
"yauzl": "^2.9.2",
"yazl": "^2.4.3"
},
Expand Down
8 changes: 4 additions & 4 deletions remote/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"onigasm-umd": "2.2.5",
"semver-umd": "^5.5.5",
"vscode-textmate": "4.4.0",
"xterm": "4.5.0-beta.21",
"xterm-addon-search": "0.6.0-beta.2",
"xterm": "4.5.0",
"xterm-addon-search": "0.6.0",
"xterm-addon-unicode11": "0.2.0-beta.2",
"xterm-addon-web-links": "0.3.0-beta.5",
"xterm-addon-webgl": "0.6.0-beta.3"
"xterm-addon-web-links": "0.3.0",
"xterm-addon-webgl": "0.6.0"
}
}
32 changes: 16 additions & 16 deletions remote/web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ vscode-textmate@4.4.0:
dependencies:
oniguruma "^7.2.0"

xterm-addon-search@0.6.0-beta.2:
version "0.6.0-beta.2"
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.6.0-beta.2.tgz#a9408e6c95ad4c47cebc147bfb359ce33f9ccb9f"
integrity sha512-kl7irLdfOdjgCRhlaruGQy2L35BhcOw3dlcogj8HNmHcm98/qF6fO19sOmv7UjZz1ic6sNxtQQw9Sm+MMkxt+A==
xterm-addon-search@0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.6.0.tgz#542cc2c35e83e7332ce1982b65ad218ee769836c"
integrity sha512-k3EsZzUptCXygHFP5rQuCBdWWkI/ZNuX3pDSOVdxPV9jB7U5Aha9guTIZoMP7FIjL8jce+ClQs6q7VINcRV1+w==

xterm-addon-unicode11@0.2.0-beta.2:
version "0.2.0-beta.2"
resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.2.0-beta.2.tgz#2a13ba5b08fdb1005be241816c4e3302674db4af"
integrity sha512-Y047mnIWrAj65TpStdyPYoPeDTX4en+XX4Y90KuQB3cW2xIyZj25NSVV9BZdqzSb7gk9M6KBvIcm8chj7S2N8Q==

xterm-addon-web-links@0.3.0-beta.5:
version "0.3.0-beta.5"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.3.0-beta.5.tgz#a489ee89f1e48569760742b20ac349cb61b421cd"
integrity sha512-M+NvTY03TY/yt95xjZFEBgwBThfsYy/RsuJTT4ydDaGeQAJEuZjV2O8nc8gmzAKGxYsgxx9br0A9RyLp5yqKKw==
xterm-addon-web-links@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.3.0.tgz#88affe9235c928b41bab660a65330f46d91c940e"
integrity sha512-vGXiIDqNMyxK5S1IzOjDqcgeQrrv7TDcSHiOeCNAoWCI2f+Rap9d18gjgnMKPyR+AbG0KoKnaKA6Dc1du1vs5A==

xterm-addon-webgl@0.6.0-beta.3:
version "0.6.0-beta.3"
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.6.0-beta.3.tgz#48abe4607659caaec3175c0105298bba5e34be27"
integrity sha512-2mhW/4Qv4i4KhEbtOAL4bc9FPGXON8XuM3vfKXT0EauXy/7ygtPu8IqrYNvNo0uJUoW6gOf0d5+/6kUMak2YYg==
xterm-addon-webgl@0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.6.0.tgz#1bc625dce0210ad461b8fa5618435e442984d89f"
integrity sha512-1RToOJSZOF3qyJJhF9/LDHf6DNOX4mIYtpMnMNghhLUC/rZg+H5qf73dlP2KDtr9ZkZTJvVlu4SVF8lDGrvT2w==

xterm@4.5.0-beta.21:
version "4.5.0-beta.21"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.5.0-beta.21.tgz#2265b8bb47c4e9ac68816f423d62f3f52df2bb88"
integrity sha512-np74QU68AwZckkWl5LncLk/HcWT/DUWO1XKJaCKqY/UWc9VlYarTJWSUqZrZiZ6zHJ7LgG9lSzCPSxYvq7Mq5Q==
xterm@4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.5.0.tgz#c7fd145c6cf91c9f2ef07011a9b35026cf4bfecc"
integrity sha512-4t12tsvtYnv13FBJwewddxdI/j4kSonmbQQv50j34R/rPIFbUNGtptbprmuUlTDAKvHLMDZ/Np2XcpNimga/HQ==
32 changes: 16 additions & 16 deletions remote/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -413,30 +413,30 @@ vscode-windows-registry@1.0.2:
resolved "https://registry.yarnpkg.com/vscode-windows-registry/-/vscode-windows-registry-1.0.2.tgz#b863e704a6a69c50b3098a55fbddbe595b0c124a"
integrity sha512-/CLLvuOSM2Vme2z6aNyB+4Omd7hDxpf4Thrt8ImxnXeQtxzel2bClJpFQvQqK/s4oaXlkBKS7LqVLeZM+uSVIA==

xterm-addon-search@0.6.0-beta.2:
version "0.6.0-beta.2"
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.6.0-beta.2.tgz#a9408e6c95ad4c47cebc147bfb359ce33f9ccb9f"
integrity sha512-kl7irLdfOdjgCRhlaruGQy2L35BhcOw3dlcogj8HNmHcm98/qF6fO19sOmv7UjZz1ic6sNxtQQw9Sm+MMkxt+A==
xterm-addon-search@0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.6.0.tgz#542cc2c35e83e7332ce1982b65ad218ee769836c"
integrity sha512-k3EsZzUptCXygHFP5rQuCBdWWkI/ZNuX3pDSOVdxPV9jB7U5Aha9guTIZoMP7FIjL8jce+ClQs6q7VINcRV1+w==

xterm-addon-unicode11@0.2.0-beta.2:
version "0.2.0-beta.2"
resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.2.0-beta.2.tgz#2a13ba5b08fdb1005be241816c4e3302674db4af"
integrity sha512-Y047mnIWrAj65TpStdyPYoPeDTX4en+XX4Y90KuQB3cW2xIyZj25NSVV9BZdqzSb7gk9M6KBvIcm8chj7S2N8Q==

xterm-addon-web-links@0.3.0-beta.5:
version "0.3.0-beta.5"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.3.0-beta.5.tgz#a489ee89f1e48569760742b20ac349cb61b421cd"
integrity sha512-M+NvTY03TY/yt95xjZFEBgwBThfsYy/RsuJTT4ydDaGeQAJEuZjV2O8nc8gmzAKGxYsgxx9br0A9RyLp5yqKKw==
xterm-addon-web-links@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.3.0.tgz#88affe9235c928b41bab660a65330f46d91c940e"
integrity sha512-vGXiIDqNMyxK5S1IzOjDqcgeQrrv7TDcSHiOeCNAoWCI2f+Rap9d18gjgnMKPyR+AbG0KoKnaKA6Dc1du1vs5A==

xterm-addon-webgl@0.6.0-beta.3:
version "0.6.0-beta.3"
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.6.0-beta.3.tgz#48abe4607659caaec3175c0105298bba5e34be27"
integrity sha512-2mhW/4Qv4i4KhEbtOAL4bc9FPGXON8XuM3vfKXT0EauXy/7ygtPu8IqrYNvNo0uJUoW6gOf0d5+/6kUMak2YYg==
xterm-addon-webgl@0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.6.0.tgz#1bc625dce0210ad461b8fa5618435e442984d89f"
integrity sha512-1RToOJSZOF3qyJJhF9/LDHf6DNOX4mIYtpMnMNghhLUC/rZg+H5qf73dlP2KDtr9ZkZTJvVlu4SVF8lDGrvT2w==

xterm@4.5.0-beta.21:
version "4.5.0-beta.21"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.5.0-beta.21.tgz#2265b8bb47c4e9ac68816f423d62f3f52df2bb88"
integrity sha512-np74QU68AwZckkWl5LncLk/HcWT/DUWO1XKJaCKqY/UWc9VlYarTJWSUqZrZiZ6zHJ7LgG9lSzCPSxYvq7Mq5Q==
xterm@4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.5.0.tgz#c7fd145c6cf91c9f2ef07011a9b35026cf4bfecc"
integrity sha512-4t12tsvtYnv13FBJwewddxdI/j4kSonmbQQv50j34R/rPIFbUNGtptbprmuUlTDAKvHLMDZ/Np2XcpNimga/HQ==

yauzl@^2.9.2:
version "2.10.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,7 @@ suite('Disk File Service', function () {
assert.equal(r2.name, 'deep');
});

test('resolve - folder symbolic link', async () => {
if (isWindows) {
return; // not reliable on windows
}

(isWindows /* not reliable on windows */ ? test.skip : test)('resolve - folder symbolic link', async () => {
const link = URI.file(join(testDir, 'deep-link'));
await symlink(join(testDir, 'deep'), link.fsPath);

Expand All @@ -430,11 +426,7 @@ suite('Disk File Service', function () {
assert.equal(resolved.isSymbolicLink, true);
});

test('resolve - file symbolic link', async () => {
if (isWindows) {
return; // not reliable on windows
}

(isWindows /* not reliable on windows */ ? test.skip : test)('resolve - file symbolic link', async () => {
const link = URI.file(join(testDir, 'lorem.txt-linked'));
await symlink(join(testDir, 'lorem.txt'), link.fsPath);

Expand All @@ -443,11 +435,7 @@ suite('Disk File Service', function () {
assert.equal(resolved.isSymbolicLink, true);
});

test('resolve - symbolic link pointing to non-existing file does not break', async () => {
if (isWindows) {
return; // not reliable on windows
}

(isWindows /* not reliable on windows */ ? test.skip : test)('resolve - symbolic link pointing to non-existing file does not break', async () => {
await symlink(join(testDir, 'foo'), join(testDir, 'bar'));

const resolved = await service.resolve(URI.file(testDir));
Expand Down Expand Up @@ -495,11 +483,7 @@ suite('Disk File Service', function () {
assert.equal((<FileOperationError>error).fileOperationResult, FileOperationResult.FILE_NOT_FOUND);
}

test('deleteFile - symbolic link (exists)', async () => {
if (isWindows) {
return; // not reliable on windows
}

(isWindows /* not reliable on windows */ ? test.skip : test)('deleteFile - symbolic link (exists)', async () => {
const target = URI.file(join(testDir, 'lorem.txt'));
const link = URI.file(join(testDir, 'lorem.txt-linked'));
await symlink(target.fsPath, link.fsPath);
Expand All @@ -520,11 +504,7 @@ suite('Disk File Service', function () {
assert.equal(existsSync(target.fsPath), true); // target the link pointed to is never deleted
});

test('deleteFile - symbolic link (pointing to non-existing file)', async () => {
if (isWindows) {
return; // not reliable on windows
}

(isWindows /* not reliable on windows */ ? test.skip : test)('deleteFile - symbolic link (pointing to non-existing file)', async () => {
const target = URI.file(join(testDir, 'foo'));
const link = URI.file(join(testDir, 'bar'));
await symlink(target.fsPath, link.fsPath);
Expand Down Expand Up @@ -1409,11 +1389,7 @@ suite('Disk File Service', function () {
assert.equal(error!.fileOperationResult, FileOperationResult.FILE_IS_DIRECTORY);
});

test('readFile - FILE_NOT_DIRECTORY', async () => {
if (isWindows) {
return; // error code does not seem to be supported on windows
}

(isWindows /* error code does not seem to be supported on windows */ ? test.skip : test)('readFile - FILE_NOT_DIRECTORY', async () => {
const resource = URI.file(join(testDir, 'lorem.txt', 'file.txt'));

let error: FileOperationError | undefined = undefined;
Expand Down Expand Up @@ -1562,7 +1538,7 @@ suite('Disk File Service', function () {
return testFileTooLarge();
});

test('readFile - FILE_TOO_LARGE - streamed', async () => {
(isWindows /* not reliable on windows */ ? test.skip : test)('readFile - FILE_TOO_LARGE - streamed', async () => {
setCapabilities(fileProvider, FileSystemProviderCapabilities.FileReadStream);

return testFileTooLarge();
Expand Down
11 changes: 6 additions & 5 deletions src/vs/workbench/browser/labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,12 @@ class ResourceLabelWidget extends IconLabel {
}

private handleModelEvent(model: ITextModel): void {
if (!this.label || !this.label.resource) {
return; // only update if label exists
const resource = toResource(this.label);
if (!resource) {
return; // only update if resource exists
}

if (model.uri.toString() === this.label.resource.toString()) {
if (model.uri.toString() === resource.toString()) {
if (this.lastKnownDetectedModeId !== model.getModeId()) {
this.render(true); // update if the language id of the model has changed from our last known state
}
Expand Down Expand Up @@ -417,8 +418,8 @@ class ResourceLabelWidget extends IconLabel {
}

private clearIconCache(newLabel: IResourceLabelProps, newOptions?: IResourceLabelOptions): boolean {
const newResource = newLabel ? newLabel.resource : undefined;
const oldResource = this.label ? this.label.resource : undefined;
const newResource = toResource(newLabel);
const oldResource = toResource(this.label);

const newFileKind = newOptions ? newOptions.fileKind : undefined;
const oldFileKind = this.options ? this.options.fileKind : undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ export class ExtensionEditor extends BaseEditor {
}

async setInput(input: ExtensionsInput, options: EditorOptions | undefined, token: CancellationToken): Promise<void> {
await super.setInput(input, options, token);
if (this.template) {
await this.updateTemplate(input, this.template, !!options?.preserveFocus);
}
return super.setInput(input, options, token);
}

private async updateTemplate(input: ExtensionsInput, template: IExtensionEditorTemplate, preserveFocus: boolean): Promise<void> {
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/searchEditor/browser/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
export const OpenInEditorCommandId = 'search.action.openInEditor';
export const OpenNewEditorCommandId = 'search.action.openNewEditor';
export const OpenNewEditorToSideCommandId = 'search.action.openNewEditorToSide';
export const FocusQueryEditorWidgetCommandId = 'search.action.focusQueryEditorWidget';

export const ToggleSearchEditorCaseSensitiveCommandId = 'toggleSearchEditorCaseSensitive';
export const ToggleSearchEditorWholeWordCommandId = 'toggleSearchEditorWholeWord';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Extensions as EditorInputExtensions, IEditorInputFactory, IEditorInputF
import * as SearchConstants from 'vs/workbench/contrib/search/common/constants';
import * as SearchEditorConstants from 'vs/workbench/contrib/searchEditor/browser/constants';
import { SearchEditor } from 'vs/workbench/contrib/searchEditor/browser/searchEditor';
import { modifySearchEditorContextLinesCommand, OpenResultsInEditorAction, OpenSearchEditorAction, OpenSearchEditorToSideAction, RerunSearchEditorSearchAction, selectAllSearchEditorMatchesCommand, toggleSearchEditorCaseSensitiveCommand, toggleSearchEditorContextLinesCommand, toggleSearchEditorRegexCommand, toggleSearchEditorWholeWordCommand } from 'vs/workbench/contrib/searchEditor/browser/searchEditorActions';
import { modifySearchEditorContextLinesCommand, OpenResultsInEditorAction, OpenSearchEditorAction, OpenSearchEditorToSideAction, RerunSearchEditorSearchAction, selectAllSearchEditorMatchesCommand, toggleSearchEditorCaseSensitiveCommand, toggleSearchEditorContextLinesCommand, toggleSearchEditorRegexCommand, toggleSearchEditorWholeWordCommand, FocusQueryEditorWidgetAction } from 'vs/workbench/contrib/searchEditor/browser/searchEditorActions';
import { getOrMakeSearchEditorInput, SearchEditorInput, SearchConfiguration } from 'vs/workbench/contrib/searchEditor/browser/searchEditorInput';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { parseSavedSearchEditor } from 'vs/workbench/contrib/searchEditor/browser/searchEditorSerialization';
Expand Down Expand Up @@ -209,6 +209,10 @@ registry.registerWorkbenchAction(
registry.registerWorkbenchAction(SyncActionDescriptor.create(RerunSearchEditorSearchAction, RerunSearchEditorSearchAction.ID, RerunSearchEditorSearchAction.LABEL,
{ mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_R } }, ContextKeyExpr.and(SearchEditorConstants.InSearchEditor)),
'Search Editor: Search Again', category);

registry.registerWorkbenchAction(SyncActionDescriptor.create(FocusQueryEditorWidgetAction, FocusQueryEditorWidgetAction.ID, FocusQueryEditorWidgetAction.LABEL,
{ primary: KeyCode.Escape }, ContextKeyExpr.and(SearchEditorConstants.InSearchEditor)),
'Search Editor: Focus Query Editor Widget', category);
//#endregion


Expand Down
9 changes: 7 additions & 2 deletions src/vs/workbench/contrib/searchEditor/browser/searchEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ export class SearchEditor extends BaseTextEditor {

this._register(this.onDidBlur(() => this.saveViewState()));

this._register(this.searchResultEditor.onKeyDown(e => e.keyCode === KeyCode.Escape && this.queryEditorWidget.searchInput.focus()));

this._register(this.searchResultEditor.onDidChangeModelContent(() => this.getInput()?.setDirty(true)));

[this.queryEditorWidget.searchInputFocusTracker, this.queryEditorWidget.replaceInputFocusTracker, this.inputPatternExcludes.inputFocusTracker, this.inputPatternIncludes.inputFocusTracker]
Expand All @@ -248,6 +246,13 @@ export class SearchEditor extends BaseTextEditor {
}
}

focusSearchInput() {
const viewState = this.loadViewState();
if (viewState && viewState.focused === 'editor') {
this.queryEditorWidget.searchInput.focus();
}
}

focusNextInput() {
if (this.queryEditorWidget.searchInputHasFocus()) {
if (this.showingIncludesExcludes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,24 @@ export class RerunSearchEditorSearchAction extends Action {
}
}

export class FocusQueryEditorWidgetAction extends Action {
static readonly ID: string = Constants.FocusQueryEditorWidgetCommandId;
static readonly LABEL = localize('search.action.focusQueryEditorWidget', "Focus Query Editor Widget");

constructor(id: string, label: string,
@IEditorService private readonly editorService: IEditorService,
) {
super(id, label);
}

async run() {
const input = this.editorService.activeEditor;
if (input instanceof SearchEditorInput) {
(this.editorService.activeEditorPane as SearchEditor).focusSearchInput();
}
}
}

const openNewSearchEditor =
async (accessor: ServicesAccessor, toSide = false) => {
const editorService = accessor.get(IEditorService);
Expand Down
Loading

0 comments on commit ee1b1df

Please sign in to comment.