Create VsCodeResource for schemed filepaths (#94986)

This commit is contained in:
matt penrice 2020-05-29 21:00:22 +02:00 committed by GitHub
parent 5bec7163f3
commit 3cb12a21b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -630,7 +630,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
}
public toResource(filepath: string): vscode.Uri {
if (filepath.startsWith(TypeScriptServiceClient.WALK_THROUGH_SNIPPET_SCHEME_COLON) || (filepath.startsWith(fileSchemes.untitled + ':'))
if (filepath.match(/^[a-z]{2,}:/) || filepath.startsWith(TypeScriptServiceClient.WALK_THROUGH_SNIPPET_SCHEME_COLON) || (filepath.startsWith(fileSchemes.untitled + ':'))
) {
let resource = vscode.Uri.parse(filepath);
const dirName = path.dirname(resource.path);