spacemacs

Drew Verlee 2021-11-16T17:26:44.056900Z

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

Drew Verlee 2021-11-17T22:02:22.059100Z

@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

ericdallo 2021-11-17T22:04:32.059300Z

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

ericdallo 2021-11-17T22:05:06.059500Z

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 Verlee 2021-11-17T22:05:08.059700Z

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

ericdallo 2021-11-17T22:05:36.059900Z

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

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

Drew Verlee 2021-11-17T22:07:10.060100Z

ericdallo 2021-11-17T22:08:26.060500Z

Hum ๐Ÿค” this is mine:

Drew Verlee 2021-11-17T22:08:59.060900Z

what emacs setup do you use?

ericdallo 2021-11-17T22:09:08.061100Z

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

Drew Verlee 2021-11-17T22:09:24.061300Z

why did everyone jump on that banwagon lol

ericdallo 2021-11-17T22:09:40.061500Z

hahaha doom-emacs is awesome IMO :)

Drew Verlee 2021-11-17T22:28:18.061700Z

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

๐Ÿ‘ 1
ericdallo 2021-11-16T17:52:17.057Z

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

practicalli-johnny 2021-11-16T17:52:27.057200Z

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

ericdallo 2021-11-16T17:52:47.057400Z

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

ericdallo 2021-11-16T17:53:15.057600Z

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

ericdallo 2021-11-16T17:53:44.057800Z

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 Verlee 2021-11-16T23:33:12.058100Z

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.

ericdallo 2021-11-16T23:42:16.058300Z

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

ericdallo 2021-11-16T23:42:31.058500Z

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

Drew Verlee 2021-11-17T01:31:54.058700Z

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 Verlee 2021-11-17T01:33:15.058900Z

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.