Fork me on GitHub
#calva
<
2021-11-27
>
pez11:11:40

Here is the latest Parinfer experiments build. https://16207-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.226-pez-253-parinfer-b6933663.vsix It should be reasonably safe to use with parinfer turned off. (And not too dangerous to use with parinfer turned on, at least not if you are experienced with Parinfer.)

emccue17:11:44

sorry, small question. Install from VSIX doesnt seem to detect the zip or the unzipped file. am i missing something

pez17:11:55

Sometimes the .vsix is downloaded as .zip (no idea why). Change the extension and it should work to install it.

emccue17:11:52

frustratingly that doesnt do it either

emccue17:11:22

calva-2.0.226-pez-253-parinfer-b6933663.vsix.zip

Marc O'Morain22:11:44

Boo! clojure.test only reports the line of failed tests, not passed tests, so you can’t make the IDE jump to the line of a passed test when you click the test.

👎 1
Marc O'Morain22:11:38

Unless we called the REPL to get the metadata of the var to read the line number, but that’s a lot of work.

bringe22:11:20

@UKFSJSM38 Does clojure-lsp have any capability for giving info on tests in codebases via static analysis? If not, could that be added, and do you think it would be appropriate to add?

ericdallo22:11:11

No it doesn't, but it's something to consider, I already implemented such feature for lsp-dart, the dart LSP server sends info about tests

ericdallo22:11:47

We would need to check what kind of info we want and how to start, ease create a issue with detailed info @U9A1RLFNV so we can discuss it

👍 1
bringe22:11:31

It might be better if @U0K592YDP created the issue, since he’s been doing test-related work. Marc, if you don’t mind creating an issue for that on the clojure-lsp repo with details such as what info would be useful for clojure-lsp to provide and anything else you might want to add, that would be great.

Marc O'Morain23:11:00

I’m currently turning the namespace name into a filepath

Marc O'Morain23:11:07

That will probably work fine in most cases

bringe23:11:19

Ah ok cool

bringe23:11:11

Yeah, I’m not sure it’s a great idea to depend on clojure-lsp for that info, especially since a repl is likely already connected (or must be?) if the person is running tests.

Marc O'Morain23:11:30

I’m half asleep here, it looks like clojure.test uses exceptions as the mechanism for conveying assertion failures.

Marc O'Morain23:11:48

This allows them to take the file and line numbers from the StackTrace of the exception.

bringe23:11:04

So, can you get line numbers for passing tests or not?

Marc O'Morain23:11:05

When assertions pass, no exception is created, so no file/line data.

ericdallo23:11:29

IMO that should be part of LSP, check dart vscode with that support: https://dartcode.org/releases/v3-27/

Marc O'Morain23:11:45

So I can’t get line data, but I can work out the filename from the namespace name.

ericdallo23:11:47

And dart has no repl :)

bringe23:11:43

Yeah, I agree that it would be great as part of clojure-lsp. I was just thinking that making Calva’s test runner depend on clojure-lsp if we could get the info from the repl might not be a good idea.

👍 1
bringe23:11:05

That’s looking great, @U0K592YDP!

Marc O'Morain23:11:24

Yeah, it does look good. That’s all down to VSCode and Calva really.

Marc O'Morain23:11:15

I’m literally taking data from testRunner.ts and putting it into a _vscode_._TestController_

bringe23:11:20

I went ahead and created an issue on clojure-lsp’s repo. Feel free to add more info there if you want.

Marc O'Morain18:11:12

Does clojure-lap have an API that you can call over and above the LSP API? Can I ask for any Clojure-specific data, such as listing vars?

ericdallo18:11:43

ATM there is only cursorInfo which brings info about the current symbol, but maybe a custom method or expose via its API a way to query kondo analysis would be helpful

👍 1
bringe22:11:02

I just came across this in https://github.com/readme/stories/cassidy-williams I was reading about open source and want to share it here: > People are intimidated to contribute to open source because they’re afraid their code will be bad, something won’t work, they’ll be called out somehow, or they’re not sure where to start. I’d suggest starting by going through issues, adding tags, or commenting, “Yes, this is a real bug. I can reproduce it.” Sometimes helping with issues is the most valuable support. You don’t have to be writing code, tests, or documentation. Over time, you can learn the code base and become a maintainer. This happens constantly: Just start small and grow.

❤️ 2
Lukas Domagala23:11:18

i’m having problems getting code actions to work, when i try “change coll to map” or “move to let” or anything really, nothing happens. i checked the lsp logs and it looks ok:

2021-11-27T23:32:43.106Z  DEBUG [clojure-lsp.server:?] - :codeAction 64ms
2021-11-27T23:32:44.157Z  DEBUG [clojure-lsp.server:?] - :resolveCodeAction 23ms
2021-11-27T23:32:44.222Z  DEBUG [clojure-lsp.server:?] - :codeAction 64ms
2021-11-27T23:33:02.028Z  DEBUG [clojure-lsp.server:?] - :documentHighlight 11ms
2021-11-27T23:33:02.258Z  DEBUG [clojure-lsp.server:?] - :codeLens 9ms
2021-11-27T23:33:02.346Z  DEBUG [clojure-lsp.server:?] - :codeAction 89ms
2021-11-27T23:33:02.522Z  DEBUG [clojure-lsp.server:?] - :resolveCodeLens 8ms

ericdallo23:11:40

It's a known calva issue

Lukas Domagala23:11:01

is there any fix for that?

ericdallo23:11:35

Nope, I have no idea why add missing code actions work but all other doesn't

ericdallo23:11:05

IMO code actions are pretty important for users, maybe we should prioritize debug it @U9A1RLFNV?

Lukas Domagala23:11:10

@UKFSJSM38 he seems to have it in progress already, but i think a “broken right now” popup or maybe even as the only option in the the menu would be less confusing

ericdallo23:11:46

Yes, we could filter out the code actions in the middleware, it is not hard

Lukas Domagala23:11:49

i just noticed it since i was playing around with clj-kondo as a dep in my project and thought i might have destroyed it myself:)

Lukas Domagala23:11:58

btw @UKFSJSM38 since i have your attention 😉 if i provide a dev time lib that uses clj-kondo as part of the analysis, is there any way to hook into the already running one in lsp or should i just rerun it from inside my lib and ignore that its wasted cycles?

ericdallo23:11:48

> i just noticed it since i was playing around with clj-kondo as a dep in my project and thought i might have destroyed it myself:) Yeah, the two feature I most use on clojure-lsp are clean-ns code action and add missing require code action :)

ericdallo23:11:12

hum, ATM it's not possible to use lsp analysis externally, but you are the second person that asks for that

ericdallo23:11:45

we could provide a custom method to provide kondo analysis, with a option to return only project analysis or with external analysis merged

bringe23:11:11

> IMO code actions are pretty important for users, maybe we should prioritize debug it Yes, it’s a top priority. I plan to spend some time on it tomorrow.

bringe23:11:51

I welcome anyone else also looking into it if you’d like, though.

ericdallo23:11:03

LMK if need any help @U9A1RLFNV I don't know too much ts though, but I already spent some time debugging that vscode library

ericdallo23:11:21

it's something with the version bump

ericdallo23:11:32

although lsp dart uses the same version and it works

bringe23:11:08

I remember there being some issue(s) when I tried to bump the version in the past, and I decided not to bump it at the time. 😞 We should push forward though and find the issue.

ericdallo23:11:20

something caught my attention is that there a code action that really works, "the add missing require" one

bringe23:11:43

Ah ok. It might help to compare the requests between that and ones that don’t work.

👍 1
bringe23:11:04

Please add that info to the ticket

Lukas Domagala23:11:07

> we could provide a custom method to provide kondo analysis, with a option to return only project analysis or with external analysis merged @UKFSJSM38 yeah that would be great. i don’t want to depend on lsp existing so that emacs users are happy, but if the analysis is there already it makes no sense for me to rerun int

ericdallo23:11:17

Could you elaborate your idea @U02EMBDU2JU? but let's move it to #lsp to not flood this channel