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
My workflow for adding this into a react app differs slightly as I'm using @monaco-editor/react, but essentially in a useEffect callback that occurs once Monaco and the editor instances are mounted, I'm following the example code as such:
useEffect(()=>{if(!editorMounted)return;constxsdManager=newXsdManager(editorRef.current);xsdManager.set({path: "dummy.xsd",value: demoXsd,// this is just a const containing the demo xsd from abovealwaysInclude: true,});constxsdFeatures=newXsdFeatures(xsdManager,monacoRef.current,editorRef.current);xsdFeatures.addCompletion();xsdFeatures.addValidation();xsdFeatures.addGenerateAction();xsdFeatures.addReformatAction();},[editorMounted]);
This works for root elements:
But as soon as you try to get completion inside an element, it draws a blank:
From the XSD I would expect this to offer up completions for orderperson, shipto and item in the correct sequence, instead no completions are presented, even when the keyboard shortcut is entered.
This appears to happen for even simpler schemas too, and there aren't any console errors either.
The text was updated successfully, but these errors were encountered:
Thanks for reporting the issue. I've been noticing that some XSD's don't work because there is a lot of variation in how someone can structure it.
Currently, the parser consists of multiple xpath queries, but it doesn't cover all cases.
I've been working on it a bit, but the progress is a bit slow and I still need to merge the changes. The changes would change the queries in favor of a translation of XML to JSON.
I'm using the following example XSD:
My workflow for adding this into a react app differs slightly as I'm using @monaco-editor/react, but essentially in a
useEffect
callback that occurs once Monaco and the editor instances are mounted, I'm following the example code as such:This works for root elements:
![Screenshot 2022-06-22 at 23 30 42](https://user-images.githubusercontent.com/5690115/175164893-245d654d-45c6-4c48-801b-f4d0abbe6343.png)
But as soon as you try to get completion inside an element, it draws a blank:
![Screenshot 2022-06-22 at 23 31 36](https://user-images.githubusercontent.com/5690115/175165043-ebf1c6f6-be2a-42ff-93b5-4863785113a3.png)
From the XSD I would expect this to offer up completions for
orderperson
,shipto
anditem
in the correct sequence, instead no completions are presented, even when the keyboard shortcut is entered.This appears to happen for even simpler schemas too, and there aren't any console errors either.
The text was updated successfully, but these errors were encountered: