Fork me on GitHub
#cursive
<
2023-02-21
>
Aurélien Bottazini15:02:28

Is there a way to get the inlay “usages” work with clojure and cursive? I find it very useful when I refactor.

onetom18:02:58

i don't think it's supported yet, but i found it super annoying in javascript code, because it makes the code jumping around, since the inlays are inserted after a bit delay, after certain operations and that shifts the lines vertically.

onetom18:02:55

i just use Cmd-B to display the usages and that popup shows the usage count too.

onetom18:02:36

otherwise, var names are also highlighted with a dimmed color, if there are no usages of them. though i found that a bit unreliable. the no usages case is not always indicated by dimming the var name.

Aurélien Bottazini18:02:21

oh that’s strange i did not notice any delay on my end on the js project i am using it with.

Aurélien Bottazini18:02:32

i forgot about the color thing thanks for the reminder

onetom18:02:15

ah, you are right, the Code author inlay is the one, which is delayed! the problem with the usages is that it wastes a lot of vertical space.

onetom18:02:08

compare these two screenshots. with and without usages inlay. it's this code: https://app.predict.gini.co/js/gini.mjs

Aurélien Bottazini18:02:42

i agree but that’s also an extreme case where every line in the file is an export

onetom18:02:21

it's a bit of an edge case, i have to admit, since there are a lot of one-liner functions in this specific file, but the exaggeration helps to highlight the issue of wasted vertical screen estate

onetom18:02:05

why do want to see it? are you using it to navigate to the call-sites via mouse clicks?

onetom18:02:39

maybe it's not such a bad idea then, if someone is in the mode of discovering a code base

onetom18:02:36

btw, did u know, that the Cmd-B is option is also bound to the Force touch event (besides Cmd-Click)?

Aurélien Bottazini18:02:33

it is for refactoring purposes. I like to see functions that are not called often (1 or twice) because i can then consider to inline those / or not. with Cmd-B I would have to do it on every function. When i see “usages” visually as an inlay hint it is easier for me to scan the code. Actually i just do it as I work on something else.

👍 2
Rebecca Stark21:02:39

👋 im having a dependency resolution issue that appears similar to https://github.com/cursive-ide/cursive/issues/572, but were still seeing it. curious if anyone has ideas on how to fix. specifically, we are building with leiningen, and in my project.clj, have :local-repo pointing to a relative path for a nested profile:

{:profiles {:dev [:some-other-profile :test]
            :some-other-profile {:local-repo "my-local-m2"}
 }
building this, intellij throws a bunch of dependency resolution errors. if i switch to the absolute /Users/path-to-repo/my-local-m2, intellij is happy, but then i have issues in docker. is there some way for me to refer to this relative path in the repo so docker and intellij can both build this project?

Rebecca Stark16:02:20

just reupping this post in case anyone has ideas. still stuck 😞

Ivar Refsdal20:02:41

What is the issue in docker? How about in docker just symlink the absolute path to where you want it to point, e.g. some relative path?

Ivar Refsdal20:02:52

(This is just a guess...)

Ivar Refsdal20:02:16

Or: could :local-repo be defined as e.g. :env/LOCAL_M2 and then specified separately in your local environment and docker? (Guessing again..)

cfleming21:02:38

Sorry Rebecca, I’ll try to look at this today.

Rebecca Stark14:03:03

got it working with dynamic eval! thanks @UGJE0MM0W

🎉 4
Ivar Refsdal19:03:18

Wow, great effort and work! 🌟