-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support copy name of active file #61
Conversation
It seems that the test fails as |
Does that mean the command would fail on Linux machines? |
Yes, on Linux systems that do not have the |
Do you think there's a way to use the VSCode copy/paste system which is used internally? |
As you can see in the following posts, it seems that vscode are not exposing nor intend to expose their clipboard API: When people asked them to support the "Copy File Name", they inclined that an extension should be used. |
OK, fair enough. Have you seen the vulnerability message from snyk?
|
Replaced |
What do you think about the following architecture:
|
Maybe something like this. export class CopyFileNameCommand extends BaseCommand {
[...]
public async execute(uri?: Uri) {
const sourcePath: string = this.controller.sourcePath;
if (!sourcePath) {
return;
}
const fileItem = new FileItem(sourcePath);
return this.controller.execute({ fileItem });
}
} export interface IFileController {
readonly sourcePath: string;
[...]
} |
I was thinking that a new interface for different copy operations (incase we'd like to support other copy types) would be better than overloading the fileItem with Copy related fields. But if you feel that this is a better approach - no problem. |
I think it would make sense to keep the api consistent. Also making And thank you very much for contributing, great work! |
Up until now, If I understood you correctly, here you suggest that What I don't understand is where will it be populated? I can stick with the What do you think? |
I meant to extend the readonly sourcePath: string; and change - protected get sourcePath(): string {
+ public get sourcePath(): string { That way you don't need |
Supports #54.
Since VSCode natively supports "Copy Path Of Active File" and "Copy Relative Path Of Active File", I only added "Copy Name Of Active File" which was missing.