Fork me on GitHub

While I’m jacked into a joyride repl, I see a ton of these messages in the extension host log:

[2022-05-23 13:11:55.185] [exthost] [error] [betterthantomorrow.calva] provider FAILED
[2022-05-23 13:11:55.186] [exthost] [error] The server does not recognize or cannot perform the 'undefined' operation
I’ve been able to reproduce it by evaluating a file in the joyride repl that had no global side effects (i.e. just defs/defns). Is this something I should be worried about?


I also occasionally see some of these:

[2022-05-23 13:15:35.174] [exthost] [warning] betterthantomorrow.calva - Code actions of kind 'quickfix 'requested but returned code action is of kind 'source.organizeImports'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
They both show up all on their own after waiting a few minutes, without me doing anything


The first one is Calva being a bad nREPL client. No need to worry. The other one is some lsp message. Doesn’t look particularly worrying either.


And also a bit of show and tell! From my brief stint playing with writing iOS apps, I’ve been missing the ability to use comments to group symbols in the outline especially in long namespaces. I used Joyride to throw together a proof-of-concept! It didn’t quite work the way I’d hoped though, in the outline the symbols don’t show up inline with the other ones provided by Calva, so it doesn’t break up the outline as I’d intended. Anyone know if there’s a way to get VSCode to display those together?

metal 1

It's clojure-lsp providing the outline in Calva,.. I was expecting a script like yours to merge them, that's what the docs say should happen, but maybe it's when the same extension registers multiple providers.


That seems right, looking at the groups they’re titled by extension name


I managed to do this 😂

👌 1

We could expose this register function as an API on Calva. Then we should get the proper merge, unless the docs are lying.


Lookie here:


Ooo, how’d you get that?


The way I speculated in the message above that image. 😃


import * as vscode from 'vscode';

export const registerDocumentSymbolProvider = vscode.languages.registerDocumentSymbolProvider;


Just need to add some docs. but you can run the VSIX from this PR to try it out:


While we’re on the topic, do you know if there’s a way to get the editor tokens/scopes on a range? It would’ve been nice to detect comments rather than looking for the string ;; .*. I was surprised that I didn’t see a VSCode API for such a thing, but I very well could’ve just missed it


I don't think VS Code has that API. But Calva could expose what it is using for it.


Strange. Yeah, I guess that’s a decent workaround, though it’d make the comment mark thing harder to use across languages.


It's an old friction point in the VS Code API 😃

😿 1

Actually, I didn't test the provider well enough. It still creates a separate group.


There's some demand for a Calva API for evaluating code. The evaluation module of Calva is super messy, so we will need to do some clean up before we add external use. What would you like this API to be like? The response structure from nREPL is pretty nice to work with. And it takes reasonable inputs as well. Maybe expose those quite transparently? Asking here because it is mostly a concern for people using Joyride, I think.


I wrote up my use case, just to get it on record. I would be fine with even being able to run a custom REPL snippet and get a promise of the eval result (as long as that went to the project's nREPL, not Joyride's). But being able to get a text selection from the editor (or, preferably, the current form) and being able to decorate that with additional code and then submitting it for execution and getting the string result back would be my ideal.


Regarding the question on that issue about how to hack on Joyride code while connected to a Clojure REPL I for giving yourself some Joyride evaluation commands without starting the Joyride REPL.


That seems to be about sending code to Joyride not the project REPL?


Yes. It’s towards the question about how to use the REPL for Joyride code while connected to a project.