mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 10:58:34 -05:00
Adds setting to control CodeLens debug info
This commit is contained in:
@@ -303,6 +303,11 @@
|
|||||||
"default": false,
|
"default": false,
|
||||||
"description": "Specifies debug mode"
|
"description": "Specifies debug mode"
|
||||||
},
|
},
|
||||||
|
"gitlens.advanced.codeLens.debug": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false,
|
||||||
|
"description": "Specifies whether or not to show debug information in CodeLens"
|
||||||
|
},
|
||||||
"gitlens.advanced.git": {
|
"gitlens.advanced.git": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": null,
|
"default": null,
|
||||||
|
|||||||
@@ -103,6 +103,9 @@ export interface IAdvancedConfig {
|
|||||||
maxLines: number;
|
maxLines: number;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
codeLens: {
|
||||||
|
debug: boolean;
|
||||||
|
};
|
||||||
debug: boolean;
|
debug: boolean;
|
||||||
git: string;
|
git: string;
|
||||||
gitignore: {
|
gitignore: {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Commands } from './commands';
|
|||||||
import { BuiltInCommands, DocumentSchemes } from './constants';
|
import { BuiltInCommands, DocumentSchemes } from './constants';
|
||||||
import { CodeLensCommand, CodeLensLocation, IConfig, ICodeLensLanguageLocation } from './configuration';
|
import { CodeLensCommand, CodeLensLocation, IConfig, ICodeLensLanguageLocation } from './configuration';
|
||||||
import { GitCommit, GitProvider, GitUri, IGitBlame, IGitBlameLines } from './gitProvider';
|
import { GitCommit, GitProvider, GitUri, IGitBlame, IGitBlameLines } from './gitProvider';
|
||||||
import { Logger, OutputLevel } from './logger';
|
import { Logger } from './logger';
|
||||||
import * as moment from 'moment';
|
import * as moment from 'moment';
|
||||||
|
|
||||||
export class GitRecentChangeCodeLens extends CodeLens {
|
export class GitRecentChangeCodeLens extends CodeLens {
|
||||||
@@ -261,7 +261,7 @@ export default class GitCodeLensProvider implements CodeLensProvider {
|
|||||||
|
|
||||||
const recentCommit = Iterables.first(blame.commits.values());
|
const recentCommit = Iterables.first(blame.commits.values());
|
||||||
title = `${recentCommit.author}, ${moment(recentCommit.date).fromNow()}`;
|
title = `${recentCommit.author}, ${moment(recentCommit.date).fromNow()}`;
|
||||||
if (this._config.advanced.debug && this._config.advanced.output.level === OutputLevel.Verbose) {
|
if (this._config.advanced.codeLens.debug) {
|
||||||
title += ` [${SymbolKind[lens.symbolKind]}(${lens.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Commit (${recentCommit.shortSha})]`;
|
title += ` [${SymbolKind[lens.symbolKind]}(${lens.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Commit (${recentCommit.shortSha})]`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,7 +282,7 @@ export default class GitCodeLensProvider implements CodeLensProvider {
|
|||||||
const blame = lens.getBlame();
|
const blame = lens.getBlame();
|
||||||
const count = blame.authors.size;
|
const count = blame.authors.size;
|
||||||
let title = `${count} ${count > 1 ? 'authors' : 'author'} (${Iterables.first(blame.authors.values()).name}${count > 1 ? ' and others' : ''})`;
|
let title = `${count} ${count > 1 ? 'authors' : 'author'} (${Iterables.first(blame.authors.values()).name}${count > 1 ? ' and others' : ''})`;
|
||||||
if (this._config.advanced.debug && this._config.advanced.output.level === OutputLevel.Verbose) {
|
if (this._config.advanced.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), ', ')})]`;
|
title += ` [${SymbolKind[lens.symbolKind]}(${lens.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Authors (${Iterables.join(Iterables.map(blame.authors.values(), _ => _.name), ', ')})]`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user