Skip to content
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

which web editor to use? #131

Open
nikomatsakis opened this issue Feb 12, 2022 · 3 comments
Open

which web editor to use? #131

nikomatsakis opened this issue Feb 12, 2022 · 3 comments
Labels
help wanted Extra attention is needed playground Dada playground tasks (often involve JS/HTML/CSS) question Further information is requested

Comments

@nikomatsakis
Copy link
Member

Currently we are using ace.js. It was painless to setup and I've always found play.rust-lang.org quite pleasant to use. But there are some shortcomings, and thinking forward there are some features I would like that I it may not support:

  • Squiggly underlines for errors, warnings, breakpoints etc
  • Ability to overlay complex messages with arrows and things? (I want flow-based errors to look more like this., but for "borrow checker" errors.) Actually, probably nobody supports this very well natively, so I suppose I want mostly the ability to overlay things.
  • Ability to insert "hints" like rust-analyzer does. For example I want to rewrite vec.push(22) to vec.leased.push(22) or show the inferred types for things.

JS editors I'm aware of:

  • ace.js -- current choice, seems to support 2, and I think I could fake 1 in the same way we are doing breakpoints now, but I didn't see anything for 3, if I'm not mistaken
  • https://microsoft.github.io/monaco-editor/ -- presumably supports 1 and 3 above
  • https://codemirror.net/ -- I don't know what it supports!
  • other things?
@nikomatsakis nikomatsakis added help wanted Extra attention is needed question Further information is requested playground Dada playground tasks (often involve JS/HTML/CSS) labels Feb 12, 2022
@nikomatsakis
Copy link
Member Author

Given that we expect to have a VSCode extension, I wonder if using monaco will make it easier to get syntax coloring and other sorts of support?

@brson
Copy link
Contributor

brson commented Jul 30, 2022

I needed a code editor recently and tried monaco and codemirror 6. monaco was difficult to build but codemirror 6 was effortless.

@vemoo
Copy link
Contributor

vemoo commented Jul 30, 2022

I have used monaco and its api is close to vscode but not exactly the same, but there's https://github.com/TypeFox/monaco-languageclient that would make it easier to reuse the lsp server.

It does support 3: https://microsoft.github.io/monaco-editor/api/interfaces/monaco.languages.InlayHintsProvider.html

And for 2 it seems it's quite flexible: https://microsoft.github.io/monaco-editor/playground.html#interacting-with-the-editor-listening-to-mouse-events

Another point in favor may be that the editing experience is familiar it you come from vscode.

Also I think it's what a lot of web ide like projects are based on, like Compiler Explorer, CodeSandbox, StackBlitz, Theia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed playground Dada playground tasks (often involve JS/HTML/CSS) question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants