spacemacs 2021-11-16

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

@ericdallo 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

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

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

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

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

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

Hum ๐Ÿค” this is mine:

what emacs setup do you use?

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

why did everyone jump on that banwagon lol

hahaha doom-emacs is awesome IMO :)

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

๐Ÿ‘ 1

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

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

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

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

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

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.

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

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

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)

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.