Fork me on GitHub
#lsp
<
2021-07-01
>
ericdallo14:07:48

clojure-lsp Released https://github.com/clojure-lsp/clojure-lsp/releases/tag/2021.07.01-13.46.18 with some fixes and new exciting features 🎉 • Fix find-references and r*eferences lens* for defrecord avoiding showing wrong references count and multiple lens for the same defrecord. (c/c @borkdude) • Improve line breaks in ns during clean-ns refactoring following the https://github.com/bbatsov/clojure-style-guide#line-break-ns-declaration. • Fix clean-ns corner case issue where it would replace the :as value with the :refer value. • Deprecate :keep-require-at-start? in favor of :clean :ns-inner-blocks-indentation with default value of :next-line. • Bump org.xerial/sqlite-jdbc from 3.34.0 to 3.36.0.1. • Avoid adding duplicated namespace for new blank files even if client send request twice. (c/c @jr0cket) • Add API / CLI support, form more information check the https://clojure-lsp.github.io/clojure-lsp/api/. (c/c @vemv) Thank you @vemv and @borkdude for the API feature suggestion, this is a new feature that makes clojure-lsp a tool to be used not only with editors but anywhere, for example you can now configure your CI to clean the namespaces forms of your project, removing unused vars, sorting requires/refers/imports 🚀 or if you need a refactoring tool, you can use the new API to rename a symbol across your project directly from REPL or CLI 🚀

catjam 10
🔥 27
aw_yeah 4
😻 8
vemv15:07:59

Curious, does clean-ns have an opinion on whether to insert/keep/remove a newline after :require?

vemv15:07:33

oh it's in the changelog :) right? >  Improve line breaks in ns during clean-ns refactoring following the Clojure style guide.

vemv15:07:20

...this changed recently in refactor-nrepl, before it was opinionated (no newline). now its opinion changed to newline. But it has a flag in case you want to keep its prior behavior

ericdallo15:07:41

There is a option to change that behavior :clean :ns-inner-blocks-indentation

ericdallo16:07:02

it follows the Clojure style guide, so you can configure :same-line or :next-line (the default)

ericdallo16:07:47

basically:

;; :same-line
(:require [foo :as bar])

;; :next-line
(:require
 [foo :as bar])

vemv16:07:27

awesomesauce. great to hear that it both follows the styleguide and keeps it configurable 👌

ericdallo16:07:40

that's the idea 😄

Chase16:07:05

I was curious about the cli rename functionality but I think I'm confused about it.

Chase16:07:25

I have the var in there (lsp is actually warning me to use it) but the cli isn't showing it. I suspect this is something to do with a misunderstanding on my part about ns's or something

ericdallo16:07:57

Yes, could you check the logs? You can pass the settings log-path

ericdallo16:07:22

Probably clojure-lsp is not analyzing correctly the entire project, is your project source-paths correct? src and test are the default

Chase16:07:19

Maybe? haha I'm also finally sitting down to learn the clojure cli tools.

ericdallo16:07:33

Oh, it seems a issue with the project-root setting

ericdallo16:07:02

I need to fix that issue reported couple minutes ago

Chase16:07:55

clojure-lsp -s log-path seems to just hang for me.

ericdallo16:07:20

clojure-lsp --settings '{:log-path "/path"}'

ericdallo16:07:33

I need to create a log path settings for better UX

Chase16:07:07

Yep, adding that -p flag did make it work.

ericdallo16:07:38

Yeah, almost sure it's a Graalvm reflect config, I will fix it ASAP

Chase16:07:30

No worries on my part, I sadly don't have a need for it yet but I just started my first big project so hopefully soon!

metal 2
Chase16:07:40

I'm super excited about all the work you've been doing on this

ericdallo16:07:28

Thank you :D

ericdallo20:07:53

Released the fix!

Chase00:07:52

Yep, worked perfectly for me. Thanks!

🎉 4
Chase00:07:40

Quick question, the log is just a history of things that happened when running clojure-lsp? What would I normally set that path too?

ericdallo01:07:45

yes, is just to log what clojure-lsp is doing

ericdallo01:07:53

it's debug purposes only