This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-20
Channels
- # announcements (1)
- # asami (6)
- # babashka (21)
- # beginners (19)
- # calva (44)
- # circleci (3)
- # clj-http (3)
- # clj-kondo (44)
- # clojure (24)
- # clojure-australia (1)
- # clojure-czech (1)
- # clojure-europe (50)
- # clojure-france (5)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-spec (8)
- # clojure-uk (8)
- # clojurescript (161)
- # datomic (4)
- # fulcro (7)
- # graalvm (8)
- # heroku (4)
- # lambdaisland (4)
- # lein-figwheel (5)
- # lsp (48)
- # malli (21)
- # meander (15)
- # off-topic (35)
- # polylith (2)
- # re-frame (21)
- # react (22)
- # reagent (13)
- # reitit (6)
- # remote-jobs (1)
- # reveal (3)
- # ring (3)
- # shadow-cljs (37)
- # testing (2)
- # tools-deps (10)
- # vim (18)
- # vrac (1)
- # xtdb (17)
Someone on twitter suggested a new refactoring in lsp: rewrite namespaced map to normal map
yes, I like both, not sure how to do it with rewrite-clj, but I can take a look later
hi, I am using lsp & clj-refactor side-by-side for now and I really like the clj-refactor mnemonics. I have added some functions from LSP to replace the operations that require code evaluation from clj-refactor's side e.g. (define-key clj-refactor-map (cljr--key-pairs-with-prefix "C-c C-m" "rs") 'lsp-rename)
instead of default rename. Nice, this works fine but not for some functions from lsp. If I bind lsp-clojure-add-missing-libspec
and try to call it directly, nothing happens but if I go down the path code actions -> add missing libspec
with the cursor on top of the same symbol, it does work
lsp-clojure-add-missing-libspec
is basically a sugar for this (lsp-clojure--refactoring-call "add-missing-libspec")
looks like refactoring-call
rely on some context?
There are at least 3 code actions about add missing something, the issue with calling the command manually is that you need to know which one use
@UBSREKQ5Q I just tested manually calling lsp-clojure-add-missing-libspec
and it worked properly instead of calling Add missing '...' require
code action
i think the problem is knowing which function to call. I tried (rop/>>=)
and rop.core
was added correctly, but (UUID/randomUUID)
does not work
you can check that already as clojure-lsp doesn't return add missing code actions for that line
if there is available, clojure-lsp will return, if not, there will not exist a code action for that line/char
and add missing code actions are always preferred
, so they appear on top of the code actions list
w8, not sure if I am following, you are saying that for java imports I would not see a Add missing 'java.util.UUID' import?
if I do C-c l a
RET
I do apply the code action, but I find confusing to remember what is code action, what is refactor, etc. If I need to rename something, is this an code action or refactor? so I wanted to rely on clj-refactor mnemonics that I already have msucle memory
> rename is a refactor btw hehe Not from Microsoft LSP eyes: https://microsoft.github.io/language-server-protocol/specification#textDocument_rename
Anyway, the keybindings page from emacs-lsp should help you as this is a common question
How do i tell LSP the root directory i want to watch? It seems to want to watch a level further down then I want. A lot of other tooling (helm?) seems to use the git directory level as root, which seems reasonable.
e.g whats happening now is i create a new project/git repo at one level "a" and it tries to watch at the parent "b". b/a/src/.../core.clj
if i create sibling directory to b, then i don't have this issue.