Pass in correct project root for notebook cells
This commit is contained in:
parent
f5ea03079a
commit
84391165c3
|
@ -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<ServerResponse.Response<Proto.Response>> {
|
||||
|
|
Loading…
Reference in a new issue