You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your enhancement related to a problem? Please describe.
We integrate vscode-yaml to provide language support for our yaml project configuration files. Nature of the config is such that you can't decide just by looking at the name of the file what "type" of configuration file it is. To find if given file is even part of our project configuration and if so what role it plays (thus what schema to apply) we need to invoke some async code, which we can't do because requestSchema requires immediate string result.
Describe the solution you would like
We'd like the ExtensionAPI.registerContributor to be extended like this
this change should be backwards compatible as simple string result is still allowed.
Looking at the history I see requestSchemaContent also started as allowing only string return but in time was extended to also allow Promise<string> - was there some reason to keep requestSchema synchronous only or was there simply no usecase for also extending it so it was left as is?
Describe alternatives you have considered
It is possible to work around this limitation by eagerly caching results for requestSchema so when this callback is invoked we can return the cached value (if already available) but we'd like to fall back to this solution as last resort as it will introduce significant complexity for our implementation and consume extra time+memory for the user (we have to eagerly prefetch everything to have it ready for when requestSchema gets called)
The text was updated successfully, but these errors were encountered:
Is your enhancement related to a problem? Please describe.
We integrate vscode-yaml to provide language support for our yaml project configuration files. Nature of the config is such that you can't decide just by looking at the name of the file what "type" of configuration file it is. To find if given file is even part of our project configuration and if so what role it plays (thus what schema to apply) we need to invoke some
async
code, which we can't do becauserequestSchema
requires immediatestring
result.Describe the solution you would like
We'd like the
ExtensionAPI.registerContributor
to be extended like thisthis change should be backwards compatible as simple
string
result is still allowed.Looking at the history I see
requestSchemaContent
also started as allowing onlystring
return but in time was extended to also allowPromise<string>
- was there some reason to keeprequestSchema
synchronous only or was there simply no usecase for also extending it so it was left as is?Describe alternatives you have considered
It is possible to work around this limitation by eagerly caching results for
requestSchema
so when this callback is invoked we can return the cached value (if already available) but we'd like to fall back to this solution as last resort as it will introduce significant complexity for our implementation and consume extra time+memory for the user (we have to eagerly prefetch everything to have it ready for whenrequestSchema
gets called)The text was updated successfully, but these errors were encountered: