This commit is contained in:
Pine Wu 2018-12-14 14:17:02 -08:00
parent 0f5b2d14e7
commit 9b5795b0fe

View file

@ -52,11 +52,19 @@ export function activate(context: ExtensionContext) {
let tagPaths: string[] = workspace.getConfiguration('html').get('experimental.custom.tags', []);
let attributePaths: string[] = workspace.getConfiguration('html').get('experimental.custom.attributes', []);
if (tagPaths) {
const workspaceRoot = workspace.workspaceFolders![0].uri.fsPath;
tagPaths = tagPaths.map(d => {
return path.resolve(workspaceRoot, d);
});
if (tagPaths && tagPaths.length > 0) {
if (!workspace.workspaceFolders) {
tagPaths = [];
} else {
try {
const workspaceRoot = workspace.workspaceFolders[0].uri.fsPath;
tagPaths = tagPaths.map(d => {
return path.resolve(workspaceRoot, d);
});
} catch (err) {
tagPaths = [];
}
}
}
// Options to control the language client