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

Using Monaco editor instead of Codemirror #270

Closed
TheGLander opened this issue May 30, 2022 · 5 comments
Closed

Using Monaco editor instead of Codemirror #270

TheGLander opened this issue May 30, 2022 · 5 comments

Comments

@TheGLander
Copy link

Monaco editor is the editor library thing which powers Visual Studio Code, which I think is better than Codemirror with IntelliSense autocompletion and overall feel.

@gfwilliams
Copy link
Member

Do you have any specific areas where you think it'd improve things? Bear in mind that key mappings/etc are all configurable in codemirror so from the 'feel' side of things I imagine it could be configured to be basically the same.

We do currently have some code completion in the Web IDE - and replicating that with the Monaco editor would likely be nontrivial as you'd have to be able to import all the information about the types of all the built-in functions. It's not just a matter of changing a few lines to swap over.

@TheGLander
Copy link
Author

Monaco editor has very good IntelliSense which is based on TypeScript types, if maybe the declarations over at BangleApps are refined (I personally have some unpublished Espruino types which I can share), it could be way better than what CodeMirror has to say.
I understand that it would take a lot of effort to change to Monaco, but the gain from the better autocompletion is worth it, in my opinion.

@gfwilliams
Copy link
Member

Can you maybe give some examples of how it's better?

Because I don't think most people notice but the IDE's autocomplete is actually pretty clever:

image

if maybe the declarations over at BangleApps are refined

Which declaratons? Are you talking about TypeScript?

Because the IDE currently has vastly more information available to it than is in the typescript decls:

I personally have some unpublished Espruino types which I can share

You mean for TypeScript again? Honestly, I'm not sure this is a massive help - they really need to be auto-generated from the Espruino source like the IDE's ones are, or they will pretty much always end up out of date (not to mention not including the documentation). You could add extra type info to the Espruino source code and then export the TypeScript from there, and that'd be great, but there is already quite a large amount of type info in there that could be used.

@TheGLander
Copy link
Author

I meant the TypeScript declarations, sorry for not mentioning.
Here's an example of what Monaco can do:
Peek 2022-06-18 22-35 (online-video-cutter com)
This is shown in TypeScript, but Monaco basically uses the TS engine for JS, so everything will work in JS as well.
I think it would be great if Espruino interpreter/doc types could be exported to TypeScript declarations. An issue I think could happen is that TypeScript types can be way more complex that C so describing them in a doc format might be TS-centric, but I think it wouldn't be a bad thing if the reference documentation would use a single commonly-understood type format.

@gfwilliams
Copy link
Member

Closing this - realistically the IDE does most of this already and anyone that really cares about this will actually really want to use VS Code itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants