This commit is contained in:
Alex Dima
2018-07-03 15:52:40 +02:00
parent b778e7f538
commit 560c87ffd3
4 changed files with 15 additions and 6 deletions
+1 -1
View File
@@ -397,7 +397,7 @@ export interface IEditorOptions {
/**
* Configure the editor's hover.
*/
hover?: boolean | IEditorHoverOptions;
hover?: IEditorHoverOptions;
/**
* Enable detecting links and making them clickable.
* Defaults to true.
@@ -142,7 +142,9 @@ export class ContextMenuController implements IEditorContribution {
// Disable hover
const oldHoverSetting = this._editor.getConfiguration().contribInfo.hover;
this._editor.updateOptions({
hover: false
hover: {
enabled: false
}
});
let menuPosition = forcedPosition;
+1 -1
View File
@@ -2736,7 +2736,7 @@ declare namespace monaco.editor {
/**
* Configure the editor's hover.
*/
hover?: boolean | IEditorHoverOptions;
hover?: IEditorHoverOptions;
/**
* Enable detecting links and making them clickable.
* Defaults to true.
@@ -46,6 +46,7 @@ import { ContextSubMenu } from 'vs/base/browser/contextmenu';
import { memoize } from 'vs/base/common/decorators';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { getHover } from 'vs/editor/contrib/hover/getHover';
import { IEditorHoverOptions } from 'vs/editor/common/config/editorOptions';
const HOVER_DELAY = 300;
const LAUNCH_JSON_REGEX = /launch\.json$/;
@@ -281,7 +282,9 @@ export class DebugEditorContribution implements IDebugEditorContribution {
private _applyHoverConfiguration(model: ITextModel, stackFrame: IStackFrame): void {
if (stackFrame && model && model.uri.toString() === stackFrame.source.uri.toString()) {
this.editor.updateOptions({
hover: !stackFrame || !model || model.uri.toString() !== stackFrame.source.uri.toString()
hover: {
enabled: !stackFrame || !model || model.uri.toString() !== stackFrame.source.uri.toString()
}
});
} else {
let overrides: IConfigurationOverrides;
@@ -291,9 +294,13 @@ export class DebugEditorContribution implements IDebugEditorContribution {
overrideIdentifier: model.getLanguageIdentifier().language
};
}
const defaultConfiguration = this.configurationService.getValue('editor.hover', overrides);
const defaultConfiguration = this.configurationService.getValue<IEditorHoverOptions>('editor.hover', overrides);
this.editor.updateOptions({
hover: defaultConfiguration
hover: {
enabled: defaultConfiguration.enabled,
delay: defaultConfiguration.delay,
sticky: defaultConfiguration.sticky
}
});
}
}