Skip to content

Commit 0d7d202

Browse files
committed
Begin implementation of opening multiple files at once.
1 parent 7c69553 commit 0d7d202

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/commandwindow/ExecutionCommandProvider.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,10 @@ export default class ExecutionCommandProvider {
300300

301301
/**
302302
* Implements the open file action
303-
* @param uri The file path to the file that should be opened
303+
* @param uris The file paths to the files that should be opened
304304
* @returns
305305
*/
306-
async handleOpenFile(uri: vscode.Uri): Promise<void> {
306+
async handleOpenFile (uris: vscode.Uri[]): Promise<void> {
307307
this._telemetryLogger.logEvent({
308308
eventKey: 'ML_VS_CODE_ACTIONS',
309309
data: {
@@ -320,6 +320,8 @@ export default class ExecutionCommandProvider {
320320
return;
321321
}
322322

323-
void this._mvm.feval('open', 0, [uri.fsPath]);
323+
for (const uri of uris) {
324+
void this._mvm.feval('open', 0, [uri.fsPath]);
325+
}
324326
}
325327
}

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export async function activate (context: vscode.ExtensionContext): Promise<void>
129129
context.subscriptions.push(vscode.commands.registerCommand('matlab.addFolderToPath', async (uri: vscode.Uri) => await executionCommandProvider.handleAddFolderToPath(uri)))
130130
context.subscriptions.push(vscode.commands.registerCommand('matlab.addFolderAndSubfoldersToPath', async (uri: vscode.Uri) => await executionCommandProvider.handleAddFolderAndSubfoldersToPath(uri)))
131131
context.subscriptions.push(vscode.commands.registerCommand('matlab.changeDirectory', async (uri: vscode.Uri) => await executionCommandProvider.handleChangeDirectory(uri)))
132-
context.subscriptions.push(vscode.commands.registerCommand('matlab.openFile', async (uri: vscode.Uri) => await executionCommandProvider.handleOpenFile(uri)))
132+
context.subscriptions.push(vscode.commands.registerCommand('matlab.openFile', async (uris: vscode.Uri[]) => await executionCommandProvider.handleOpenFile(uris)))
133133

134134
// Register a custom command which allows the user enable / disable Sign In options.
135135
// Using this custom command would be an alternative approach to going to enabling the setting.

0 commit comments

Comments
 (0)