lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
ericdallo 2021-07-01T14:17:48.256100Z

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

1
4
🔥 12
😻 4
vemv 2021-07-01T15:27:59.258900Z

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

vemv 2021-07-01T15:29:33.259600Z

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

vemv 2021-07-01T15:30:20.260600Z

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

ericdallo 2021-07-01T15:59:41.261Z

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

ericdallo 2021-07-01T16:00:02.261200Z

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

ericdallo 2021-07-01T16:00:47.261400Z

basically:

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

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

vemv 2021-07-01T16:01:27.261700Z

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

ericdallo 2021-07-01T16:01:40.261900Z

that's the idea 😄

Chase 2021-07-01T16:39:05.262700Z

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

Chase 2021-07-01T16:39:26.262800Z

Chase 2021-07-01T16:39:40.263200Z

Chase 2021-07-01T16:40:25.263600Z

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

ericdallo 2021-07-01T16:40:57.263800Z

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

ericdallo 2021-07-01T16:42:22.264Z

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

Chase 2021-07-01T16:43:19.264200Z

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

Chase 2021-07-01T16:43:31.264400Z

ericdallo 2021-07-01T16:43:33.264800Z

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

ericdallo 2021-07-01T16:43:38.265Z

Try -p ./

ericdallo 2021-07-01T16:44:02.265200Z

I need to fix that issue reported couple minutes ago

Chase 2021-07-01T16:44:55.265400Z

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

ericdallo 2021-07-01T16:45:37.265600Z

https://github.com/clojure-lsp/clojure-lsp/issues/463 this is probably your issue

ericdallo 2021-07-01T16:46:20.265900Z

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

ericdallo 2021-07-01T16:46:33.266100Z

I need to create a log path settings for better UX

Chase 2021-07-01T16:48:07.266300Z

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

ericdallo 2021-07-01T16:48:38.266500Z

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

Chase 2021-07-01T16:49:30.267Z

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!

🤘 1
Chase 2021-07-01T16:49:40.267200Z

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

ericdallo 2021-07-01T16:50:28.267500Z

Thank you :D

ericdallo 2021-07-01T20:27:53.267700Z

Released the fix!