Fork me on GitHub
#lsp
<
2021-03-01
>
orestis10:03:25

What a fantastic project, many thanks to everyone 😄

❤️ 6
borkdude12:03:40

@ericdallo Does LSP emacs support something like an interactive finding of a var? I just want to enter (part of the) name

borkdude12:03:48

without hovering over it in a buffer for example

ericdallo12:03:28

Yes. the textDocument/workspaceSymbol should handle that

borkdude12:03:50

e.g. right now I am trying to find the var syntax-label but I forgot in which namespace this var was defined, but lsp knows all of this

ericdallo12:03:54

in emacs there is: lsp-ivy-workspace-symbol

ericdallo12:03:24

Or if you use helm : helm-lsp-workspace-symbol via the helm-lsp package

borkdude12:03:17

I don't use either but I'll try ivy

borkdude12:03:31

doesn't work though

borkdude12:03:28

I'll just use grep :/

ericdallo12:03:57

It works for me:

borkdude12:03:25

why did you type *clj?

ericdallo12:03:28

I don't know too much about the ivy filters

ericdallo12:03:42

but It needs some prefix

borkdude12:03:04

eh, this is too hard for me on Monday ;)

😆 3
borkdude12:03:48

can we maybe have lsp-clojure-find-var-interactively and then type some string which filters over the vars using some fuzzyness?

ericdallo12:03:52

For some reason it seems to need a first anything param :man-shrugging:

ericdallo12:03:31

that command should do that, we just need to fix that search, not sure it's a lsp-mode bug or related how the server is returning the data

ericdallo12:03:02

I tested with Dart lang and it worked perfectly, so I need to investigate why clojure-lsp is returning the symbol filtered only when it has 2 params

ericdallo12:03:05

For now you can use it with . syntax-label ,it should work

borkdude12:03:33

@ericdallo Confirming that works with lsp-ivy-workspace-symbol. I tried lsp-ivy-global-workspace-symbol which didn't work

ericdallo12:03:22

the global one get symbols from all active projects, not so useful and may have performance issue I suppose

borkdude12:03:51

ok. so it only finds symbols from the source paths right? if I type concat it doesn't return clojure.core/concat for example

ericdallo12:03:47

But maybe we should add support for it as well

ericdallo12:03:05

It makes sense to me

reefersleep13:03:02

I’m considering using lsp and kondo for a very specific feature, but it seems like a lot of setup for something so little. I haven’t delved into lsp before. Cursive users, do you think that LSP gives you some very valuable feature that you don’t get from Cursive out of the box?

ericdallo13:03:01

I was a Cursive user before Emacs, most features LSP features are available on Cursive, there is a specific one that I think only LSP has like get all references of a a keyword

orestis13:03:30

Hm, I got curious and tried the workspace-symbol from NeoVim and it doesn't seem to take the query into account -> I get all the symbols of my workspace back instead.

ericdallo14:03:21

yes, I found the issue, we don't filter on server-side only on front-end

ericdallo14:03:30

I'll fix it soon

ericdallo14:03:35

add a fuzzy search

orestis14:03:27

Thanks 🙂 glad to be providing NeoVim info 🙂

reefersleep13:03:35

Sell it to me 🙂

reefersleep13:03:52

If you can be bothered!

borkdude13:03:01

@reefersleep There are already people using the clj-kondo LSP plugin with Cursive, so at least diagnostics work for sure

borkdude13:03:19

Without clj-kondo you probably get less diagnostics from Cursive only

borkdude13:03:02

My favorite clojure-lsp feature is probably finding keywords, although TIL that Cursive also has this

borkdude13:03:42

And what you don't get with Cursive (I think) is being able to define custom (clj-kondo) hooks for your macros so the IDE "gets" them

☝️ 3
reefersleep13:03:00

That’s the interesting part for me. But I wonder if there are other killer features 🙂

borkdude13:03:35

Namespace cleanup maybe?

ericdallo13:03:08

not sure Cursive supports all clojure-lsp code actions

reefersleep13:03:47

Maybe not all, but it seems to me like there’s a big overlap. That’s why it’d be cool if Cursive users could highlight the golden differences 🙂

👍 3
ribelo19:03:10

Is there any way I can manually change the project root?

ericdallo19:03:21

are you using Emacs?

ericdallo19:03:48

lsp-workspace-folder-remove and then lsp , it'll ask for the new project-root

ribelo19:03:09

yes, emacs

ericdallo19:03:53

@borkdude @orestis latest release should fix the workspaceSymbols querying issue and the rename on a refer (bumping clj-kondo)

borkdude19:03:12

updating 🙏

ericdallo19:03:41

BTW the auto update brew action didn't work, but we have an idea to auto sed and commit to the repo

borkdude19:03:13

yeah, I'm doing something like that but then locally

borkdude19:03:29

so are you saying I should download the bin manually?

ericdallo19:03:45

for now, yep

ericdallo19:03:13

oh, we have one similar to that

ericdallo20:03:27

but it's quite simple

borkdude20:03:24

It still doesn't return symbols from clojure.core etc for me.

ericdallo20:03:02

Yes, I didn't change that, it s a lsp-mode issue since lsp-mode need to open the buffer for each symbol I think

ericdallo20:03:34

And then Emacs prompt with a lot of questions if you want to import the root of that jar

borkdude20:03:50

Then why did you poke me with > latest release should fix the workspaceSymbols querying issue ? :)

ericdallo20:03:54

So for now, until know how to fix that, I didn't enable the all analysis

ericdallo20:03:21

It fixes the querying, using fuzzy search

ericdallo20:03:35

so you don't need a prefix like before

borkdude20:03:02

you mean, I don't have to type the leading . ?

ericdallo20:03:21

and the search now use fuzzy search on server side

borkdude20:03:49

When I don't give a leading dot, the search results don't seem to be related at all.

ericdallo20:03:58

Hum, yeah, we may improve the fuzzy logic

borkdude20:03:12

I mean, there are dozens of symbols which literally have the word concat in them, which do show with . concat ;)

ericdallo20:03:09

on server side we just use the . concat to the fuzzy search

ericdallo20:03:17

have no idea how this works now hahah

borkdude20:03:21

it just returns the first results without any matching it seems

ericdallo20:03:30

yes, also, I know lsp-mode has a filtering on the front-end

kommen20:03:50

I’m running into an issue where I get different diagnostics between latest version of clj-kondo and clojure-lsp with regard to clojure-lsp not finding some macro used in cljs code. kondo seems to find the definitions and doesn’t emit warnings. how to best debug what is going on?

ericdallo20:03:32

hum, first, remove the .lsp/sqlite.db of your project

ericdallo20:03:43

and .clj-kondo/.cache

kommen20:03:07

did both and restarted clojure-lsp, same result

ericdallo20:03:20

if you can use clj-kondo on command line and it works and on clojure-lsp doesn't, please open a issue with a minimal repro, then I can test it and check why is not working if it's really a issue on clojure-lsp

kommen20:03:51

ok, thanks, will try to build a minimal repro

👍 3
devn01:03:54

@U45J3R52L If you happen to have a minute, https://github.com/clojure-lsp/clojure-lsp/issues/352 — can you reproduce by follow the repro steps in this issue?

ericdallo12:03:48

@U45J3R52L please check the issue above ☝️ it could be related with your issue indeed

kommen14:03:34

@ericdallo thank you, confirmed this is the same issue I was seeing and adding a lint-as makes it all good. Thank you!

ericdallo14:03:01

Great 😄 thank you!