Skip to content

Commit 6ae9e9d

Browse files
committed
Add more specific check for lib files on web
1 parent 787554d commit 6ae9e9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extensions/typescript-language-features/src/typescriptServiceClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,8 @@ export default class TypeScriptServiceClient extends Disposable implements IType
722722

723723
public toResource(filepath: string): vscode.Uri {
724724
if (isWeb()) {
725-
// On web, treat absolute paths as pointing to standard lib files
726-
if (filepath.startsWith('/')) {
725+
// On web, the stdlib paths that TS return look like: '/lib.es2015.collection.d.ts'
726+
if (filepath.startsWith('/lib.') && filepath.endsWith('.d.ts')) {
727727
return vscode.Uri.joinPath(this.context.extensionUri, 'dist', 'browser', 'typescript', filepath.slice(1));
728728
}
729729
}

0 commit comments

Comments
 (0)