mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
[json] User defined schemas without file association are not picked up
This commit is contained in:
parent
5e39185526
commit
05393cf9f3
|
@ -169,22 +169,20 @@ function updateConfiguration() {
|
|||
}
|
||||
}
|
||||
if (jsonConfigurationSettings) {
|
||||
jsonConfigurationSettings.forEach((schema) => {
|
||||
if (schema.fileMatch) {
|
||||
let uri = schema.url;
|
||||
if (!uri && schema.schema) {
|
||||
uri = schema.schema.id;
|
||||
if (!uri) {
|
||||
uri = 'vscode://schemas/custom/' + encodeURIComponent(schema.fileMatch.join('&'));
|
||||
}
|
||||
}
|
||||
if (Strings.startsWith(uri, '.') && workspaceRoot) {
|
||||
jsonConfigurationSettings.forEach(schema => {
|
||||
let uri = schema.url;
|
||||
if (!uri && schema.schema) {
|
||||
uri = schema.schema.id;
|
||||
}
|
||||
if (!uri && schema.fileMatch) {
|
||||
uri = 'vscode://schemas/custom/' + encodeURIComponent(schema.fileMatch.join('&'));
|
||||
}
|
||||
if (uri) {
|
||||
if (uri[0] === '.' && workspaceRoot) {
|
||||
// workspace relative path
|
||||
uri = URI.file(path.normalize(path.join(workspaceRoot.fsPath, uri))).toString();
|
||||
}
|
||||
if (uri) {
|
||||
languageSettings.schemas.push({ uri, fileMatch: schema.fileMatch, schema: schema.schema });
|
||||
}
|
||||
languageSettings.schemas.push({ uri, fileMatch: schema.fileMatch, schema: schema.schema });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue