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

Should a list of keywords be passed to ocamline such that they are hinted and completed if at the end of the line? #10

Open
0x0f0f0f opened this issue Jan 19, 2020 · 2 comments

Comments

@0x0f0f0f
Copy link
Contributor

I'm implementing variable/module keyword hinting and completion in the gobba REPL.
A problem may emerge (as it just did) when completion keywords have sub-keywords that depend on data structures external to linenoise/ocamline and previous sections/words in the current line. Parsing and evaluating the whole line at every keystroke is not preferable.
See 0x0f0f0f/gobba#17. Adding a function similar to the gobba keyword lookup function (currently broken) to ocamline and generalizing it for lists of strings (and adding a recursion capable keyword-finding callback as an Ocamline.read argument) would be time saving for future projects using ocamline that may try to implement the same functionality.

@0x0f0f0f 0x0f0f0f changed the title Should a list of keywords be passed to ocamline such that they are completed if at the end of the line? Should a list of keywords be passed to ocamline such that they are hinted and completed if at the end of the line? Jan 19, 2020
@chrisnevers
Copy link
Owner

I think this should be able to be handled by the hint and completion callbacks? I might not fully understand. Can you see the example I posted here: https://github.com/chrisnevers/peacock and let me know if that addresses your problem.

@0x0f0f0f
Copy link
Contributor Author

I've managed to implement a trie tree of chars in gobba. It generates completions and hints from a list of strings (the keywords in the language). Tell me if you want to get this into ocamline so that users may only have to pass a list of the keywords as an Ocamline.read argument.
Also, could you please release the new version with linenoise? I'm eager to release completion in gobba. Thank you for you work as usual!

@0x0f0f0f 0x0f0f0f reopened this Jan 22, 2020
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