提交 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 {
* Defaults to false.
*/
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 {
......@@ -3192,6 +3197,7 @@ export const enum EditorOption {
overviewRulerLanes,
parameterHints,
peekWidgetDefaultFocus,
mouseOpensDefinitionInPeek,
quickSuggestions,
quickSuggestionsDelay,
readOnly,
......@@ -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.")
}
)),
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()),
quickSuggestionsDelay: register(new EditorIntOption(
EditorOption.quickSuggestionsDelay, 'quickSuggestionsDelay',
......
......@@ -231,50 +231,51 @@ export enum EditorOption {
overviewRulerLanes = 63,
parameterHints = 64,
peekWidgetDefaultFocus = 65,
quickSuggestions = 66,
quickSuggestionsDelay = 67,
readOnly = 68,
renderControlCharacters = 69,
renderIndentGuides = 70,
renderFinalNewline = 71,
renderLineHighlight = 72,
renderValidationDecorations = 73,
renderWhitespace = 74,
revealHorizontalRightPadding = 75,
roundedSelection = 76,
rulers = 77,
scrollbar = 78,
scrollBeyondLastColumn = 79,
scrollBeyondLastLine = 80,
selectionClipboard = 81,
selectionHighlight = 82,
selectOnLineNumbers = 83,
semanticHighlighting = 84,
showFoldingControls = 85,
showUnused = 86,
snippetSuggestions = 87,
smoothScrolling = 88,
stopRenderingLineAfter = 89,
suggest = 90,
suggestFontSize = 91,
suggestLineHeight = 92,
suggestOnTriggerCharacters = 93,
suggestSelection = 94,
tabCompletion = 95,
useTabStops = 96,
wordSeparators = 97,
wordWrap = 98,
wordWrapBreakAfterCharacters = 99,
wordWrapBreakBeforeCharacters = 100,
wordWrapColumn = 101,
wordWrapMinified = 102,
wrappingIndent = 103,
wrappingStrategy = 104,
editorClassName = 105,
pixelRatio = 106,
tabFocusMode = 107,
layoutInfo = 108,
wrappingInfo = 109
mouseOpensDefinitionInPeek = 66,
quickSuggestions = 67,
quickSuggestionsDelay = 68,
readOnly = 69,
renderControlCharacters = 70,
renderIndentGuides = 71,
renderFinalNewline = 72,
renderLineHighlight = 73,
renderValidationDecorations = 74,
renderWhitespace = 75,
revealHorizontalRightPadding = 76,
roundedSelection = 77,
rulers = 78,
scrollbar = 79,
scrollBeyondLastColumn = 80,
scrollBeyondLastLine = 81,
selectionClipboard = 82,
selectionHighlight = 83,
selectOnLineNumbers = 84,
semanticHighlighting = 85,
showFoldingControls = 86,
showUnused = 87,
snippetSuggestions = 88,
smoothScrolling = 89,
stopRenderingLineAfter = 90,
suggest = 91,
suggestFontSize = 92,
suggestLineHeight = 93,
suggestOnTriggerCharacters = 94,
suggestSelection = 95,
tabCompletion = 96,
useTabStops = 97,
wordSeparators = 98,
wordWrap = 99,
wordWrapBreakAfterCharacters = 100,
wordWrapBreakBeforeCharacters = 101,
wordWrapColumn = 102,
wordWrapMinified = 103,
wrappingIndent = 104,
wrappingStrategy = 105,
editorClassName = 106,
pixelRatio = 107,
tabFocusMode = 108,
layoutInfo = 109,
wrappingInfo = 110
}
/**
......
......@@ -27,6 +27,7 @@ import { IWordAtPosition, IModelDeltaDecoration, ITextModel, IFoundBracket } fro
import { Position } from 'vs/editor/common/core/position';
import { withNullAsUndefined } from 'vs/base/common/types';
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { EditorOption } from 'vs/editor/common/config/editorOptions';
export class GotoDefinitionAtPositionEditorContribution implements IEditorContribution {
......@@ -334,7 +335,8 @@ export class GotoDefinitionAtPositionEditorContribution implements IEditorContri
private gotoDefinition(position: Position, openToSide: boolean): Promise<any> {
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));
}
......
......@@ -3035,6 +3035,11 @@ declare namespace monaco.editor {
* Defaults to false.
*/
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 {
......@@ -3761,50 +3766,51 @@ declare namespace monaco.editor {
overviewRulerLanes = 63,
parameterHints = 64,
peekWidgetDefaultFocus = 65,
quickSuggestions = 66,
quickSuggestionsDelay = 67,
readOnly = 68,
renderControlCharacters = 69,
renderIndentGuides = 70,
renderFinalNewline = 71,
renderLineHighlight = 72,
renderValidationDecorations = 73,
renderWhitespace = 74,
revealHorizontalRightPadding = 75,
roundedSelection = 76,
rulers = 77,
scrollbar = 78,
scrollBeyondLastColumn = 79,
scrollBeyondLastLine = 80,
selectionClipboard = 81,
selectionHighlight = 82,
selectOnLineNumbers = 83,
semanticHighlighting = 84,
showFoldingControls = 85,
showUnused = 86,
snippetSuggestions = 87,
smoothScrolling = 88,
stopRenderingLineAfter = 89,
suggest = 90,
suggestFontSize = 91,
suggestLineHeight = 92,
suggestOnTriggerCharacters = 93,
suggestSelection = 94,
tabCompletion = 95,
useTabStops = 96,
wordSeparators = 97,
wordWrap = 98,
wordWrapBreakAfterCharacters = 99,
wordWrapBreakBeforeCharacters = 100,
wordWrapColumn = 101,
wordWrapMinified = 102,
wrappingIndent = 103,
wrappingStrategy = 104,
editorClassName = 105,
pixelRatio = 106,
tabFocusMode = 107,
layoutInfo = 108,
wrappingInfo = 109
mouseOpensDefinitionInPeek = 66,
quickSuggestions = 67,
quickSuggestionsDelay = 68,
readOnly = 69,
renderControlCharacters = 70,
renderIndentGuides = 71,
renderFinalNewline = 72,
renderLineHighlight = 73,
renderValidationDecorations = 74,
renderWhitespace = 75,
revealHorizontalRightPadding = 76,
roundedSelection = 77,
rulers = 78,
scrollbar = 79,
scrollBeyondLastColumn = 80,
scrollBeyondLastLine = 81,
selectionClipboard = 82,
selectionHighlight = 83,
selectOnLineNumbers = 84,
semanticHighlighting = 85,
showFoldingControls = 86,
showUnused = 87,
snippetSuggestions = 88,
smoothScrolling = 89,
stopRenderingLineAfter = 90,
suggest = 91,
suggestFontSize = 92,
suggestLineHeight = 93,
suggestOnTriggerCharacters = 94,
suggestSelection = 95,
tabCompletion = 96,
useTabStops = 97,
wordSeparators = 98,
wordWrap = 99,
wordWrapBreakAfterCharacters = 100,
wordWrapBreakBeforeCharacters = 101,
wordWrapColumn = 102,
wordWrapMinified = 103,
wrappingIndent = 104,
wrappingStrategy = 105,
editorClassName = 106,
pixelRatio = 107,
tabFocusMode = 108,
layoutInfo = 109,
wrappingInfo = 110
}
export const EditorOptions: {
acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>;
......@@ -3873,6 +3879,7 @@ declare namespace monaco.editor {
overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>;
parameterHints: IEditorOption<EditorOption.parameterHints, InternalParameterHintOptions>;
peekWidgetDefaultFocus: IEditorOption<EditorOption.peekWidgetDefaultFocus, 'tree' | 'editor'>;
mouseOpensDefinitionInPeek: IEditorOption<EditorOption.mouseOpensDefinitionInPeek, boolean>;
quickSuggestions: IEditorOption<EditorOption.quickSuggestions, ValidQuickSuggestionsOptions>;
quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>;
readOnly: IEditorOption<EditorOption.readOnly, boolean>;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册