Fork me on GitHub

Here is the latest Parinfer experiments build. 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.)


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


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


frustratingly that doesnt do it either


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.


@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?


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


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

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


Ah ok cool


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.


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.


IMO that should be part of LSP, check dart vscode with that support:

Marc O'Morain23:11:45

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


And dart has no repl :)


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

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_


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?


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

I just came across this in 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


It's a known calva issue

Lukas Domagala23:11:01

is there any fix for that?


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


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


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?


> 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 :)


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


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


> 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.


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


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


it's something with the version bump


although lsp dart uses the same version and it works


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.


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


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

👍 1

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


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