From efea09184eed27ca9a86e1a96a39203326633616 Mon Sep 17 00:00:00 2001 From: mathieu2em Date: Tue, 23 Jul 2019 14:33:37 -0400 Subject: completion now working and taking account of user's defined functions --- scheme/gambit/geiser/gambit.scm | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'scheme/gambit') diff --git a/scheme/gambit/geiser/gambit.scm b/scheme/gambit/geiser/gambit.scm index d8cae00..b13d5e3 100644 --- a/scheme/gambit/geiser/gambit.scm +++ b/scheme/gambit/geiser/gambit.scm @@ -117,20 +117,45 @@ (list (##procedure-search method-name))))) (define (geiser:module-completions prefix . rest) + (define (environment-symbols) - (map car ##gambit-procedures)) - (##sort-list (filter (lambda (el) - (##string-prefix? prefix el)) - (map symbol->string (environment-symbols))) - string-cistring sym) symbols-list) + symbols-list)) + (vect sym)) + (let ((sym2 (##vector-ref vect 2))) + (if (symbol? sym2) + (if (##string-prefix? prefix sym2) + (loop2 (cons (symbol->string sym2) sym-list) sym2) + (loop2 sym-list sym2)) + sym-list))) + symbols-list))) + symbols-list)))) + + (##sort-list (environment-symbols) string-ci symbol->string externe + ;; (map symbol->string (environment-symbols))) + ;; string-cistring str))) + (str-len (string-length str)) + (pref (if (string? pref) pref (symbol->string pref))) + (pref-len (string-length pref))) (and (string? pref) (string? str) (<= pref-len str-len) -- cgit v1.2.3