提交 c840573f 编写于 作者: R Rob Lourens

Handle an absolute path in quickopen for non-file scheme workspaces

上级 60fd1c59
......@@ -34,6 +34,7 @@ import { IFileService } from 'vs/platform/files/common/files';
import { ILabelService } from 'vs/platform/label/common/label';
import { untildify } from 'vs/base/common/labels';
import { CancellationToken } from 'vs/base/common/cancellation';
import { Schemas } from 'vs/base/common/network';
export class FileQuickOpenModel extends QuickOpenModel {
......@@ -187,7 +188,10 @@ export class OpenFileHandler extends QuickOpenHandler {
private getAbsolutePathResult(query: IPreparedQuery): Promise<URI | undefined> {
if (isAbsolute(query.original)) {
const resource = URI.file(query.original);
const workspaceFolders = this.contextService.getWorkspace().folders;
const resource = workspaceFolders[0] && workspaceFolders[0].uri.scheme !== Schemas.file ?
workspaceFolders[0].uri.with({ path: query.original }) :
URI.file(query.original);
return this.fileService.resolveFile(resource).then(stat => stat.isDirectory ? undefined : resource, error => undefined);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册