mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 09:08:53 +01:00
committed by
GitHub
parent
b24fefc540
commit
5431050e5f
@@ -6,7 +6,7 @@
|
||||
import { DocumentContext } from 'vscode-css-languageservice';
|
||||
import { endsWith, startsWith } from '../utils/strings';
|
||||
import { WorkspaceFolder } from 'vscode-languageserver';
|
||||
import { resolvePath } from '../requests';
|
||||
import { URI, Utils } from 'vscode-uri';
|
||||
|
||||
export function getDocumentContext(documentUri: string, workspaceFolders: WorkspaceFolder[]): DocumentContext {
|
||||
function getRootFolder(): string | undefined {
|
||||
@@ -34,8 +34,9 @@ export function getDocumentContext(documentUri: string, workspaceFolders: Worksp
|
||||
return folderUri + ref.substr(1);
|
||||
}
|
||||
}
|
||||
base = base.substr(0, base.lastIndexOf('/') + 1);
|
||||
return resolvePath(base, ref);
|
||||
const baseUri = URI.parse(base);
|
||||
const baseUriDir = baseUri.path.endsWith('/') ? baseUri : Utils.dirname(baseUri);
|
||||
return Utils.resolvePath(baseUriDir, ref).toString(true);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user