提交 cffc8eab 编写于 作者: B Benjamin Pasero

fix #111898

上级 532ba43c
......@@ -131,7 +131,7 @@ interface IOpenFolderAPICommandOptions {
CommandsRegistry.registerCommand({
id: 'vscode.openFolder',
handler: (accessor: ServicesAccessor, uri?: URI, arg: boolean | IOpenFolderAPICommandOptions = {}) => {
handler: (accessor: ServicesAccessor, uri?: URI, arg?: boolean | IOpenFolderAPICommandOptions) => {
const commandService = accessor.get(ICommandService);
// Be compatible to previous args by converting to options
......@@ -141,15 +141,15 @@ CommandsRegistry.registerCommand({
// Without URI, ask to pick a folder or workpsace to open
if (!uri) {
return commandService.executeCommand('_files.pickFolderAndOpen', { forceNewWindow: arg.forceNewWindow });
return commandService.executeCommand('_files.pickFolderAndOpen', { forceNewWindow: arg?.forceNewWindow });
}
uri = URI.revive(uri);
const options: IOpenWindowOptions = {
forceNewWindow: arg.forceNewWindow,
forceReuseWindow: arg.forceReuseWindow,
noRecentEntry: arg.noRecentEntry
forceNewWindow: arg?.forceNewWindow,
forceReuseWindow: arg?.forceReuseWindow,
noRecentEntry: arg?.noRecentEntry
};
const uriToOpen: IWindowOpenable = (hasWorkspaceFileExtension(uri) || uri.scheme === Schemas.untitled) ? { workspaceUri: uri } : { folderUri: uri };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册