Fork me on GitHub
#lsp
<
2022-05-28
>
borkdude08:05:00

@ericdallo @snoe The newest clj-kondo has a bunch of improvements to hooks. It now supports the .clj_kondo extension for hook code, so other tooling like tools.namespace refresh and Cursive do not get confused by conflicting namespaces on the classpath. https://github.com/johnmn3/dispacio/pull/2/files#diff-3c54f031dc225e9b4fb3d0fdf8c62583d10cc9d9475e4130951dccab1ce975c8 I know that you just released lsp, but could we maybe get an upgrade with the newest clj-kondo so people can start migrating?

ericdallo14:05:03

Cool! I think I can do a release on monday including only that

borkdude14:05:27

Cool, thanks!

ericdallo14:05:54

@U04V15CAJ sorry, I will do today!

sheluchin14:05:48

Does a boolean flipping refactoring sound useful? Something that would cycle between true and false, whether directly on the boolean token or anywhere in its assignment form, like in lets, maps, defs, etc..

ericdallo14:05:50

TBH it doesn't sound useful to me 😅 could you share a example?

1
sheluchin14:05:58

If you are editing a map:

{:|a true
 :b false}
If LSP had such a refactoring option, editors could be configured to have a hotkey to flip the current boolean value to:
{:|a false
 :b false}
And the same idea anywhere a boolean is being associated to something, or even if the boolean stands on its own in a form like (identity false). It seems kinda trivial, I agree, but I think having a hotkey to do this flipping like this would save some precious keystrokes over time 😛 less navigating around the code :man-shrugging:

ericdallo14:05:48

It seems to be a really specific case which I think it's not that common for most people you know, it's a valid refactoring, but I like to consider that if we start to add a refactoring for each specific corner case we may have a lot of more code/complexity and the need to explain carefully all those refactorings. I think there are more useful refactorings we could add to clojure-lsp before, but if you disagree, you can open a issue and we can wait for other people's suggestions/upvotes too

sheluchin14:05:26

That's a fair take. I've been looking at transform.clj a little bit to understand how the refactorings are implemented, but I don't yet have a good sense for how much maintenance overhead each additional one adds to the codebase. If adding such a thing would be a fairly isolated change, I personally think it's worth it, but of course, it should be considered against the needs of the community. I'll log it as an issue, but indeed, if it adds maintenance burden or no one else cares, it shouldn't be added. Thanks!

👍 1
Daniel Vieira23:05:10

If you use vim you can try this plug-in https://github.com/AndrewRadev/switch.vim Other editors might have similar plug-ins.

sheluchin23:05:40

Thanks @U037W3C7KTR, I'll give it a try