Add support for office-script virtual file system

This commit is contained in:
Matt Bierner
2022-01-05 14:53:44 -08:00
parent ef69c9c8d8
commit 9ed5a855c1
2 changed files with 6 additions and 1 deletions

View File

@@ -740,7 +740,10 @@ export default class TypeScriptServiceClient extends Disposable implements IType
public getWorkspaceRootForResource(resource: vscode.Uri): string | undefined {
const roots = vscode.workspace.workspaceFolders ? Array.from(vscode.workspace.workspaceFolders) : undefined;
if (!roots || !roots.length) {
if (!roots?.length) {
if (resource.scheme === fileSchemes.officeScript) {
return '/';
}
return undefined;
}
@@ -750,6 +753,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
case fileSchemes.vscodeNotebookCell:
case fileSchemes.memFs:
case fileSchemes.vscodeVfs:
case fileSchemes.officeScript:
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;

View File

@@ -12,6 +12,7 @@ export const walkThroughSnippet = 'walkThroughSnippet';
export const vscodeNotebookCell = 'vscode-notebook-cell';
export const memFs = 'memfs';
export const vscodeVfs = 'vscode-vfs';
export const officeScript = 'office-script';
export const semanticSupportedSchemes = [
file,