mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Add support for office-script virtual file system
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user