1 ;;; completions.rkt -- completion support
3 ;; Copyright (C) 2009, 2010 Jose Antonio Ortega Ruiz
5 ;; This program is free software; you can redistribute it and/or
6 ;; modify it under the terms of the Modified BSD License. You should
7 ;; have received a copy of the license along with this program. If
8 ;; not, see <http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5>.
10 ;; Start date: Sun Apr 26, 2009 19:02
14 (provide symbol-completions
17 (require srfi/13 geiser/utils geiser/modules)
19 (define (filter-prefix prefix lst sort?)
20 (filter (lambda (s) (string-prefix? prefix s))
21 (if sort? (sort lst string<?) lst)))
23 (define (symbol-completions prefix)
25 (map symbol->string (namespace-mapped-symbols))
28 (define (module-completions prefix)
29 (filter-prefix prefix (module-list) #f))