question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for quick help in monaco-json

See original GitHub issue

I would like to add support for quick help in JSON language support if a JSON schema is provided for the JSON file the user is editing. Here is an example:

Screen Recording 2020-05-05 at 08 23 PM

It’s possible to implement it using overlay widgets but the language support doesn’t work on the main thread and instead runs under the LSP. Ideally, we can send a message from the WebWorker to the main thread and create an overlay widget for the editors if a flag is enabled.

The main problem is that the LSP doesn’t really have an access to the editor, I can work on this feature and create a PR on monaco-json if there’s interest, I already have a prototype but couldn’t really find a way to make this feature embedded into monaco-json as we don’t have access to the created editors. Instead, I’m creating an overlay widget in my editor separately talking to the language server.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aeschlicommented, Sep 9, 2020

IMO adding to monaco-json is not the right approach as this is quite a specific feature. Instead you could be looking into having your own monaco-json and replace the original one.

0reactions
burembacommented, Nov 1, 2020

I forked monaco-json and implemented getSchema(uri: Uri, position: Position)``monaco.languages.json.getWorker() and implemented an overlay widget using json-schema-visualizer. It looks to be the convenient way for this use-case. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Monaco Editor Playground
The Monaco Editor can be easily created, given an // empty container and an options literal. // Two members of the literal are...
Read more >
Create a web editor using Monaco editor, React and Node + ...
But here I will add an already supported language in Monaco Editor, JSON. For theme you can use built in themes or you...
Read more >
Use view formatting to customize SharePoint | Microsoft Learn
View formatting is currently supported only in SharePoint Online. ... JSON schema reference to assist in creation of view formatting, Monaco ...
Read more >
monaco-editor | Yarn - Package Manager
The Monaco Editor is the code editor which powers VS Code, with the features better ... Adds API to register global actions, commands,...
Read more >
Language Server Extension Guide - Visual Studio Code
The interesting part in the /client/package.json file is that it references the vscode extension host API through the engines field and adds a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found