: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 🚀
Curious, does clean-ns have an opinion on whether to insert/keep/remove a newline after :require?
oh it's in the changelog :) right? >  Improve line breaks in ns during clean-ns refactoring following the Clojure style guide.
...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
There is a option to change that behavior :clean :ns-inner-blocks-indentation
it follows the Clojure style guide, so you can configure :same-line
or :next-line
(the default)
basically:
;; :same-line
(:require [foo :as bar])
;; :next-line
(:require
[foo :as bar])
awesomesauce. great to hear that it both follows the styleguide and keeps it configurable 👌
that's the idea 😄
I was curious about the cli rename functionality but I think I'm confused about it.
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
Yes, could you check the logs? You can pass the settings log-path
Probably clojure-lsp is not analyzing correctly the entire project, is your project source-paths correct? src and test are the default
Maybe? haha I'm also finally sitting down to learn the clojure cli tools.
Oh, it seems a issue with the project-root setting
Try -p ./
I need to fix that issue reported couple minutes ago
clojure-lsp -s log-path
seems to just hang for me.
https://github.com/clojure-lsp/clojure-lsp/issues/463 this is probably your issue
clojure-lsp --settings '{:log-path "/path"}'
I need to create a log path settings for better UX
Yep, adding that -p flag did make it work.
Yeah, almost sure it's a Graalvm reflect config, I will fix it ASAP
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!
I'm super excited about all the work you've been doing on this
Thank you :D
Released the fix!