Fork me on GitHub
#lsp
<
2022-06-30
>
tatut06:06:35

I have a monorepo with common , app1 and app2 the apps have in their dev profile all the source paths of common, but common has its own project.clj as well. Now if I open a clj file in common it doesn’t consider references in the apps for any var. How should that be configured?

tatut06:06:23

Ideally I think I would like to just have a single lsp for the whole monorepo that adds all the source paths of common and the apps

rolt08:06:17

you can use :source-paths in .lsp/config.edn Not sure about the mono repo but for common you could add "../app1/src", etc

tatut08:06:42

thanks, I’ll try that

tatut08:06:58

It seems to mostly work, still saying 0 refs for some

tatut08:06:11

actually, it worked when I just put a .lsp/config.edn that lists all (common and apps) source paths in there… nice

🎉 2
ericdallo12:06:43

you could try :source-aliases as well if you have aliases in your root project.clj that consider the source-paths of common

apt18:06:33

Hi folks. Why is this x 51 showing up in the code action name? All the ’add require` actions started having those numbers after a recent update :thinking_face: (I’m using eglot, if that matters).

ericdallo18:06:14

it's how many places are already using this require with that alias

apt18:06:19

Got it. To be honest, I don’t see how this info is useful in this context :thinking_face:

ericdallo18:06:20

sometimes you can have multiple suggestions for the same alias when your project is using different alias for same namespace, so it's nice to know there are 40 using foo but only 2 using foob for example

apt18:06:07

Ahhhhh, makes sense. Maybe this number should only be displayed in such situation.

ericdallo18:06:49

I don't see any harms keeping it too, it's like a fun fact 😂

apt18:06:35

For me, before understanding it, it was more a like a mysterious fact hahahah

apt18:06:14

But yeah, no big harm in keeping it in all situations

ericdallo18:06:49

yeah, but I agree that it'd be more useful only for those cases, not sure how hard would be though to know when it's one of those cases

apt18:06:28

Ot, if it’s too hard, maybe changing how it’s displayed. Something like ‘51 alias occurrences’

dpsutton18:06:49

counter point: it’s nice to confirm that lsp is aware of the common alias and is using the same one. Big fan of this

👍 3
Noah Bogart19:06:52

I use this feature all the time. It's really helpful to keep consistent aliases when working in a big codebase

👍 1
ericdallo19:06:16

yeah, maybe just improve the text would make everyone happy

teodorlu22:06:28

Possible alternative text.: "(51 usages)"

👍 4
practicalli-johnny13:07:04

x51 seemed obvious to me and very useful (used: 51) may be more universally understood