提交 c0f8d126 编写于 作者: M Martin Aeschlimann

IntelliSense not work in settings.json . Fixes #33069

上级 7dc1ddd3
......@@ -204,28 +204,30 @@ function getSettings(): Settings {
}
let folders = workspace.workspaceFolders;
folders.forEach(folder => {
let jsonConfig = workspace.getConfiguration('json', folder.uri);
let schemaConfigInfo = jsonConfig.inspect<JSONSchemaSettings[]>('schemas');
let folderSchemas = schemaConfigInfo.workspaceFolderValue;
if (Array.isArray(folderSchemas)) {
folderSchemas.forEach(schema => {
let url = schema.url;
if (!url && schema.schema) {
url = schema.schema.id;
}
if (url && url[0] === '.') {
url = Uri.file(path.normalize(path.join(folder.uri.fsPath, url))).toString();
}
let fileMatch = schema.fileMatch;
if (fileMatch) {
fileMatch = fileMatch.map(m => path.join(folder.uri.path + '*', m));
}
schemas.push({ url, fileMatch, schema: schema.schema });
});
};
});
if (folders) {
folders.forEach(folder => {
let jsonConfig = workspace.getConfiguration('json', folder.uri);
let schemaConfigInfo = jsonConfig.inspect<JSONSchemaSettings[]>('schemas');
let folderSchemas = schemaConfigInfo.workspaceFolderValue;
if (Array.isArray(folderSchemas)) {
folderSchemas.forEach(schema => {
let url = schema.url;
if (!url && schema.schema) {
url = schema.schema.id;
}
if (url && url[0] === '.') {
url = Uri.file(path.normalize(path.join(folder.uri.fsPath, url))).toString();
}
let fileMatch = schema.fileMatch;
if (fileMatch) {
fileMatch = fileMatch.map(m => path.join(folder.uri.path + '*', m));
}
schemas.push({ url, fileMatch, schema: schema.schema });
});
};
});
}
return settings;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册