提交 58b6c829 编写于 作者: J Johannes Rieken

fix #71215

上级 50c1d7da
......@@ -828,15 +828,15 @@ const editorConfiguration: IConfigurationNode = {
},
}
},
'editor.gotoLocation.many': {
description: nls.localize('editor.gotoLocation.many', "Controls the behaviour of 'go to'-commands, like go to definition, when multiple target locations exist."),
'editor.gotoLocation.multiple': {
description: nls.localize('editor.gotoLocation.multiple', "Controls the behaviour of 'go to'-commands, like go to definition, when multiple target locations exist."),
type: 'string',
enum: ['peek', 'revealAndPeek', 'reveal'],
default: 'peek',
default: EDITOR_DEFAULTS.contribInfo.gotoLocation.multiple,
enumDescriptions: [
nls.localize('editor.gotoLocation.many.peek', 'Show peek view of the results at the request location'),
nls.localize('editor.gotoLocation.many.revealAndPeek', 'Reveal the first result and show peek view at its location'),
nls.localize('editor.gotoLocation.many.reveal', 'Reveal the first result and ignore others')
nls.localize('editor.gotoLocation.multiple.peek', 'Show peek view of the results at the request location'),
nls.localize('editor.gotoLocation.multiple.revealAndPeek', 'Reveal the first result and show peek view at its location'),
nls.localize('editor.gotoLocation.multiple.reveal', 'Reveal the first result and ignore others')
]
},
'editor.selectionHighlight': {
......
......@@ -936,7 +936,7 @@ export interface InternalEditorHoverOptions {
}
export interface InternalGoToLocationOptions {
readonly many: 'peek' | 'revealAndPeek' | 'reveal';
readonly multiple: 'peek' | 'revealAndPeek' | 'reveal';
}
export interface InternalSuggestOptions {
......@@ -1411,7 +1411,7 @@ export class InternalEditorOptions {
} else if (!a || !b) {
return false;
} else {
return a.many === b.many;
return a.multiple === b.multiple;
}
}
......@@ -1954,7 +1954,7 @@ export class EditorOptionsValidator {
private static _santizeGotoLocationOpts(opts: IEditorOptions, defaults: InternalGoToLocationOptions): InternalGoToLocationOptions {
const gotoOpts = opts.gotoLocation || {};
return {
many: _stringSet<'peek' | 'revealAndPeek' | 'reveal'>(gotoOpts.many, defaults.many, ['peek', 'revealAndPeek', 'reveal'])
multiple: _stringSet<'peek' | 'revealAndPeek' | 'reveal'>(gotoOpts.many, defaults.multiple, ['peek', 'revealAndPeek', 'reveal'])
};
}
......@@ -2719,7 +2719,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
filteredTypes: Object.create(null)
},
gotoLocation: {
many: 'peek'
multiple: 'peek'
},
selectionHighlight: true,
occurrencesHighlight: true,
......
......@@ -131,13 +131,13 @@ export class DefinitionAction extends EditorAction {
alert(msg);
const { gotoLocation } = editor.getConfiguration().contribInfo;
if (this._configuration.openInPeek || (gotoLocation.many === 'peek' && model.references.length > 1)) {
if (this._configuration.openInPeek || (gotoLocation.multiple === 'peek' && model.references.length > 1)) {
this._openInPeek(editorService, editor, model);
} else if (editor.hasModel()) {
const next = model.nearestReference(editor.getModel().uri, editor.getPosition());
if (next) {
const targetEditor = await this._openReference(editor, editorService, next, this._configuration.openToSide);
if (targetEditor && model.references.length > 1 && gotoLocation.many === 'revealAndPeek') {
if (targetEditor && model.references.length > 1 && gotoLocation.multiple === 'revealAndPeek') {
this._openInPeek(editorService, targetEditor, model);
} else {
model.dispose();
......
......@@ -3208,7 +3208,7 @@ declare namespace monaco.editor {
}
export interface InternalGoToLocationOptions {
readonly many: 'peek' | 'revealAndPeek' | 'reveal';
readonly multiple: 'peek' | 'revealAndPeek' | 'reveal';
}
export interface InternalSuggestOptions {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册