mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
Double click on file name to peek. Closes #89467
This commit is contained in:
@@ -77,9 +77,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
const lineResult = parseSearchResults(document, token)[position.line];
|
||||
if (!lineResult) { return []; }
|
||||
if (lineResult.type === 'file') {
|
||||
// TODO: The multi-match peek UX isnt very smooth.
|
||||
// return lineResult.allLocations.length > 1 ? lineResult.allLocations : [lineResult.location];
|
||||
return [];
|
||||
return lineResult.allLocations;
|
||||
}
|
||||
|
||||
const translateRangeSidewaysBy = (r: vscode.Range, n: number) =>
|
||||
|
||||
@@ -43,6 +43,7 @@ import { searchEditorFindMatchBorder, searchEditorFindMatch, registerColor, inpu
|
||||
import { attachInputBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
|
||||
const RESULT_LINE_REGEX = /^(\s+)(\d+)(:| )(\s+)(.*)$/;
|
||||
const FILE_LINE_REGEX = /^(\S.*):$/;
|
||||
|
||||
export class SearchEditor extends BaseEditor {
|
||||
static readonly ID: string = 'workbench.editor.searchEditor';
|
||||
@@ -168,6 +169,9 @@ export class SearchEditor extends BaseEditor {
|
||||
if (line.match(RESULT_LINE_REGEX)) {
|
||||
this.searchResultEditor.setSelection(Range.fromPositions(position));
|
||||
this.commandService.executeCommand(behaviour === 'goToLocation' ? 'editor.action.goToDeclaration' : 'editor.action.openDeclarationToTheSide');
|
||||
} else if (line.match(FILE_LINE_REGEX)) {
|
||||
this.searchResultEditor.setSelection(Range.fromPositions(position));
|
||||
this.commandService.executeCommand('editor.action.peekDefinition');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user