Skip to content

Commit 0a0ead9

Browse files
authored
adds Prim completion (works for PS versions > 0.11.5) (#109)
1 parent fb19c26 commit 0a0ead9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

psc-ide.el

+5-3
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ Defaults to \"output/\" and should only be changed with
201201
;; Don't add an import when the option to do so is disabled
202202
(not psc-ide-add-import-on-completion)
203203
;; or when a qualified identifier was completed
204-
(or (get-text-property 0 :qualifier arg) (s-contains-p "." (company-grab-symbol))))
204+
(or (get-text-property 0 :qualifier arg) (s-contains-p "." (company-grab-symbol)))
205+
;; Don't attempt to import Prim members
206+
(string= (get-text-property 0 :module arg) "Prim"))
205207
(psc-ide-add-import-impl arg (vector
206208
(psc-ide-filter-modules
207209
(list (get-text-property 0 :module arg))))))))))
@@ -512,7 +514,7 @@ The cases we have to cover:
512514
;; 3. fil| <- filter by prefix and imported modules"
513515
(psc-ide-command-complete
514516
(vector (psc-ide-filter-prefix prefix)
515-
(psc-ide-filter-modules (psc-ide-all-imported-modules)))
517+
(psc-ide-filter-modules (cons "Prim" (psc-ide-all-imported-modules))))
516518
nil
517519
(psc-ide-get-module-name))))))
518520

@@ -626,7 +628,7 @@ on whether WARN is true. Optionally EXPANDs type synonyms."
626628
(psc-ide-qualified-type-command ident qualifier)
627629
(psc-ide-command-show-type
628630
(vector (psc-ide-filter-modules
629-
(psc-ide-all-imported-modules)))
631+
(cons "Prim" (psc-ide-all-imported-modules))))
630632
ident
631633
(psc-ide-get-module-name)))))
632634

0 commit comments

Comments
 (0)