Browse Source

Fixes @log issues when code is minified (can't look up by name)

main
Eric Amodio 6 years ago
parent
commit
bfa7509119
3 changed files with 8 additions and 8 deletions
  1. +3
    -3
      src/system/decorators.ts
  2. +2
    -2
      src/views/nodes/repositoryNode.ts
  3. +3
    -3
      src/views/viewBase.ts

+ 3
- 3
src/system/decorators.ts View File

@ -136,8 +136,8 @@ export function log(
const p = parameters[index];
let loggable;
if (typeof options.args === 'object' && options.args[p]) {
loggable = options.args[p](v);
if (typeof options.args === 'object' && options.args[index]) {
loggable = options.args[index](v);
}
else {
if (typeof v === 'object') {
@ -209,7 +209,7 @@ export function log(
catch (ex) {
exit = `@log.exit error: ${ex}`;
}
logFn(key, `completed${timing}${exit}`);
logFn(prefix, `completed${timing}${exit}`);
}
return result;
}

+ 2
- 2
src/views/nodes/repositoryNode.ts View File

@ -262,7 +262,7 @@ export class RepositoryNode extends SubscribeableViewNode {
@debug({
args: {
e: (e: RepositoryFileSystemChangeEvent) =>
0: (e: RepositoryFileSystemChangeEvent) =>
`{ repository: ${e.repository ? e.repository.name : ''}, uris: [${e.uris
.map(u => u.fsPath)
.join(', ')}] }`
@ -274,7 +274,7 @@ export class RepositoryNode extends SubscribeableViewNode {
@debug({
args: {
e: (e: RepositoryChangeEvent) =>
0: (e: RepositoryChangeEvent) =>
`{ repository: ${e.repository ? e.repository.name : ''}, changes: ${e.changes.join()} }`
}
})

+ 3
- 3
src/views/viewBase.ts View File

@ -148,7 +148,7 @@ export abstract class ViewBase implements TreeDataProvid
}
@debug({
args: { node: (n: ViewNode) => `${n.constructor.name}${n.id ? `(${n.id})` : ''}` }
args: { 0: (n: ViewNode) => `${n.constructor.name}${n.id != null ? `(${n.id})` : ''}` }
})
async refreshNode(node: ViewNode, args?: RefreshNodeCommandArgs) {
if (args !== undefined) {
@ -169,7 +169,7 @@ export abstract class ViewBase implements TreeDataProvid
}
@log({
args: { node: (n: ViewNode) => `${n.constructor.name}${n.id ? `(${n.id})` : ''}` }
args: { 0: (n: ViewNode) => `${n.constructor.name}${n.id != null ? `(${n.id})` : ''}` }
})
async reveal(
node: ViewNode,
@ -198,7 +198,7 @@ export abstract class ViewBase implements TreeDataProvid
}
@debug({
args: { node: (n?: ViewNode) => (n != null ? `${n.constructor.name}${n.id ? `(${n.id})` : ''}` : '') }
args: { 0: (n?: ViewNode) => (n != null ? `${n.constructor.name}${n.id != null ? `(${n.id})` : ''}` : '') }
})
triggerNodeChange(node?: ViewNode) {
// Since the root node won't actually refresh, force everything

Loading…
Cancel
Save