[json-language-features] Fix json/schemaAssociations parameters documentation#106061
[json-language-features] Fix json/schemaAssociations parameters documentation#106061aeschli merged 2 commits intomicrosoft:masterfrom rchl:fix/json-language-features-docs
Conversation
…entation
The `json/schemaAssociations` documentation is not accurate in stating
that the only supported parameter is an object in `{ pattern: uri }`
format. It also supports the structure defined by `SchemaConfiguration`
interface from "vscode-json-languageservice".
Also updated the server code to match that.
Resolves #106060
| fileMatch: string[]; | ||
|
|
||
| } |
There was a problem hiding this comment.
schema property is also supported.
The type could be set to object if you didn't want to reference JSONSchema.
There was a problem hiding this comment.
Wait, I see what you did there now.
It's no longer accurate again after your change...
There was a problem hiding this comment.
This change was meant to describe two possible inputs for that notification:
- An object form. Example:
{
'foo.js': ['http://schemas.org/foo.json'],
'bar.js': ['http://schemas.org/bar.json'],
}- An array form. Example:
[
{
fileMatch: ['foo.js'],
uri: ['http://schemas.org/foo.json'],
},
{
fileMatch: ['bar.js'],
uri: ['http://schemas.org/bar.json'],
},
]With your change, we're back to just explaining the first form.
There was a problem hiding this comment.
No, sorry, was confused by ISchemaAssociations/ISchemaAssociation[] naming. Thought that ISchemaAssociations is just an array of ISchemaAssociation and thus equivalent.
I'm just wondering why schema property was removed from the interface documentation.
|
The See the |
What is used in vscode is one thing but I'm talking about what this endpoint supports specifically. |
Here is what the server does: vscode/extensions/json-language-features/server/src/jsonServer.ts Lines 269 to 272 in 183d11a It just passes json/schemaAssociations-provided schemas as is to the service. That means the service will handle the schema property if it was provided by the user.
I also know about schemas passed through |
|
Ok I see, that was not intentional. |
|
I'm not against making that code more explicit but I don't see any reason to limit it to not pass BTW. Also, semi-related, the schemas passed through |
|
Yes, the uri/url inconsistency is unhappy, it has historical reasons. As the |
|
I added the |
The
json/schemaAssociationsdocumentation is not accurate in statingthat the only supported parameter is an object in
{ pattern: uri }format. It also supports the structure defined by
SchemaConfigurationinterface from "vscode-json-languageservice".
Also updated the server code to match that.
This PR fixes #106060