Fork me on GitHub
#lsp
<
2022-11-16
>
practicalli-johnny14:11:36

[Sorry, user error - ignore] Should renaming a namespaces in the src tree also be applied to requires of that namespace in files under the test tree? Renaming seems to work okay for files that require the changed namespace under src tree Or is this a feature to implemented? Example: using lsp-rename to rename a namespace …handlers to …handler which is defined in src/practicalli/api/handlers.clj, a require in the test namespace test/practicalli/api/handler-test.clj was not updated to the new name, A file under the src tree that requires the changed namespace was updated, src/practicalli/api/router.clj If relevant, I’m using LSP :: lsp-mode , Emacs 28.2, darwin with clojure-lsp 2022.11.03-00.14.57 ( clj-kondo 2022.11.02 )

borkdude14:11:36

This could be because the test directory is not on your lsp classpath somehow.

borkdude14:11:06

You could do lsp-clojure-server-info and paste that into a gist and post the link here, then we'll know the answer

practicalli-johnny14:11:09

The :source-paths key included values for the full path of the project I was working on and relative src and test paths.

borkdude14:11:30

ok, then we got that out of the way...

practicalli-johnny14:11:36

Sorry, I think this was user error… looking at the wrong file….

👍 1
practicalli-johnny14:11:30

Yes, its working correclty, unlike my covid riddled brain, sorry.

❤️ 1
mpenet16:11:40

@ericdallo would there be any interest to add something like this https://github.com/babashka/babashka/blob/b57981bcd5545ee0b223a3dfa51f15a023fbc407/examples/normalize-keywords.clj as an action maybe? It rewrites keywords that are aliased to their full/expanded form, so ::foo to :bar/foo and so on.

ericdallo16:11:31

Yes, IIRC there is a issue about that somewhere, I can search in a few minutes

mpenet16:11:01

oh! that's actually from me 🙂

mpenet16:11:08

goldfish memory, sorry

ericdallo16:11:15

😂 I probably can take a look in a few days

mpenet16:11:37

I need to open a pr, it's apparently quite easy to port the bb script to clj-lsp

ericdallo16:11:11

yep, having that code make things way easier, maybe you could try

ericdallo16:11:38

that' s the easiest/best way to start coding on clojure-lsp IMO

mpenet16:11:01

I ll give it a try tomorrow after work or friday

👍 1
ericdallo14:11:20

@U050SC7SV I added comment with some considerations, could you take a look?

ericdallo19:11:05

Done! Please test it if possible and let me know if bugs, the feature for replace all project occurrences should not be hard to implement as well, we could think in different kind of answers maybe for making that easier

mpenet19:11:38

Nice. I will try it tomorrow at work

mpenet08:11:34

I get this when I try to dl the nightly:

mpenet08:11:36

Downloading  to /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.5xRxRafd
[clojure-lsp-native-macos-aarch64.zip]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of clojure-lsp-native-macos-aarch64.zip or
        clojure-lsp-native-macos-aarch64.zip.zip, and cannot find clojure-lsp-native-macos-aarch64.zip.ZIP, period.

ericdallo10:11:36

Seem like issues on cirrus CI to build the Mac binary, will take a look

devn16:11:21

kind of a doom/cider/emacs question, but figured i’d try to ask here as i’m currently puzzled. i have a pretty vanilla install of doom, and things like (System/|) do not complete in the .clj file buffer, but they do complete in the cider buffer. Clojure fns and other requires from the file complete just fine, but not things like java.lang.System, even after explicitly importing it.

devn16:11:27

apologies for asking here, but it’s an active clojure-focused channel with some expert emacs lispers so i figured it’d be worth a shot

devn17:11:58

figured it out, needed to (setq lsp-enable-completion-at-point nil) to get cider’s completions back

borkdude17:11:33

lsp version?

borkdude17:11:52

I see in November 3's release notes that there should be some completions

ericdallo17:11:38

It's expected to not have java methods available on completion since we don't have java analysis for methods only classes

ericdallo17:11:14

Disabling lsp completion will make you only rely on cider, so repl connected always

djm08:11:11

I posted this in response to the same question in #emacs , but it might be of interest here too. You can use https://github.com/minad/cape to combine lsp and cider for completion. This seems to work with corfu, but may or may not need adapting to work with company:

(setq-local completion-at-point-functions (list (cape-super-capf #'cider-complete-at-point #'lsp-completion-at-point)))

👍 1
dev-hartmann19:11:48

hey folks, is there a smart way of checking if there is an active lsp session for my project. I'm using emacs btw 🙂

ericdallo19:11:46

lsp-describe-session ?

nwjsmith19:11:08

or eglot-list-connections, depending on your client

👍 1
ericdallo19:11:28

although I run lsp regularly to quickly confirm that

dev-hartmann19:11:35

lsp-describe session was actually my first guess, but I want to use it in a defun if and since it has the sideeffect of showing the session buffers etc. I wasnt shure if that was the way to go

ericdallo19:11:20

so you probably want (lsp-session)

dev-hartmann19:11:33

hm, that looks good

ericdallo19:11:04

that's what lsp-describe-session uses internally and it's a public lsp-mode function, so harder to stop working in the future

dev-hartmann19:11:58

cool, found it, thx!