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

REPL improvements #496

Open
davidmoshal opened this issue Feb 21, 2022 · 5 comments
Open

REPL improvements #496

davidmoshal opened this issue Feb 21, 2022 · 5 comments

Comments

@davidmoshal
Copy link

  1. ability to enter multi-line statements.

kaluma-repl-1

  1. tab completing (like EspruinoJS).
  • wondering if it's possible to get this info from Jerryscript.
@niklauslee
Copy link
Member

About 2, is that works only for predefined funs and vars? Or, works exactly like typical code completion in VSCode, etc.?

@davidmoshal
Copy link
Author

Works exactly like VSCode.
Any new var / const can be tab-completed.
You should try it out.
If we had that working, then I'd be willing to work on a user interface for Kaluma similar to Espruino.

@niklauslee
Copy link
Member

It doesn't seem easy with JerryScript API. Any ideas are welcome.

@davidmoshal
Copy link
Author

I'm no C expert sadly, maybe the answer is in the Espruino codebase.

Looking at the Jerryscript api, there is the ability to look at types and enumerate their properties.
https://jerryscript.net/api-reference/#jerry_object_type_t

There is also a context:
https://jerryscript.net/api-reference/#jerry_context_t

So. presumably given the context, and the ability to enumerate the properties of an object tab completion should be possible, no?

@niklauslee
Copy link
Member

For the feature I think it is required to build partial AST (parsing incomplete JS expression).

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