File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change 58
58
(defun haskell-process-completions-at-point ()
59
59
" A completion-at-point function using the current haskell process."
60
60
(when (haskell-session-maybe )
61
- (let ((process (haskell-process))
62
- (symbol (symbol-at-point )))
63
- (cl-destructuring-bind (start . end) (bounds-of-thing-at-point 'symbol )
64
- (let ((completions (haskell-process-get-repl-completions
65
- process
66
- (symbol-name symbol))))
67
- (list start end completions))))))
61
+ (let ((process (haskell-process)) symbol)
62
+ (cond
63
+ ; ; ghci can complete module names, but it needs the "import "
64
+ ; ; string at the beginning
65
+ ((looking-back (rx line-start
66
+ " import" (1+ space)
67
+ (? " qualified" (1+ space))
68
+ (group (? (char upper) ; modid
69
+ (* (char alnum ?' ?. ))))))
70
+ (let ((text (match-string-no-properties 0 ))
71
+ (start (match-beginning 1 ))
72
+ (end (match-end 1 )))
73
+ (list start end
74
+ (haskell-process-get-repl-completions process text))))
75
+ ((setq symbol (symbol-at-point ))
76
+ (cl-destructuring-bind (start . end) (bounds-of-thing-at-point 'symbol )
77
+ (let ((completions (haskell-process-get-repl-completions
78
+ process (symbol-name symbol))))
79
+ (list start end completions))))))))
68
80
69
81
;;;### autoload
70
82
(defun haskell-interactive-mode-return ()
You can’t perform that action at this time.
0 commit comments