Fork me on GitHub

Hello! I have a question about auto-completion with Company in Emacs. I noticed that when trying to complete Java class methods in the Cider REPL after slash (e.g., Integer/) works fine. However, the same approach does not work in the .clj file. It hangs after slash and Company does not show any suggestions after Interger/. I've checked that the company backend is the same for the REPL and the document buffer (i.e. company-capf). Also, I tried using (add-to-list 'company-begin-commands 'cljr-slash), but no luck. Is it supposed to work like this or am I missing something?


currently that's not yet working


there is some work going on about analyzing java bytecode but we're not yet sure what's the best approach

☝️ 1

I see. Thanks for the response!


If i do a namespace renaming say from to bar.baz should clojure-lsp change explicit keywords from to :bar.baz/x?


Probably, I'm not sure as well 😅


we need to confirm that


A follow up question is should it change the keyword if it is inside a .edn file? I used the rename namespace today and found it helpful but it got me thinking if it should try harder to find all possible changes.


yeah, ATM it does not and IMO it's safer do not change edn files


BTW, answering your question, we don't rename the keyword if using as full like:
but we rename if using it with an alias like:
(:require [ :as b])

(:require [bar.baz :as b])



In this case was an integrant configuration filé so the rename was necessary. I would guess that most of the time this is true, but I agree that it could cause problems.


I'm not sure why we decided to not rename full qualified keywords when renaming ns though :thinking_face:


Yeah, using an alias makes it impossible to miss the rename. But those doesn't exist on edn files 😉


I think they are 2 different issues/features: renaming consider edn renaming ns consider renaming keywords that use that ns


I agree, 2 separate issues.


And thanks for clojure-lsp, it helps a lot on renaming, enough for me to do many more of them 👏


Thanks :) The edn one could work, but ATM clj-kondo doesn't provide analysis on edn files AFAIK, still an issue is welcome. The other one probably needs to be implemented, I'm not remembering why we decided at the time to not allow that, a issue may help discuss that


there is one use case where changing keys might cause some unexpected effects: 1. change namespace from -> 2. add namespace 3. move some code from to In that case automaticaly changed keywords can cause some extra steps of refactoring.


@U04V4KLKC could you elaborate your example on the issue please?


I’m often begin writing code in single namespace (let’s call it and when it starts to be big enough I extract some functions using following steps: • rename entire namespace -> • create empty • move some functions from back to After that can require to have access to the rest of functionality. Normally exposes api for the program, sometimes via implementation for integrant keys. If during the step 1 such keys will be changed without notice in some file it might break my program.


yes, that could happen indeed, yet not sure how ofter this flow happens for other users, it's something to consider


maybe a opt-out flag would work


yes, option would be great

👍 1