(source: Uri | undefined, targetFileName: string)
| 67 | } |
| 68 | |
| 69 | private async getDefaultUri(source: Uri | undefined, targetFileName: string): Promise<Uri | undefined> { |
| 70 | if (source && source.scheme === 'untitled' && isWebExtension()) { |
| 71 | // Force using simple file dialog |
| 72 | return undefined; |
| 73 | } |
| 74 | |
| 75 | if ( |
| 76 | !source || |
| 77 | source.scheme === 'file' || |
| 78 | source.scheme === 'untitled' || |
| 79 | source.scheme === 'vscode-interactive' |
| 80 | ) { |
| 81 | // Just combine the working directory with the file |
| 82 | const workspaceService = ServiceContainer.instance.get<IWorkspaceService>(IWorkspaceService); |
| 83 | return Uri.file(path.join(await workspaceService.computeWorkingDirectory(source), targetFileName)); |
| 84 | } |
| 85 | |
| 86 | // Otherwise split off the end of the path and combine it with the target file name |
| 87 | const newPath = path.join(path.dirname(source.path), targetFileName); |
| 88 | return Uri.parse(`${source.scheme}://${newPath}`).with({ authority: source.authority }); |
| 89 | } |
| 90 | } |
no test coverage detected