Skip to content

Commit

Permalink
fix: editor copy path command (#1745)
Browse files Browse the repository at this point in the history
* fix: editor copy path command

* test: add editor command args unit test
# Conflicts:
#	packages/editor/src/browser/editor.contribution.ts
  • Loading branch information
erha19 authored and yantze committed Oct 10, 2022
1 parent c17fffa commit f5af095
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/editor/src/browser/editor.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,6 @@ export class EditorContribution
});
}
}

}
},
});
Expand Down Expand Up @@ -1339,19 +1338,19 @@ export class EditorAutoSaveEditorContribution implements BrowserEditorContributi
},
});
commands.registerCommand(EDITOR_COMMANDS.COPY_PATH, {
execute: (uri) => {
if (!uri) {
execute: (resource: ResourceArgs) => {
if (!resource) {
return;
}
this.commandService.executeCommand(FILE_COMMANDS.COPY_PATH.id, uri);
this.commandService.executeCommand(FILE_COMMANDS.COPY_PATH.id, resource.uri);
},
});
commands.registerCommand(EDITOR_COMMANDS.COPY_RELATIVE_PATH, {
execute: (uri) => {
if (!uri) {
execute: (resource: ResourceArgs) => {
if (!resource) {
return;
}
this.commandService.executeCommand(FILE_COMMANDS.COPY_RELATIVE_PATH.id, uri);
this.commandService.executeCommand(FILE_COMMANDS.COPY_RELATIVE_PATH.id, resource.uri);
},
});
}
Expand Down

0 comments on commit f5af095

Please sign in to comment.