提交 08226629 编写于 作者: G Gustavo Cassel

Developed setting 'mouseOpensDefinitionInPeek' which controls whether the...

Developed setting 'mouseOpensDefinitionInPeek' which controls whether the mouse click opens element definition in the peek widget.
上级 e0c029b1
...@@ -555,6 +555,11 @@ export interface IEditorOptions { ...@@ -555,6 +555,11 @@ export interface IEditorOptions {
* Defaults to false. * Defaults to false.
*/ */
peekWidgetDefaultFocus?: 'tree' | 'editor'; peekWidgetDefaultFocus?: 'tree' | 'editor';
/**
* Controls whether the mouse click opens element definition in the peek widget.
* Defaults to false.
*/
mouseOpensDefinitionInPeek?: boolean;
} }
export interface IEditorConstructionOptions extends IEditorOptions { export interface IEditorConstructionOptions extends IEditorOptions {
...@@ -3192,6 +3197,7 @@ export const enum EditorOption { ...@@ -3192,6 +3197,7 @@ export const enum EditorOption {
overviewRulerLanes, overviewRulerLanes,
parameterHints, parameterHints,
peekWidgetDefaultFocus, peekWidgetDefaultFocus,
mouseOpensDefinitionInPeek,
quickSuggestions, quickSuggestions,
quickSuggestionsDelay, quickSuggestionsDelay,
readOnly, readOnly,
...@@ -3583,6 +3589,10 @@ export const EditorOptions = { ...@@ -3583,6 +3589,10 @@ export const EditorOptions = {
description: nls.localize('peekWidgetDefaultFocus', "Controls whether to focus the inline editor or the tree in the peek widget.") description: nls.localize('peekWidgetDefaultFocus', "Controls whether to focus the inline editor or the tree in the peek widget.")
} }
)), )),
mouseOpensDefinitionInPeek: register(new EditorBooleanOption(
EditorOption.mouseOpensDefinitionInPeek, 'mouseOpensDefinitionInPeek', false,
{ description: nls.localize('mouseOpensDefinitionInPeek', "Controls whether the mouse click opens element definition in the peek widget.") }
)),
quickSuggestions: register(new EditorQuickSuggestions()), quickSuggestions: register(new EditorQuickSuggestions()),
quickSuggestionsDelay: register(new EditorIntOption( quickSuggestionsDelay: register(new EditorIntOption(
EditorOption.quickSuggestionsDelay, 'quickSuggestionsDelay', EditorOption.quickSuggestionsDelay, 'quickSuggestionsDelay',
......
...@@ -231,50 +231,51 @@ export enum EditorOption { ...@@ -231,50 +231,51 @@ export enum EditorOption {
overviewRulerLanes = 63, overviewRulerLanes = 63,
parameterHints = 64, parameterHints = 64,
peekWidgetDefaultFocus = 65, peekWidgetDefaultFocus = 65,
quickSuggestions = 66, mouseOpensDefinitionInPeek = 66,
quickSuggestionsDelay = 67, quickSuggestions = 67,
readOnly = 68, quickSuggestionsDelay = 68,
renderControlCharacters = 69, readOnly = 69,
renderIndentGuides = 70, renderControlCharacters = 70,
renderFinalNewline = 71, renderIndentGuides = 71,
renderLineHighlight = 72, renderFinalNewline = 72,
renderValidationDecorations = 73, renderLineHighlight = 73,
renderWhitespace = 74, renderValidationDecorations = 74,
revealHorizontalRightPadding = 75, renderWhitespace = 75,
roundedSelection = 76, revealHorizontalRightPadding = 76,
rulers = 77, roundedSelection = 77,
scrollbar = 78, rulers = 78,
scrollBeyondLastColumn = 79, scrollbar = 79,
scrollBeyondLastLine = 80, scrollBeyondLastColumn = 80,
selectionClipboard = 81, scrollBeyondLastLine = 81,
selectionHighlight = 82, selectionClipboard = 82,
selectOnLineNumbers = 83, selectionHighlight = 83,
semanticHighlighting = 84, selectOnLineNumbers = 84,
showFoldingControls = 85, semanticHighlighting = 85,
showUnused = 86, showFoldingControls = 86,
snippetSuggestions = 87, showUnused = 87,
smoothScrolling = 88, snippetSuggestions = 88,
stopRenderingLineAfter = 89, smoothScrolling = 89,
suggest = 90, stopRenderingLineAfter = 90,
suggestFontSize = 91, suggest = 91,
suggestLineHeight = 92, suggestFontSize = 92,
suggestOnTriggerCharacters = 93, suggestLineHeight = 93,
suggestSelection = 94, suggestOnTriggerCharacters = 94,
tabCompletion = 95, suggestSelection = 95,
useTabStops = 96, tabCompletion = 96,
wordSeparators = 97, useTabStops = 97,
wordWrap = 98, wordSeparators = 98,
wordWrapBreakAfterCharacters = 99, wordWrap = 99,
wordWrapBreakBeforeCharacters = 100, wordWrapBreakAfterCharacters = 100,
wordWrapColumn = 101, wordWrapBreakBeforeCharacters = 101,
wordWrapMinified = 102, wordWrapColumn = 102,
wrappingIndent = 103, wordWrapMinified = 103,
wrappingStrategy = 104, wrappingIndent = 104,
editorClassName = 105, wrappingStrategy = 105,
pixelRatio = 106, editorClassName = 106,
tabFocusMode = 107, pixelRatio = 107,
layoutInfo = 108, tabFocusMode = 108,
wrappingInfo = 109 layoutInfo = 109,
wrappingInfo = 110
} }
/** /**
......
...@@ -27,6 +27,7 @@ import { IWordAtPosition, IModelDeltaDecoration, ITextModel, IFoundBracket } fro ...@@ -27,6 +27,7 @@ import { IWordAtPosition, IModelDeltaDecoration, ITextModel, IFoundBracket } fro
import { Position } from 'vs/editor/common/core/position'; import { Position } from 'vs/editor/common/core/position';
import { withNullAsUndefined } from 'vs/base/common/types'; import { withNullAsUndefined } from 'vs/base/common/types';
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { EditorOption } from 'vs/editor/common/config/editorOptions';
export class GotoDefinitionAtPositionEditorContribution implements IEditorContribution { export class GotoDefinitionAtPositionEditorContribution implements IEditorContribution {
...@@ -334,7 +335,8 @@ export class GotoDefinitionAtPositionEditorContribution implements IEditorContri ...@@ -334,7 +335,8 @@ export class GotoDefinitionAtPositionEditorContribution implements IEditorContri
private gotoDefinition(position: Position, openToSide: boolean): Promise<any> { private gotoDefinition(position: Position, openToSide: boolean): Promise<any> {
this.editor.setPosition(position); this.editor.setPosition(position);
const action = new DefinitionAction({ openToSide, openInPeek: false, muteMessage: true }, { alias: '', label: '', id: '', precondition: undefined }); const openInPeek = this.editor.getOption(EditorOption.mouseOpensDefinitionInPeek);
const action = new DefinitionAction({ openToSide, openInPeek: openInPeek, muteMessage: true }, { alias: '', label: '', id: '', precondition: undefined });
return this.editor.invokeWithinContext(accessor => action.run(accessor, this.editor)); return this.editor.invokeWithinContext(accessor => action.run(accessor, this.editor));
} }
......
...@@ -3035,6 +3035,11 @@ declare namespace monaco.editor { ...@@ -3035,6 +3035,11 @@ declare namespace monaco.editor {
* Defaults to false. * Defaults to false.
*/ */
peekWidgetDefaultFocus?: 'tree' | 'editor'; peekWidgetDefaultFocus?: 'tree' | 'editor';
/**
* Controls whether the mouse click opens element definition in the peek widget.
* Defaults to false.
*/
mouseOpensDefinitionInPeek?: boolean;
} }
export interface IEditorConstructionOptions extends IEditorOptions { export interface IEditorConstructionOptions extends IEditorOptions {
...@@ -3761,50 +3766,51 @@ declare namespace monaco.editor { ...@@ -3761,50 +3766,51 @@ declare namespace monaco.editor {
overviewRulerLanes = 63, overviewRulerLanes = 63,
parameterHints = 64, parameterHints = 64,
peekWidgetDefaultFocus = 65, peekWidgetDefaultFocus = 65,
quickSuggestions = 66, mouseOpensDefinitionInPeek = 66,
quickSuggestionsDelay = 67, quickSuggestions = 67,
readOnly = 68, quickSuggestionsDelay = 68,
renderControlCharacters = 69, readOnly = 69,
renderIndentGuides = 70, renderControlCharacters = 70,
renderFinalNewline = 71, renderIndentGuides = 71,
renderLineHighlight = 72, renderFinalNewline = 72,
renderValidationDecorations = 73, renderLineHighlight = 73,
renderWhitespace = 74, renderValidationDecorations = 74,
revealHorizontalRightPadding = 75, renderWhitespace = 75,
roundedSelection = 76, revealHorizontalRightPadding = 76,
rulers = 77, roundedSelection = 77,
scrollbar = 78, rulers = 78,
scrollBeyondLastColumn = 79, scrollbar = 79,
scrollBeyondLastLine = 80, scrollBeyondLastColumn = 80,
selectionClipboard = 81, scrollBeyondLastLine = 81,
selectionHighlight = 82, selectionClipboard = 82,
selectOnLineNumbers = 83, selectionHighlight = 83,
semanticHighlighting = 84, selectOnLineNumbers = 84,
showFoldingControls = 85, semanticHighlighting = 85,
showUnused = 86, showFoldingControls = 86,
snippetSuggestions = 87, showUnused = 87,
smoothScrolling = 88, snippetSuggestions = 88,
stopRenderingLineAfter = 89, smoothScrolling = 89,
suggest = 90, stopRenderingLineAfter = 90,
suggestFontSize = 91, suggest = 91,
suggestLineHeight = 92, suggestFontSize = 92,
suggestOnTriggerCharacters = 93, suggestLineHeight = 93,
suggestSelection = 94, suggestOnTriggerCharacters = 94,
tabCompletion = 95, suggestSelection = 95,
useTabStops = 96, tabCompletion = 96,
wordSeparators = 97, useTabStops = 97,
wordWrap = 98, wordSeparators = 98,
wordWrapBreakAfterCharacters = 99, wordWrap = 99,
wordWrapBreakBeforeCharacters = 100, wordWrapBreakAfterCharacters = 100,
wordWrapColumn = 101, wordWrapBreakBeforeCharacters = 101,
wordWrapMinified = 102, wordWrapColumn = 102,
wrappingIndent = 103, wordWrapMinified = 103,
wrappingStrategy = 104, wrappingIndent = 104,
editorClassName = 105, wrappingStrategy = 105,
pixelRatio = 106, editorClassName = 106,
tabFocusMode = 107, pixelRatio = 107,
layoutInfo = 108, tabFocusMode = 108,
wrappingInfo = 109 layoutInfo = 109,
wrappingInfo = 110
} }
export const EditorOptions: { export const EditorOptions: {
acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>; acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>;
...@@ -3873,6 +3879,7 @@ declare namespace monaco.editor { ...@@ -3873,6 +3879,7 @@ declare namespace monaco.editor {
overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>; overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>;
parameterHints: IEditorOption<EditorOption.parameterHints, InternalParameterHintOptions>; parameterHints: IEditorOption<EditorOption.parameterHints, InternalParameterHintOptions>;
peekWidgetDefaultFocus: IEditorOption<EditorOption.peekWidgetDefaultFocus, 'tree' | 'editor'>; peekWidgetDefaultFocus: IEditorOption<EditorOption.peekWidgetDefaultFocus, 'tree' | 'editor'>;
mouseOpensDefinitionInPeek: IEditorOption<EditorOption.mouseOpensDefinitionInPeek, boolean>;
quickSuggestions: IEditorOption<EditorOption.quickSuggestions, ValidQuickSuggestionsOptions>; quickSuggestions: IEditorOption<EditorOption.quickSuggestions, ValidQuickSuggestionsOptions>;
quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>; quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>;
readOnly: IEditorOption<EditorOption.readOnly, boolean>; readOnly: IEditorOption<EditorOption.readOnly, boolean>;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册