diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index a56c6d77f75..430813d3ad6 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -710,16 +710,20 @@ export default class TypeScriptServiceClient extends Disposable implements IType return undefined; } - if (resource.scheme === fileSchemes.file || resource.scheme === fileSchemes.untitled) { - for (const root of roots.sort((a, b) => a.uri.fsPath.length - b.uri.fsPath.length)) { - if (resource.fsPath.startsWith(root.uri.fsPath + path.sep)) { - return root.uri.fsPath; + switch (resource.scheme) { + case fileSchemes.file: + case fileSchemes.untitled: + case fileSchemes.vscodeNotebookCell: + for (const root of roots.sort((a, b) => a.uri.fsPath.length - b.uri.fsPath.length)) { + if (resource.fsPath.startsWith(root.uri.fsPath + path.sep)) { + return root.uri.fsPath; + } } - } - return roots[0].uri.fsPath; - } + return roots[0].uri.fsPath; - return undefined; + default: + return undefined; + } } public execute(command: keyof TypeScriptRequests, args: any, token: vscode.CancellationToken, config?: ExecConfig): Promise> {