File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,7 +78,10 @@ export class CommandManager extends Disposable {
7878 */
7979 private registerCommand ( command : string , callback : ( ...args : any [ ] ) => any ) {
8080 this . registerDisposable (
81- vscode . commands . registerCommand ( command , callback )
81+ vscode . commands . registerCommand ( command , ( ...args : any [ ] ) => {
82+ this . logger . log ( 'Command Invoked: ' + command ) ;
83+ callback ( ...args ) ;
84+ } )
8285 ) ;
8386 }
8487
Original file line number Diff line number Diff line change 11import * as vscode from 'vscode' ;
22import { Disposable } from './utils/disposable' ;
33
4+ const DOUBLE_QUOTE_REGEXP = / " / g;
5+
46/**
57 * Manages the Git Graph Logger, which writes log information to the Git Graph Output Channel.
68 */
@@ -32,11 +34,14 @@ export class Logger extends Disposable {
3234 * @param args The arguments passed to the command.
3335 */
3436 public logCmd ( cmd : string , args : string [ ] ) {
35- this . log ( '> ' + cmd + ' ' + args . map ( ( arg ) => {
36- return arg . startsWith ( '--format=' )
37+ this . log ( '> ' + cmd + ' ' + args . map ( ( arg ) => arg === ''
38+ ? '""'
39+ : arg . startsWith ( '--format=' )
3740 ? '--format=...'
38- : arg . includes ( ' ' ) ? '"' + arg . replace ( / " / g, '\\"' ) + '"' : arg ;
39- } ) . join ( ' ' ) ) ;
41+ : arg . includes ( ' ' )
42+ ? '"' + arg . replace ( DOUBLE_QUOTE_REGEXP , '\\"' ) + '"'
43+ : arg
44+ ) . join ( ' ' ) ) ;
4045 }
4146
4247 /**
You can’t perform that action at this time.
0 commit comments