提交 b1ddc1ac 编写于 作者: J Johannes Rieken

add new setting editor.codeLens and deprecate the old editor.referenceInfos settings, #10238

上级 655efbc2
...@@ -852,7 +852,7 @@ export class DiffEditorWidget extends EventEmitter implements editorBrowser.IDif ...@@ -852,7 +852,7 @@ export class DiffEditorWidget extends EventEmitter implements editorBrowser.IDif
clonedOptions.scrollbar = clonedOptions.scrollbar || {}; clonedOptions.scrollbar = clonedOptions.scrollbar || {};
clonedOptions.scrollbar.vertical = 'visible'; clonedOptions.scrollbar.vertical = 'visible';
clonedOptions.folding = false; clonedOptions.folding = false;
clonedOptions.referenceInfos = false; clonedOptions.codeLens = false;
return clonedOptions; return clonedOptions;
} }
......
...@@ -265,7 +265,7 @@ class InternalEditorOptionsHelper { ...@@ -265,7 +265,7 @@ class InternalEditorOptionsHelper {
tabCompletion: opts.tabCompletion, tabCompletion: opts.tabCompletion,
wordBasedSuggestions: opts.wordBasedSuggestions, wordBasedSuggestions: opts.wordBasedSuggestions,
selectionHighlight: toBoolean(opts.selectionHighlight), selectionHighlight: toBoolean(opts.selectionHighlight),
referenceInfos: toBoolean(opts.referenceInfos), codeLens: opts.referenceInfos && opts.codeLens,
folding: toBoolean(opts.folding), folding: toBoolean(opts.folding),
}); });
...@@ -762,10 +762,10 @@ let editorConfiguration:IConfigurationNode = { ...@@ -762,10 +762,10 @@ let editorConfiguration:IConfigurationNode = {
default: DefaultConfig.editor.renderIndentGuides, default: DefaultConfig.editor.renderIndentGuides,
description: nls.localize('renderIndentGuides', "Controls whether the editor should render indent guides") description: nls.localize('renderIndentGuides', "Controls whether the editor should render indent guides")
}, },
'editor.referenceInfos' : { 'editor.codeLens' : {
'type': 'boolean', 'type': 'boolean',
'default': DefaultConfig.editor.referenceInfos, 'default': DefaultConfig.editor.codeLens,
'description': nls.localize('referenceInfos', "Controls if the editor shows reference information for the modes that support it") 'description': nls.localize('codeLens', "Controls if the editor shows code lenses")
}, },
'editor.folding' : { 'editor.folding' : {
'type': 'boolean', 'type': 'boolean',
......
...@@ -87,6 +87,7 @@ class ConfigClass implements IConfiguration { ...@@ -87,6 +87,7 @@ class ConfigClass implements IConfiguration {
tabCompletion: false, tabCompletion: false,
wordBasedSuggestions: true, wordBasedSuggestions: true,
selectionHighlight: true, selectionHighlight: true,
codeLens: true,
referenceInfos: true, referenceInfos: true,
folding: true, folding: true,
renderWhitespace: false, renderWhitespace: false,
......
...@@ -408,9 +408,14 @@ export interface IEditorOptions { ...@@ -408,9 +408,14 @@ export interface IEditorOptions {
*/ */
selectionHighlight?:boolean; selectionHighlight?:boolean;
/** /**
* Show reference infos (a.k.a. code lenses) for modes that support it * Show code lens
* Defaults to true. * Defaults to true.
*/ */
codeLens?: boolean;
/**
* @deprecated - use codeLens instead
* @internal
*/
referenceInfos?: boolean; referenceInfos?: boolean;
/** /**
* Enable code folding * Enable code folding
...@@ -815,7 +820,7 @@ export class EditorContribOptions { ...@@ -815,7 +820,7 @@ export class EditorContribOptions {
tabCompletion: boolean; tabCompletion: boolean;
wordBasedSuggestions: boolean; wordBasedSuggestions: boolean;
selectionHighlight:boolean; selectionHighlight:boolean;
referenceInfos: boolean; codeLens: boolean;
folding: boolean; folding: boolean;
/** /**
...@@ -836,7 +841,7 @@ export class EditorContribOptions { ...@@ -836,7 +841,7 @@ export class EditorContribOptions {
tabCompletion: boolean; tabCompletion: boolean;
wordBasedSuggestions: boolean; wordBasedSuggestions: boolean;
selectionHighlight:boolean; selectionHighlight:boolean;
referenceInfos: boolean; codeLens: boolean;
folding: boolean; folding: boolean;
}) { }) {
this.selectionClipboard = Boolean(source.selectionClipboard); this.selectionClipboard = Boolean(source.selectionClipboard);
...@@ -853,7 +858,7 @@ export class EditorContribOptions { ...@@ -853,7 +858,7 @@ export class EditorContribOptions {
this.tabCompletion = source.tabCompletion; this.tabCompletion = source.tabCompletion;
this.wordBasedSuggestions = source.wordBasedSuggestions; this.wordBasedSuggestions = source.wordBasedSuggestions;
this.selectionHighlight = Boolean(source.selectionHighlight); this.selectionHighlight = Boolean(source.selectionHighlight);
this.referenceInfos = Boolean(source.referenceInfos); this.codeLens = Boolean(source.codeLens);
this.folding = Boolean(source.folding); this.folding = Boolean(source.folding);
} }
...@@ -876,7 +881,7 @@ export class EditorContribOptions { ...@@ -876,7 +881,7 @@ export class EditorContribOptions {
&& this.tabCompletion === other.tabCompletion && this.tabCompletion === other.tabCompletion
&& this.wordBasedSuggestions === other.wordBasedSuggestions && this.wordBasedSuggestions === other.wordBasedSuggestions
&& this.selectionHighlight === other.selectionHighlight && this.selectionHighlight === other.selectionHighlight
&& this.referenceInfos === other.referenceInfos && this.codeLens === other.codeLens
&& this.folding === other.folding && this.folding === other.folding
); );
} }
......
...@@ -354,7 +354,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { ...@@ -354,7 +354,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
@ICommandService private _commandService: ICommandService, @ICommandService private _commandService: ICommandService,
@IMessageService private _messageService: IMessageService @IMessageService private _messageService: IMessageService
) { ) {
this._isEnabled = this._editor.getConfiguration().contribInfo.referenceInfos; this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens;
this._globalToDispose = []; this._globalToDispose = [];
this._localToDispose = []; this._localToDispose = [];
...@@ -366,7 +366,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { ...@@ -366,7 +366,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
this._globalToDispose.push(this._editor.onDidChangeModelMode(() => this.onModelChange())); this._globalToDispose.push(this._editor.onDidChangeModelMode(() => this.onModelChange()));
this._globalToDispose.push(this._editor.onDidChangeConfiguration((e: editorCommon.IConfigurationChangedEvent) => { this._globalToDispose.push(this._editor.onDidChangeConfiguration((e: editorCommon.IConfigurationChangedEvent) => {
let prevIsEnabled = this._isEnabled; let prevIsEnabled = this._isEnabled;
this._isEnabled = this._editor.getConfiguration().contribInfo.referenceInfos; this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens;
if (prevIsEnabled !== this._isEnabled) { if (prevIsEnabled !== this._isEnabled) {
this.onModelChange(); this.onModelChange();
} }
......
...@@ -1262,10 +1262,10 @@ declare module monaco.editor { ...@@ -1262,10 +1262,10 @@ declare module monaco.editor {
*/ */
selectionHighlight?: boolean; selectionHighlight?: boolean;
/** /**
* Show reference infos (a.k.a. code lenses) for modes that support it * Show code lens
* Defaults to true. * Defaults to true.
*/ */
referenceInfos?: boolean; codeLens?: boolean;
/** /**
* Enable code folding * Enable code folding
* Defaults to true. * Defaults to true.
...@@ -1422,7 +1422,7 @@ declare module monaco.editor { ...@@ -1422,7 +1422,7 @@ declare module monaco.editor {
tabCompletion: boolean; tabCompletion: boolean;
wordBasedSuggestions: boolean; wordBasedSuggestions: boolean;
selectionHighlight: boolean; selectionHighlight: boolean;
referenceInfos: boolean; codeLens: boolean;
folding: boolean; folding: boolean;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册