Skip to content

Commit 5b50ada

Browse files
committed
Properly complete method names
1 parent 7f57d76 commit 5b50ada

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

js-comint.el

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,16 @@ PREFIX is the original completion prefix string."
301301
(list (car completion-res)))
302302

303303
;; When completing, e.g "console.", the prefix is included in every completion.
304-
;; TODO for console.[name] completion, want name to display in list, but console.name as completion
304+
;; For console.[name] completion, want name to display in list, but console.name as completion,
305+
;; so store original as a string property.
305306
((string-suffix-p "." prefix)
306-
(cdr ;; first is always the prefix in this case
307-
(seq-map (apply-partially #'string-remove-prefix prefix) completion-res)))
307+
(cdr ;; first is always the prefix in this case
308+
(seq-map
309+
(lambda (x)
310+
(let* ((original x)
311+
(method (string-remove-prefix prefix original)))
312+
(propertize original 'completion method)))
313+
completion-res)))
308314

309315
('t
310316
completion-res))))

0 commit comments

Comments
 (0)