This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-03
Channels
- # adventofcode (107)
- # announcements (1)
- # asami (14)
- # babashka (67)
- # beginners (89)
- # calva (34)
- # cider (17)
- # clj-kondo (5)
- # cljs-dev (2)
- # clojure (57)
- # clojure-europe (52)
- # clojure-india (1)
- # clojure-italy (1)
- # clojure-losangeles (2)
- # clojure-nl (6)
- # clojure-uk (39)
- # clojurescript (40)
- # community-development (3)
- # conjure (3)
- # cursive (17)
- # datomic (11)
- # docker (13)
- # events (3)
- # figwheel-main (3)
- # fulcro (12)
- # graalvm (7)
- # holy-lambda (7)
- # honeysql (9)
- # introduce-yourself (5)
- # malli (9)
- # minecraft (3)
- # missionary (21)
- # nextjournal (7)
- # off-topic (52)
- # pathom (3)
- # polylith (11)
- # portal (3)
- # re-frame (21)
- # reagent (34)
- # reclojure (7)
- # reitit (1)
- # reveal (11)
- # shadow-cljs (68)
- # tools-build (12)
- # tools-deps (5)
- # vim (4)
- # xtdb (9)
A month new to clojure and a day new to calva.
When I use show call hierarchy
, I get a nice call stack with “REFERENCES: CALLERS OF” on the left hand side. But when I click on a function in the call stack, the cursor goes to the defn of the function containing the call, not directly to the function invocation. If the calling function is large or there are multiple invocations in the same function, it’s a little annoying for me to have to search for exactly where the call was made.
Is there any way to go directly to a call site?
I’ve never used that feature, but it’s supported by clojure-lsp. @UKFSJSM38 Is there anything we should do on Calva’s side to make this work?
I think clojure-lsp needs to return the location of the call site rather than the definition of the function that contains the call.
[Trace - 6:55:45 PM] Received response 'callHierarchy/incomingCalls - (183)' in 3ms.
Result: [
{
"from": {
"name": "three []",
"detail": "core",
"kind": 12,
"tags": [],
"uri": "file:///Users/brandon/development/clojure-test/src/core.clj",
"range": {
"start": {
"line": 9,
"character": 6
},
"end": {
"line": 9,
"character": 11
}
},
"selectionRange": {
"start": {
"line": 9,
"character": 6
},
"end": {
"line": 9,
"character": 11
}
}
},
"fromRanges": []
}
]
I didn't understand the issue, could you elaborate what clojure-lsp should send diferently?
If I double-click bar
in the call hierarchy, the cursor is placed at the beginning of bar
on line 7. @U02PB3ZMAHH is saying they’d like the cursor to go to foo
on line 8, since the call hierarchy is for foo
. In a larger function this is more helpful. You wouldn’t have to search the function body of bar
to see where foo
is being called.
I'm afraid this is not possible the way call hierarchy protocol works, unless there is a specific field for that, I can double check that tomorrow
I see. I just noticed that even in TypeScript projects the same behavior exists (the cursor goes to the definition of the calling function, not the call site of the function at the top of the call hierarchy being viewed).
Yeah, it's funny but vscode handles typescript differently not using LSP AFAIK :man-shrugging:
I’m used to the this from Intellij/Cursive (evaluating) to wrap my brain around big projects
I’d jump back and forth between the caller and callee to try to get an idea of the code flow
@U9A1RLFNV I confirmed the behavior and it's indeed possible to achieve that following the protocol, it's just that is not clear this behavior (probably open for other languages decide to handle that diferently), IMO we can change to this behavior as for clojure seems to makes more sense, @U02PB3ZMAHH or @U9A1RLFNV could you open an issue on clojure-lsp please?
@U02PB3ZMAHH If you could do the honors, that would be great.
@UKFSJSM38 @U9A1RLFNV Do you still want an issue opened?
https://github.com/BetterThanTomorrow/calva/issues/1269#issuecomment-985332906 Good news! The better error reporting that we’ve added recently has helped someone out!
Hey guys, so I recently upgraded Calva and I'm noticing some weird behavior with parens. Say my cursor is at the point in the first image, and then I press "(". My expected state is the second image (the paren auto-closes), but what I get instead is the third image (no auto-closing of the paren). I really love Calva but this has completely broken my muscle-memory (as well as just being incovenient). Is there someway to switch the old behavior back on?
Check your User settings JSON. You might need to remove any “[clojure]” settings there regarding auto-closing brackets.
Ah, looks like I had ""editor.autoClosingBrackets": "never"
in there. I definitely don't remember adding that , but thanks @U0ETXRFEW!
I’m guessing you briefly had Calva 2.0.227 installed. It manages these settings. And then when we reverted that I think many users get a bit wonky settings…
In the last few days, VS Code/Calva has been locking up completely on me repeatedly. I think it might be related to a recent version of clojure-lsp
but it's hard to tell. The editor becomes completely unresponsive, the clojure-lsp
process spins up to 100% CPU and a Code Helper (Renderer)
spins up to 150%, then I get an alert that the editor is unresponsive - do I wait to wait, close, reopen.
Since it locks up completely, I can't get to the tabs that would show the LSP trace (and if I have that open, I can only see the tail end of some data structure at that point so that doesn't help anyway).
I've downgraded Calva to 227. If it locks up again, I'll downgrade LSP, and work backwards to see if I can spot the "bad" combination -- but any debugging pointers would be helpful...
You could try set the clojure-lsp path to something gibberish. I think that should disable clojure-lsp. To see if that gets rid of the lock-ups. If it doesn’t, then it is probably something in Calva.