Skip to content

tab completion for a LISP-like interpreter #778

Answered by jcubic
kovzol asked this question in Q&A
Discussion options

You must be logged in to vote

You can look at how I've created completion for LIPS Scheme. Not sure if you saw it. You can find the code for the terminal on that website here:

https://github.com/jcubic/lips/blob/master/lib/js/terminal.js#L200-L220

            completion: function(string) {
                let tokens = lips.tokenize(this.before_cursor(), true);
                tokens = tokens.map(token => token.token);
                // Array.from is need to for jQuery terminal version <2.5.0
                // when terminal is outside iframe and lips is inside
                // jQuery Terminal was using instanceof that don't work between iframes
                var env = Array.from(interpreter.get('env')().to_array());

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@kovzol
Comment options

Answer selected by kovzol
Comment options

You must be logged in to vote
1 reply
@kovzol
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants