diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index 859815e73b5e0da80a8f7535a707c245a7fb11ad..642d1a473abd354d62e74de49747e6febd563082 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -852,7 +852,7 @@ export class DiffEditorWidget extends EventEmitter implements editorBrowser.IDif clonedOptions.scrollbar = clonedOptions.scrollbar || {}; clonedOptions.scrollbar.vertical = 'visible'; clonedOptions.folding = false; - clonedOptions.referenceInfos = false; + clonedOptions.codeLens = false; return clonedOptions; } diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index af220f960438adb47977309339af4c0b0276e577..7ec23476345e412519dd1c545aa3d06a03184543 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -265,7 +265,7 @@ class InternalEditorOptionsHelper { tabCompletion: opts.tabCompletion, wordBasedSuggestions: opts.wordBasedSuggestions, selectionHighlight: toBoolean(opts.selectionHighlight), - referenceInfos: toBoolean(opts.referenceInfos), + codeLens: opts.referenceInfos && opts.codeLens, folding: toBoolean(opts.folding), }); @@ -762,10 +762,10 @@ let editorConfiguration:IConfigurationNode = { default: DefaultConfig.editor.renderIndentGuides, description: nls.localize('renderIndentGuides', "Controls whether the editor should render indent guides") }, - 'editor.referenceInfos' : { + 'editor.codeLens' : { 'type': 'boolean', - 'default': DefaultConfig.editor.referenceInfos, - 'description': nls.localize('referenceInfos', "Controls if the editor shows reference information for the modes that support it") + 'default': DefaultConfig.editor.codeLens, + 'description': nls.localize('codeLens', "Controls if the editor shows code lenses") }, 'editor.folding' : { 'type': 'boolean', diff --git a/src/vs/editor/common/config/defaultConfig.ts b/src/vs/editor/common/config/defaultConfig.ts index 4c64ed2b4a45ce083aa4198e85eaa563fe9e95a0..898e86e6f48c67376ccc65a4ace57399c6d7ac3a 100644 --- a/src/vs/editor/common/config/defaultConfig.ts +++ b/src/vs/editor/common/config/defaultConfig.ts @@ -87,6 +87,7 @@ class ConfigClass implements IConfiguration { tabCompletion: false, wordBasedSuggestions: true, selectionHighlight: true, + codeLens: true, referenceInfos: true, folding: true, renderWhitespace: false, diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index daa1fe457b16b91c241c95dee3537692980fce96..cc746c6b63105c6b52102e32c43ca3a71e128209 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -408,9 +408,14 @@ export interface IEditorOptions { */ selectionHighlight?:boolean; /** - * Show reference infos (a.k.a. code lenses) for modes that support it + * Show code lens * Defaults to true. */ + codeLens?: boolean; + /** + * @deprecated - use codeLens instead + * @internal + */ referenceInfos?: boolean; /** * Enable code folding @@ -815,7 +820,7 @@ export class EditorContribOptions { tabCompletion: boolean; wordBasedSuggestions: boolean; selectionHighlight:boolean; - referenceInfos: boolean; + codeLens: boolean; folding: boolean; /** @@ -836,7 +841,7 @@ export class EditorContribOptions { tabCompletion: boolean; wordBasedSuggestions: boolean; selectionHighlight:boolean; - referenceInfos: boolean; + codeLens: boolean; folding: boolean; }) { this.selectionClipboard = Boolean(source.selectionClipboard); @@ -853,7 +858,7 @@ export class EditorContribOptions { this.tabCompletion = source.tabCompletion; this.wordBasedSuggestions = source.wordBasedSuggestions; this.selectionHighlight = Boolean(source.selectionHighlight); - this.referenceInfos = Boolean(source.referenceInfos); + this.codeLens = Boolean(source.codeLens); this.folding = Boolean(source.folding); } @@ -876,7 +881,7 @@ export class EditorContribOptions { && this.tabCompletion === other.tabCompletion && this.wordBasedSuggestions === other.wordBasedSuggestions && this.selectionHighlight === other.selectionHighlight - && this.referenceInfos === other.referenceInfos + && this.codeLens === other.codeLens && this.folding === other.folding ); } diff --git a/src/vs/editor/contrib/codelens/browser/codelens.ts b/src/vs/editor/contrib/codelens/browser/codelens.ts index 3a100154156a0d471a83358400eaf2633c433586..b5e8af215dd944b7a4a1e1a097e5a3bd7329302d 100644 --- a/src/vs/editor/contrib/codelens/browser/codelens.ts +++ b/src/vs/editor/contrib/codelens/browser/codelens.ts @@ -354,7 +354,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { @ICommandService private _commandService: ICommandService, @IMessageService private _messageService: IMessageService ) { - this._isEnabled = this._editor.getConfiguration().contribInfo.referenceInfos; + this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens; this._globalToDispose = []; this._localToDispose = []; @@ -366,7 +366,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { this._globalToDispose.push(this._editor.onDidChangeModelMode(() => this.onModelChange())); this._globalToDispose.push(this._editor.onDidChangeConfiguration((e: editorCommon.IConfigurationChangedEvent) => { let prevIsEnabled = this._isEnabled; - this._isEnabled = this._editor.getConfiguration().contribInfo.referenceInfos; + this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens; if (prevIsEnabled !== this._isEnabled) { this.onModelChange(); } diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index e0f351f457750a111dcf0cc858cc0ebdfa184848..19ce977046e5401ce8556d40ace363c968da8441 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -1262,10 +1262,10 @@ declare module monaco.editor { */ selectionHighlight?: boolean; /** - * Show reference infos (a.k.a. code lenses) for modes that support it + * Show code lens * Defaults to true. */ - referenceInfos?: boolean; + codeLens?: boolean; /** * Enable code folding * Defaults to true. @@ -1422,7 +1422,7 @@ declare module monaco.editor { tabCompletion: boolean; wordBasedSuggestions: boolean; selectionHighlight: boolean; - referenceInfos: boolean; + codeLens: boolean; folding: boolean; }