Here’s hoping the change of defaults will not be too disruptive. It has bugged me for a long time that the defaults were not the best.
Honestly these changes to the REPL are great, the Calva experience is immediately more intuitive
It would be great if there was a command in Calva that showed a page with all of its current settings and the defaults so folks could see what they've customized. I don't know how much control you have over the settings page to display that, or whether you'd need a custom page for it?
Hmm, I wonder if a little bb script could do that based on the settings.json files and something in Calva's repo? Are all of Calva's default settings in a single source file in the repo?
Yes, they’re specified under contributes.configuration in the extension manifest (`package.json`) at the root of the repo. This file is also available in Calva’s extension folder, which may be a better choice for source, since you may be running som different version of Calva compared to what’s on the publihsed branch.
In theory all settiings and their defaults should be available in VS Code in Calva’s extension view -> features -> settings. But for some reason that view is blank when I check it…
Hmm, I might have a go at that then... thanks 🙂
You could do it with Joyride, since it will be able to resolve the current extension folder.
Maybe, but I think I'd like a CLI tool...
Cool. You’ve probably found, but anyway:
> code --list-extensions --show-versions | grep calva@
betterthantomorrow.calva@2.0.573Something I've seen over and over is when I am using a mono repo, be it polylith or my own deps hierarchy, and I select my root deps as my project root, lsp never starts, it just spins and spins forever. It's definitely not enabled because I have no "rename symbol" option on right click. Just the VSCode refactor defaults for all languages.
Fyi, on my work setup, I upgraded calva by 1 version to get on latest and refreshed the lsp server and it's magically working again. The mono repo navigation is great and navigating into separate folders/repositories is working too. No idea what the issue was.
It could have been a botched download. So when you installed a new Calva, a download was needed and this time it worked.
clojure-lsp writes a log somewhere. In /tmp/clojure-lsp.log maybe? It could contain clues around what’s (not) going on. I can say as much as that for me that works in a lot of project I’ve been involved in, so it is not something totally general.
Peter are there calva docs that list all these places where diagnostic info might live? Those aforementioned logs being one of them?
Good question. I think we may be lacking such a page. Very good idea. It could even be a Calva: Diagnostics command or something.
At work, we have a massive monorepo and in .lsp/config.edn we have
:source-aliases #{:dev :test}
to ensure that LSP can find the source (since Polylith uses :dev for "everything" and the default deps.edn essentially has no paths/dependencies).For my current test case I'm using a plain deps hierarchy with no polylith and hitting the issue but I suspect the culprit might be my VSCode project itself. I added multiple root directories to the same window. That's an arrangement that has historically always given us headache right?
Normally each repo gets a separate vsc/calva window and repl. That's stable. But I wanted to try to consolidate.
I stopped trying to do that a long time ago 🙂 I just spin up code in different folders.
I often have four or five Calva windows open.
I most often have 10 windows in Code, and 25 in Code Insiders. 😃
Even at work, I have up to three: React Native app repo, React.js frontend repo, and Clojure backend repo.
Well yeah but my setup is evolving. I now have my own codebase that I inject into all my dev repl's but I want to be able to modify it on the fly as if it was part of all my projects.
I lean heavily on Workspaces.
Use an alias in your user deps.edn and include that when starting a project repo?
Yup I use the alias that's how I load but I'm talking about windows
Although I thought the multi-root LSP issue had been solved ages ago? I just found it to be a pain with VS Code in general that way.
I want to bounce around codebases and jump to symbols within one window
Well, all that code has to be on a single classpath for LSP for that to work, yes?
Are you using Workspaces, @lambeauxworks?
Yeah I think so. When I add a new directory to my window, it turns it into a workspace right?
I'm basically right clicking the explorer and "adding folder to workspace"
Yes, they are called Folders, but sounds like what I am talking about. To me those solve a lot of that. I have a development workspace folder with deps.edn and clojure-lsp config for each workspace.
So I have the development folder as the root folder. And I teach Calva to only start clojure-lsp in that folder.
Workspaces work great with Copilot as well.
Can you clone more git repos into your development folder and as a result navigate into them by clicking symbols? E.g. a symbol in the repl that points to a dev only dep can be navigated to?
E.g. because in my case, in dev, I'm injecting functions from my dev library
Not tried that. The development folder only has deps.edn and clojure-lsp config really. Plus copilot config.
We should screenshare and show each other our workflows, @lambeauxworks! Not right now though, because late here, but anyway, maybe we can find a time.