diff --git a/package.json b/package.json index 4a26541..363efb7 100644 --- a/package.json +++ b/package.json @@ -256,6 +256,11 @@ ], "description": "Specifies the command executed when the authors code lens is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current committed file with the previous commit. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickRepoHistory` - shows a branch history quick pick" }, + "gitlens.codeLens.debug": { + "type": "boolean", + "default": false, + "description": "Specifies whether or not to show debug information in code lens" + }, "gitlens.menus.diff.enabled": { "type": "boolean", "default": true, @@ -307,16 +312,6 @@ "default": 0, "description": "Specifies whether status bar git blame output will be cached for larger documents" }, - "gitlens.advanced.debug": { - "type": "boolean", - "default": false, - "description": "Specifies debug mode" - }, - "gitlens.advanced.codeLens.debug": { - "type": "boolean", - "default": false, - "description": "Specifies whether or not to show debug information in code lens" - }, "gitlens.advanced.git": { "type": "string", "default": null, @@ -332,16 +327,6 @@ "default": 200, "description": "Specifies the maximum number of QuickPick history entries to show" }, - "gitlens.advanced.output.level": { - "type": "string", - "default": "silent", - "enum": [ - "silent", - "errors", - "verbose" - ], - "description": "Specifies how much (if any) output will be sent to the GitLens output channel" - }, "gitlens.advanced.quickPick.closeOnFocusOut": { "type": "boolean", "default": true, @@ -352,6 +337,21 @@ "default": false, "description": "Specifies whether or not to toggle whitespace off then showing blame annotations (*may* be required by certain fonts/themes)" }, + "gitlens.debug": { + "type": "boolean", + "default": false, + "description": "Specifies debug mode" + }, + "gitlens.outputLevel": { + "type": "string", + "default": "silent", + "enum": [ + "silent", + "errors", + "verbose" + ], + "description": "Specifies how much (if any) output will be sent to the GitLens output channel" + }, "gitlens.insiders": { "type": "boolean", "default": false, diff --git a/src/configuration.ts b/src/configuration.ts index 10c54bf..1b1613d 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -64,6 +64,7 @@ export interface ICodeLensLanguageLocation { } export interface ICodeLensesConfig { + debug: boolean; visibility: CodeLensVisibility; location: CodeLensLocation; locationCustomSymbols: string[]; @@ -99,18 +100,11 @@ export interface IAdvancedConfig { maxLines: number; } }; - codeLens: { - debug: boolean; - }; - debug: boolean; git: string; gitignore: { enabled: boolean; }; maxQuickHistory: number; - output: { - level: OutputLevel; - }; quickPick: { closeOnFocusOut: boolean; }; @@ -120,6 +114,8 @@ export interface IAdvancedConfig { } export interface IConfig { + debug: boolean; + outputLevel: OutputLevel; blame: IBlameConfig; codeLens: ICodeLensesConfig; statusBar: IStatusBarConfig; diff --git a/src/gitCodeLensProvider.ts b/src/gitCodeLensProvider.ts index f4da852..99a7810 100644 --- a/src/gitCodeLensProvider.ts +++ b/src/gitCodeLensProvider.ts @@ -261,7 +261,7 @@ export class GitCodeLensProvider implements CodeLensProvider { const recentCommit = Iterables.first(blame.commits.values()); title = `${recentCommit.author}, ${moment(recentCommit.date).fromNow()}`; - if (this._config.advanced.codeLens.debug) { + if (this._config.codeLens.debug) { title += ` [${SymbolKind[lens.symbolKind]}(${lens.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Commit (${recentCommit.shortSha})]`; } @@ -282,7 +282,7 @@ export class GitCodeLensProvider implements CodeLensProvider { const blame = lens.getBlame(); const count = blame.authors.size; let title = `${count} ${count > 1 ? 'authors' : 'author'} (${Iterables.first(blame.authors.values()).name}${count > 1 ? ' and others' : ''})`; - if (this._config.advanced.codeLens.debug) { + if (this._config.codeLens.debug) { title += ` [${SymbolKind[lens.symbolKind]}(${lens.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Authors (${Iterables.join(Iterables.map(blame.authors.values(), _ => _.name), ', ')})]`; } diff --git a/src/logger.ts b/src/logger.ts index 7b6eb07..dce1730 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -1,6 +1,6 @@ 'use strict'; import { ExtensionContext, OutputChannel, window, workspace } from 'vscode'; -import { IAdvancedConfig } from './configuration'; +import { IConfig } from './configuration'; import { ExtensionKey } from './constants'; import { Telemetry } from './telemetry'; @@ -19,11 +19,11 @@ let level: OutputLevel = OutputLevel.Silent; let output: OutputChannel; function onConfigurationChanged() { - const cfg = workspace.getConfiguration(ExtensionKey).get('advanced'); + const cfg = workspace.getConfiguration().get(ExtensionKey); - if (cfg.debug !== debug || cfg.output.level !== level) { + if (cfg.debug !== debug || cfg.outputLevel !== level) { debug = cfg.debug; - level = cfg.output.level; + level = cfg.outputLevel; if (level === OutputLevel.Silent) { output && output.dispose();