[css] path completion in web

This commit is contained in:
Martin Aeschlimann
2020-05-28 21:54:35 +02:00
parent 1ece4c4c25
commit eba3d294a2
6 changed files with 137 additions and 34 deletions

View File

@@ -5,8 +5,8 @@
import { DocumentContext } from 'vscode-css-languageservice';
import { endsWith, startsWith } from '../utils/strings';
import * as url from 'url';
import { WorkspaceFolder } from 'vscode-languageserver';
import { resolvePath } from '../requests';
export function getDocumentContext(documentUri: string, workspaceFolders: WorkspaceFolder[]): DocumentContext {
function getRootFolder(): string | undefined {
@@ -30,7 +30,8 @@ export function getDocumentContext(documentUri: string, workspaceFolders: Worksp
return folderUri + ref.substr(1);
}
}
return url.resolve(base, ref);
base = base.substr(0, base.lastIndexOf('/') + 1);
return resolvePath(base, ref);
},
};
}