Fork me on GitHub
#spacemacs
<
2021-11-16
>
Drew Verlee17:11:44

Given i'm in a clojure file, with shadow-cljs running, and a require [re-frame.core :as re-frame] if i type re-frame/` then hit tab i would want it to suggest all fpublic unctions in the re-frame namespace. I feel like in some contexts, such as my small clj projects, this works constantly. In others, work cljs projects, i see it once and a while. I'm trying to imagine what set of functionality (cider, lsp, emacs) is involved to know if i can get it working more often then not

ericdallo17:11:17

usually the completion comes from cider (runtime) or lsp (static), you need to check which one you have enabled

practicalli-johnny17:11:27

My thought would be to focus on getting it to work consistently with LSP, although I do not know how

ericdallo17:11:47

it should work consistenly on lsp, unless a bug that I'm not aware

ericdallo17:11:15

I'd suggest confirm you are using only completion from LSP and not using cider one

ericdallo17:11:44

I have this workaround on my config:

(add-hook 'cider-mode-hook (lambda () (remove-hook 'completion-at-point-functions #'cider-complete-at-point)))
it forces remove cider completion, not sure there is a better way though

👀 1
Drew Verlee23:11:12

I added that to my spaceamcs init file user-config section and still get "no matches". Do i need to enable it somehow? I'm trying to figure out what gets run when i it tab to try to get matches.

ericdallo23:11:16

First we need to confirm if the comet ion is using only LSP or any other backend

ericdallo23:11:31

Check the value of your completion-at-point-functions

Drew Verlee01:11:54

completion-at-point-functions is a variable defined in 'minibuffer.el'.
Its value is
(forge-topic-completion-at-point elisp-completion-at-point t)
Local in buffer minibuffer.el.gz; global value is 
(tags-completion-at-point-function)

Drew Verlee01:11:15

lsp-completion-mode is a variable defined in ‘lsp-completion.el’. Its value is t Local in buffer learning_stream_card.cljs; global value is nil Automatically becomes buffer-local when set.

Drew Verlee22:11:22

@UKFSJSM38 here is the output from company-diag, is that the correct place to look?

Emacs 27.2 (x86_64-pc-linux-gnu) of 2021-11-05 on lgw01-amd64-028
Company 0.9.13

company-backends: ((company-capf :with company-yasnippet)
 (company-semantic company-dabbrev-code company-gtags company-etags company-keywords :with company-yasnippet)
 (company-files :with company-yasnippet)
 (company-dabbrev :with company-yasnippet))

Used backend: (company-semantic company-dabbrev-code company-gtags company-etags company-keywords :with company-yasnippet)

Major mode: clojurescript-mode
Prefix: stop
Completions: none

ericdallo22:11:32

I'm no emacs completion expert but this is not related with company I think but the completion-at-point-functions which tell what are the completion source

ericdallo22:11:06

your company config looks correct to me, what we need to know is the completion-at-point-functions variable value in a clojure buffer with lsp and cider connected

Drew Verlee22:11:08

i pasted that to, above, though i'm still learning how to read the output. it's not simple

ericdallo22:11:36

from your output it seems to me you were not in a clojure buffer:

(forge-topic-completion-at-point elisp-completion-at-point t)

ericdallo22:11:26

Hum :thinking_face: this is mine:

Drew Verlee22:11:59

what emacs setup do you use?

ericdallo22:11:08

doom-emacs, I'm not familiar how spaceemacs configure completion functions

Drew Verlee22:11:24

why did everyone jump on that banwagon lol

ericdallo22:11:40

hahaha doom-emacs is awesome IMO :)

Drew Verlee22:11:18

Yea, i might make the switch if it ends up getting more support. I'll wait for practicalli to go first though 🙂

👍 1