New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Monaco editor #9
Conversation
…nge language highlight between sparql/json/xml depending on input/output formats. Fix URL in readme
…e by side on medium and large screen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this.
I wish you had split the different changes (improve HTML+CSS, add Monaco editor) in separates PRs, but now that it is done, I will not ask you to redo the work.
I suggested a few changes, some of them pure linting, but one of them is actually a regressop,: the input editor was previously made readable once the URL had been loaded, and this is not the case anymore.
Co-authored-by: Pierre-Antoine Champin <github-100614@champin.net>
Co-authored-by: Pierre-Antoine Champin <github-100614@champin.net>
Co-authored-by: Pierre-Antoine Champin <github-100614@champin.net>
Co-authored-by: Pierre-Antoine Champin <github-100614@champin.net>
…or is always readonly, we don't need to enable/disable it
Sorry, I thought separating it in different commits would be enough, and I needed to have the Monaco editors setup to properly do the work on the CSS display I also removed some leftovers that were not used anymore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good to me, just I am not sure I understand the situation with the input editor being set readonly when using a URL to load the RDF
When I check your original version after loading a URL the editor is still editable. Currently how we implemented in this new version the input editor is set to readonly if a URL is provided
The editor is set to read-only only while the URL is loading. The goal was two-fold
|
Ok, I fixed it |
I also have the code ready to add inline error highlighting in the editor :) It works perfectly for syntax errors I tried in trig/turtle/nt/nq! For JSON-LD we get only a position without line, I suspect this is a position after removing newlines and extra spaces, so this might need additional work to get it to work perfectly. That said the built-in JSON validation already helps to pick up all regular JSON errors Not sure if I should wait for this PR to be merged to create a new one, or if I can directly push to this PR? It's only adding 1 function ~10 lines |
nice! :)
I guess it is small enough to include, then |
I thought I had written this comment already, but I must have forgot to press 'Comment'??? There are currently two issues that are really bothering me:
As much as I appreciate and like the work you have been doing, those are really blocking issues for me at this point :-/ |
You can still toggle between the default tab behavior and adding tabs by hitting I also updated the listener to use the builtin onInputChange event of the monaco editor, so it properly updates at every change now |
Hi @pchampin , about #4 I tried running the Monaco editor using the ESM import, and it worked without any issue! (the problem I faced in my app was due to a HighlightJS import conflict). The API to manipulate the Monaco editor is quite straightforward, so I went ahead and updated the app:
There is still the placeholder in the input editor to implement, I added a comment with a pointer on how to do it
Here is what it looks like with the solarized-dark theme:
And with the solarized-light theme:
Let me know which changes you would like to do next. I am thinking about this: