feat: enable it to open multiple files#33
feat: enable it to open multiple files#33CatBraaain wants to merge 1 commit intosandcastle:masterfrom
Conversation
| } | ||
|
|
||
| private open(uri: vscode.Uri | undefined): void { | ||
| private open(uri: vscode.Uri | undefined, uris: vscode.Uri[] | undefined): void { |
There was a problem hiding this comment.
You should look at combining these parameters into one
There was a problem hiding this comment.
Thanks for reviewing.
Do you mean removing uri parameter and use only uris parameter like as below
this.open(uris);
---
private open(uris: vscode.Uri[] | undefined): void {or combining two parameters into one as tuple like as below.
this.open(uri, uris);
---
private open(uriArgs: [vscode.Uri | undefined, vscode.Uri[] | undefined]): void {If the former, it might be good but I am still not sure callback function always has uris parameter when it has uri parameter. Because it's not described clearly in reference.
What I found is only this as below.
Note 1: When a command is invoked from a (context) menu, VS Code tries to infer the currently selected resource and passes that as a parameter when invoking the command. For instance, a menu item inside the Explorer is passed the URI of the selected resource and a menu item inside an editor is passed the URI of the document.
vscode api reference
If the latter, I don't understand why.
If the other, could you explain me more detail.
There was a problem hiding this comment.
I found a case, when selecting folder, uri argument has a value, but uris argument is undefined.
so that we need both of uri and uris parameter in my opinion.
79df80d to
0237175
Compare
Enable it to open multiple files
It's possible to get all selected files when running open command from context menu on explorer.
Here is a related code snippet on Stack Overflow:
Test
I'm very new to pull request, I welcome any feedback.