|
45 | 45 | (defvar haskell-interactive-mode-history (list))
|
46 | 46 | (make-variable-buffer-local 'haskell-interactive-mode-history)
|
47 | 47 |
|
48 |
| -(defvar haskell-interactive-mode-completion-cache) |
49 |
| -(make-variable-buffer-local 'haskell-interactive-mode-completion-cache) |
50 |
| - |
51 | 48 | (defvar haskell-interactive-mode-old-prompt-start
|
52 | 49 | nil
|
53 | 50 | "Mark used for the old beginning of the prompt.")
|
@@ -95,7 +92,6 @@ Key bindings:
|
95 | 92 | :group 'haskell-interactive
|
96 | 93 | (setq haskell-interactive-mode-history (list))
|
97 | 94 | (setq haskell-interactive-mode-history-index 0)
|
98 |
| - (setq haskell-interactive-mode-completion-cache nil) |
99 | 95 |
|
100 | 96 | (setq next-error-function 'haskell-interactive-next-error-function)
|
101 | 97 | (add-hook 'completion-at-point-functions
|
@@ -1002,17 +998,13 @@ don't care when the thing completes as long as it's soonish."
|
1002 | 998 | "Offer completions for partial expression between prompt and point"
|
1003 | 999 | (when (haskell-interactive-at-prompt)
|
1004 | 1000 | (let* ((process (haskell-interactive-process))
|
1005 |
| - (inp (haskell-interactive-mode-input-partial))) |
1006 |
| - (if (string= inp (car-safe haskell-interactive-mode-completion-cache)) |
1007 |
| - (cdr haskell-interactive-mode-completion-cache) |
1008 |
| - (let* ((resp2 (haskell-process-get-repl-completions process inp)) |
1009 |
| - (rlen (- (length inp) (length (car resp2)))) |
1010 |
| - (coll (append (if (string-prefix-p inp "import") '("import")) |
1011 |
| - (if (string-prefix-p inp "let") '("let")) |
1012 |
| - (cdr resp2))) |
1013 |
| - (result (list (- (point) rlen) (point) coll))) |
1014 |
| - (setq haskell-interactive-mode-completion-cache (cons inp result)) |
1015 |
| - result))))) |
| 1001 | + (inp (haskell-interactive-mode-input-partial)) |
| 1002 | + (resp2 (haskell-process-get-repl-completions process inp)) |
| 1003 | + (rlen (- (length inp) (length (car resp2)))) |
| 1004 | + (coll (append (if (string-prefix-p inp "import") '("import")) |
| 1005 | + (if (string-prefix-p inp "let") '("let")) |
| 1006 | + (cdr resp2)))) |
| 1007 | + (list (- (point) rlen) (point) coll)))) |
1016 | 1008 |
|
1017 | 1009 | (defun haskell-interactive-mode-trigger-compile-error (state response)
|
1018 | 1010 | "Look for an <interactive> compile error; if there is one, pop
|
|
0 commit comments