This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-29
Channels
- # announcements (4)
- # babashka (38)
- # beginners (66)
- # calva (35)
- # cider (3)
- # clj-on-windows (19)
- # cljs-dev (2)
- # clojure (29)
- # clojure-europe (15)
- # clojure-norway (2)
- # clojurescript (43)
- # clr (7)
- # community-development (6)
- # events (3)
- # hoplon (5)
- # lsp (23)
- # malli (7)
- # matrix (9)
- # nbb (53)
- # off-topic (5)
- # overtone (1)
- # practicalli (2)
- # re-frame (6)
- # reagent (17)
- # reitit (11)
- # specter (5)
- # tools-build (7)
- # xtdb (22)
When I am punching code into Calva, often when I press Enter at the end of a line, Calva changes my code into nonsense. How can I prevent this? For example, here in the pasted screenshot, I have just pressed 'n' at the end of the function name 'turn', and I press Enter, and suddenly it changes to clojure.test/run-all-tests. If I notice the intrusion before I press Enter, then I stop and think and press Esc and then try to regain my train of thought. But I like to be able to type my code thinking about my code and not battling intrusions. Can I configure Calva to suppress unsolicited suggestions?
I think it might be the setting Editor -> Accept Suggestion on Enter you want to disable:
Hi guys, just wondering if anyone can share their experience: whenever we have dependencies added to clojure project (lein for example), calva does a fantastic job letting us navigate to the definitions of the functions, but I couldn’t figure out how to get vscode to automatically add the library folder to workspace. And even if I manually added the correct folder to active workspace, activating the library ns tab doesn’t auto scroll to the file in project explorer. how do you normally do it?
Hi there! Not sure I am following correctly. Is there some particular reason you want to have the library code in your workspace?
Some times I would love to explore what else is available in the library, what other namespaces are provided etc.
If you are using tools.deps you can use aliases with local/root pointing at the library in your workspace. You might need to move the “real” library deps to an alias as well so that you can choose which coords should be used.
Right, thanks for that, probably worth testing it out, cheers Pez
A related feature in lein is "checkouts" (https://codeberg.org/leiningen/leiningen/src/branch/stable/doc/TUTORIAL.md#checkout-dependencies) - you manually clone the related project somewhere, then you make a symlink to it within your project. Two benefits - 1) lein follows the symlink instead of using the maven dependency, and 2) you can browse the symlink in VS Code's project tree.
Ah yep, have been using checkouts when developing libraries, some times the number of dependencies is too many, manually linking is a pain, I came from cursive, it allows to navigate and inspect dependency folder structures which I found quite useful sometimes.
+1 to this - calva lets you jump one deep into a library, but not jump within library code - super frustrating - would be so handy to be able to follow the actual jar files as folders (like cursive does)
same, for example my project is referring our sdk library as: sdk-util/index-by
, i can easily jump into index-by
, but if index-by
fn is using yet another function within sdk, i’m not able to cmd+click to navigate
and using “go to definition” from context menu i’m getting “no definition found”
hey pez i’m just viewing the MR you had back in 2021, seems like a similar problem
Well, that was actually fixed. Do you have a REPL connected when you try it? This is how it should work. Demonstrating that it should work in both Clojure and ClojureScript REPLs.
oh yes! working as expected once jacked in and reloaded in repl
ha, some times it’s a very quick read
Yeah, I guess that’s why we integrated clojure-lsp to begin with. For quick reads. But it has become so good so that sometimes people forget about the REPL.
Something going on in your project? I run my REPLs for months. Laptop. Closing the lid at nights.
Sharing out the conclusion in the channel for visibility: You need the REPL connected in order for many Calva features to work once you have navigated to some library code.