mirror of
https://github.com/Microsoft/vscode
synced 2024-07-17 02:57:19 +00:00
relative schema path not resolved properly (#175185)
This commit is contained in:
parent
1fa08d1121
commit
400fde0524
|
@ -545,27 +545,32 @@ function getSettings(): Settings {
|
|||
}
|
||||
};
|
||||
|
||||
const collectSchemaSettings = (schemaSettings: JSONSchemaSettings[], folderUri?: Uri) => {
|
||||
for (const setting of schemaSettings) {
|
||||
const url = getSchemaId(setting, folderUri);
|
||||
if (url) {
|
||||
const schemaSetting: JSONSchemaSettings = { url, fileMatch: setting.fileMatch, folderUri: folderUri?.toString(false), schema: setting.schema };
|
||||
schemas.push(schemaSetting);
|
||||
const collectSchemaSettings = (schemaSettings: JSONSchemaSettings[] | undefined, folderUri?: Uri) => {
|
||||
|
||||
if (schemaSettings) {
|
||||
for (const setting of schemaSettings) {
|
||||
const url = getSchemaId(setting, folderUri);
|
||||
if (url) {
|
||||
const schemaSetting: JSONSchemaSettings = { url, fileMatch: setting.fileMatch, folderUri: folderUri?.toString(false), schema: setting.schema };
|
||||
schemas.push(schemaSetting);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const globalSettings = workspace.getConfiguration('json', null).get<JSONSchemaSettings[]>('schemas');
|
||||
if (Array.isArray(globalSettings)) {
|
||||
collectSchemaSettings(globalSettings);
|
||||
const schemaConfigInfo = workspace.getConfiguration('json', null).inspect<JSONSchemaSettings[]>('schemas');
|
||||
if (schemaConfigInfo) {
|
||||
if (workspace.workspaceFile) {
|
||||
collectSchemaSettings(schemaConfigInfo.workspaceValue, workspace.workspaceFile);
|
||||
}
|
||||
collectSchemaSettings(schemaConfigInfo.globalValue);
|
||||
}
|
||||
|
||||
const folders = workspace.workspaceFolders;
|
||||
if (folders) {
|
||||
for (const folder of folders) {
|
||||
const schemaConfigInfo = workspace.getConfiguration('json', folder.uri).inspect<JSONSchemaSettings[]>('schemas');
|
||||
if (schemaConfigInfo && Array.isArray(schemaConfigInfo.workspaceFolderValue)) {
|
||||
collectSchemaSettings(schemaConfigInfo.workspaceFolderValue, folder.uri);
|
||||
}
|
||||
collectSchemaSettings(schemaConfigInfo?.workspaceFolderValue, folder.uri);
|
||||
}
|
||||
}
|
||||
return settings;
|
||||
|
|
Loading…
Reference in a new issue