Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Provide diagnostic option to enable on-demand schema loading #7

Merged
merged 5 commits into from Oct 5, 2018

Conversation

nesterone
Copy link
Contributor

VSCode supports on-demand loading of url content for $schema, it's a part of
Microsoft/vscode-json-languageservice, however, it's not available through monaco-editor

Such functionality would be a good plus, for example it was requested in vega/editor/issues/33 and I see similar feature request here microsoft/monaco-editor/issues/365

- make sure that on-demand loading of schemas works as in VSCode
- bump version of plugin
@msftclas
Copy link

msftclas commented Jul 31, 2018

CLA assistant check
All CLA requirements met.

@nesterone
Copy link
Contributor Author

Hi, @aeschli
Any comments on this?
I'm open to providing any correction to push that feature ;-)

@aeschli
Copy link
Contributor

aeschli commented Aug 7, 2018

Oh, I see, fetch now works in web workers on Chrome. It would be cool to also have this working in other browsers.
Other than that the PR looks fine, I added some remarks.

@aeschli aeschli self-assigned this Aug 7, 2018
@nesterone
Copy link
Contributor Author

Hi, @aeschli
Can't find any remarks from you

@@ -30,6 +30,10 @@ declare module monaco.languages.json {
*/
readonly schema?: any;
}[];
/**
* If set, the schema service would load schema content on-demand with 'fetch' if available, otherwise content would be taken from `schemas` property
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the code will always check the schemas provided through the schemas property first, and if nothing found, will use the requestService

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @aeschli
I've removed part about existing functionality

@nesterone
Copy link
Contributor Author

Hi, All
Any plans to merge PR ?

@rebornix
Copy link
Member

rebornix commented Oct 1, 2018

Gentle ping for @aeschli

@aeschli
Copy link
Contributor

aeschli commented Oct 2, 2018

@nesterone Can you remove the version change from package.json? We will do that when releasing the next editor version.

@aeschli aeschli added this to the October 2018 milestone Oct 5, 2018
@aeschli aeschli merged commit 39e2f4e into microsoft:master Oct 5, 2018
@aeschli
Copy link
Contributor

aeschli commented Oct 5, 2018

Thanks @kuzya-zz !

@themez
Copy link

themez commented Jul 23, 2020

I've met a problem that the schema resource needs credentials, can I set a custom schemaRequestService?

schemaRequestService = function (url) { 
  return fetch(url,{
    credentials: 'include'
  }).then(response => response.text())};

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants