mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +00:00
Pass in correct project root for notebook cells
This commit is contained in:
@@ -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>> {
|
||||
|
||||
Reference in New Issue
Block a user