Parcourir la source

Removes codeLens.debug setting

Adds debug outputLevel
main
Eric Amodio il y a 7 ans
Parent
révision
4dca269e85
4 fichiers modifiés avec 8 ajouts et 15 suppressions
  1. +2
    -7
      package.json
  2. +3
    -5
      src/gitCodeLensProvider.ts
  3. +1
    -1
      src/logger.ts
  4. +2
    -2
      src/ui/config.ts

+ 2
- 7
package.json Voir le fichier

@ -149,12 +149,6 @@
"description": "Specifies whether or not to show an `authors` code lens showing number of authors of the file or code block and the most prominent author (if there is more than one)",
"scope": "window"
},
"gitlens.codeLens.debug": {
"type": "boolean",
"default": false,
"description": "Specifies whether or not to show debug information in code lens",
"scope": "window"
},
"gitlens.codeLens.enabled": {
"type": "boolean",
"default": true,
@ -540,7 +534,8 @@
"enum": [
"silent",
"errors",
"verbose"
"verbose",
"debug"
],
"description": "Specifies how much (if any) output will be sent to the GitLens output channel",
"scope": "window"

+ 3
- 5
src/gitCodeLensProvider.ts Voir le fichier

@ -4,6 +4,7 @@ import { CancellationToken, CodeLens, CodeLensProvider, Command, commands, Docum
import { Commands, DiffWithPreviousCommandArgs, ShowQuickCommitDetailsCommandArgs, ShowQuickCommitFileDetailsCommandArgs, ShowQuickFileHistoryCommandArgs } from './commands';
import { CodeLensCommand, CodeLensLanguageScope, CodeLensScopes, configuration, ICodeLensConfig } from './configuration';
import { BuiltInCommands, DocumentSchemes } from './constants';
import { Container } from './container';
import { DocumentTracker, GitDocumentState } from './trackers/documentTracker';
import { GitBlame, GitBlameCommit, GitBlameLines, GitService, GitUri } from './gitService';
import { Logger } from './logger';
@ -56,8 +57,6 @@ export class GitCodeLensProvider implements CodeLensProvider {
static selector: DocumentSelector = [{ scheme: DocumentSchemes.File }, { scheme: DocumentSchemes.Git }, { scheme: DocumentSchemes.GitLensGit }];
private _debug: boolean = false;
constructor(
context: ExtensionContext,
private readonly _git: GitService,
@ -87,7 +86,6 @@ export class GitCodeLensProvider implements CodeLensProvider {
}
const cfg = configuration.get<ICodeLensConfig>(configuration.name('codeLens').value, document.uri);
this._debug = cfg.debug;
let languageScope = cfg.scopesByLanguage && cfg.scopesByLanguage.find(ll => ll.language !== undefined && ll.language.toLowerCase() === document.languageId);
if (languageScope == null) {
@ -307,7 +305,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
const recentCommit = Iterables.first(blame.commits.values());
let title = `${recentCommit.author}, ${recentCommit.formattedDate}`;
if (this._debug) {
if (Container.config.debug) {
title += ` [${SymbolKind[lens.symbolKind]}(${lens.range.start.character}-${lens.range.end.character}), Lines (${lens.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Commit (${recentCommit.shortSha})]`;
}
@ -328,7 +326,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
const count = blame.authors.size;
let title = `${count} ${count > 1 ? 'authors' : 'author'} (${Iterables.first(blame.authors.values()).name}${count > 1 ? ' and others' : ''})`;
if (this._debug) {
if (Container.config.debug) {
title += ` [${SymbolKind[lens.symbolKind]}(${lens.range.start.character}-${lens.range.end.character}), Lines (${lens.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Authors (${Iterables.join(Iterables.map(blame.authors.values(), a => a.name), ', ')})]`;
}

+ 1
- 1
src/logger.ts Voir le fichier

@ -81,7 +81,7 @@ export class Logger {
static gitOutput: OutputChannel | undefined;
static logGitCommand(command: string, cwd: string): void {
if (!this.debug) return;
if (this.level !== OutputLevel.Debug) return;
if (this.gitOutput === undefined) {
this.gitOutput = window.createOutputChannel(`${ExtensionOutputChannelName} (Git)`);

+ 2
- 2
src/ui/config.ts Voir le fichier

@ -76,7 +76,8 @@ export enum KeyMap {
export enum OutputLevel {
Silent = 'silent',
Errors = 'errors',
Verbose = 'verbose'
Verbose = 'verbose',
Debug = 'debug'
}
export enum StatusBarCommand {
@ -161,7 +162,6 @@ export interface ICodeLensConfig {
command: CodeLensCommand;
};
debug: boolean;
enabled: boolean;
recentChange: {

Chargement…
Annuler
Enregistrer