This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-10
Channels
- # aws (39)
- # babashka (4)
- # beginners (5)
- # biff (25)
- # cider (14)
- # clj-on-windows (40)
- # clojure-europe (36)
- # clojure-gamedev (1)
- # clojure-losangeles (4)
- # clojure-norway (51)
- # clojure-spec (5)
- # clojure-uk (2)
- # clojurescript (2)
- # clr (176)
- # data-science (10)
- # datalevin (17)
- # datomic (7)
- # deps-new (4)
- # docs (3)
- # emacs (12)
- # figwheel (3)
- # figwheel-main (5)
- # hyperfiddle (20)
- # instaparse (3)
- # introduce-yourself (8)
- # lsp (66)
- # malli (43)
- # off-topic (4)
- # rdf (11)
- # reagent (5)
- # releases (2)
- # sci (11)
- # shadow-cljs (24)
- # slack-help (2)
- # specter (7)
- # tools-deps (3)
- # xtdb (48)
comment-* snippets are not showing up consistently after clojure-lsp https://github.com/clojure-lsp/clojure-lsp/releases/tag/2023.01.26-11.08.16 and often fuzzy matching across a large number of Java libraries are shown instead
with version https://github.com/clojure-lsp/clojure-lsp/releases/tag/2023.02.26-23.46.05 the comment snippets were occasionally showing on one project.
I wiped all caches (.clj-kondo , .cpcache and .lsp) from the projects and tried with newer versions, but I get a lot of java matches that I am not interested in.
Is it possible to turn off matching java (I cant imagine wanting to use any of the matches that I am being given when typing comment
)
That fuzzy is probably not from clojure-lsp but the client, lsp-mode I guess is caching the first request of com
and fuzzing, but does not request comment
otherwise would not have any java class items
I am restarting Emacs each time I change clojure-lsp version (trying all clojure-lsp versions this year).
Its been happening since clojure-lsp version https://github.com/clojure-lsp/clojure-lsp/releases/tag/2023.02.26-23.46.05 was released, so I rolled back to an earlier version.
If there is nothing obvious I can do, I'll stick with https://github.com/clojure-lsp/clojure-lsp/releases/tag/2023.01.26-11.08.16 for now, which works consistently.
Its strange that its only happening on snippets that start with com
I guess because its matching so many java libraries... maybe it runs out of space or something is replacing the snippets in the results...
As soon as I change to the https://github.com/clojure-lsp/clojure-lsp/releases/tag/2023.01.26-11.08.16 clojure-lsp version the completion works correctly (even if I dont restart anything)
Because there were no java analysis before that, but the client bug could always exist
One way to confirm that is checking client server logs, and check if clojure-lsp return java items on the completion request eve if you typed comment
which I think it doesn't
Okay, I'll take a look at the logs and https://emacs-lsp.github.io/lsp-mode/page/settings/completion/#lsp-completion-no-cache (I assume that was the cache setting you mentioned)
Seems to be working now with the latest release
I found the 'global' user cache for clojure-lsp in .cache/clojure-lsp
and deleted that along with all other caches.
I also commented the java config from the user .config/clj-kondo/config.edn
(I had tried this before, but had not deleted the user cache for clojure-lsp)
;; :java
;; {:jdk-source-uri "file:///usr/lib/jvm/openjdk-17/lib/src.zip"}
I'll try including the java sources when I actually get around to using them again 🙂
Thanks for the pointers.I think removing the java feature doesn't fix the root cause, but fix your issue, would be nice to understand if there is something to improve in lsp-mode or clojure-lsp side
àlso, curious why you had jdk-source-uri specified that clojure-lsp couldn't provide by default
I already have the Java sources downloaded via the Operating System package manager, so dont need another copy 😉 Also prefer to have the same Java sources version for the JVM I am using (JDK 17) and clojure-lsp uses JDK 19 (so I dont try and use something from Java that is not available in the version I'm using - a small chance I admit, but useful to minimise issues) If I could specify the version of the JDK sources that clojure-lsp uses, that would negate the need for this setting. Perhaps having latest and LTS versions as an option (to limit the number of java sources to maintain). I dont know if anyone else shared the same pedantic nature though 😄
That's the point, clojure-lsp already seek for your JVM installed in your system, if not found then it downloads if no URI is specified.
More details https://clojure-lsp.io/settings/#java-support, so TLDR: avoid changing the defaults unless you need it :)
I wonder if it’s possible (and useful) to have something like clojure-lsp browse
serve a github-style webpage, acting as a read-only editor for a clojure project. That way, people can just click on var symbols to go to definition, or find where vars are used without having to setup an editor.
i think @U04V15CAJ created something like this with clj-kondo
I just tried quickdoc, thanks! I like it.
it generates api docs as a markdown file, but doesn’t show source code for navigating references
@U061E2UBT it shows a link to the source code
i suspect not too hard to extend it to generate html, put each namespace in a separate section and include collapsible source code blocks
I think @U061E2UBT expects something more like GitHub which for some langs allow clicking and navigating to definition and references
@U061E2UBT So in the link above: I posted that idea but haven't implemented it yet. You can do so using the analysis data: https://github.com/clj-kondo/clj-kondo/tree/master/analysis and then use something like nextjournal/clojure-mode + UI skillz which you have :)
@UKFSJSM38 and even crazier than that, I’d like the option to place a function’s source in something like http://OrgPad.com, so when I click a reference it opens a node in a graph
orgpad is so good, I’m surprised I couldn’t find its clojure author Pavel Klavik on slack to tag here
it’s made in blazing fast clojurescript, and the UI is very polished, joy to use
I've interacted with him on Telegram once and actually I think I convinced him to come here in the past to discuss some development thing around bb
no sorry, that was https://twitter.com/KaliszAd
@U04V15CAJ would this be better as a kondo browse
or clojure-lsp browse
command
this is how I used orgpad to understand a reagent thing btw
oh my, @U0739PUFQ already built the graph browser thing: https://github.com/jpmonettas/clograms/
> Any function x-references, protocols or multimethods is one click away
I'd say this is something to be created in a new project, not kondo or LSP, seems really cool, quite specific too, but could use kondo analysis
ok, that idea is slightly different than what I had in mind: my idea was just the github code UI but you could click on locals and vars and get x-refs and you could just navigate on an HTML page like you could in your IDE
There's also this one, based on clj-kondo analysis but it doesn't show the source, just the nodes + edges https://github.com/benedekfazekas/morpheus
Yeah, I think the most complicated is provide find definition and references and navigation reliable which is already built-in in clojure-lsp. Maybe that tool could use LSP under the hood?
@U04V15CAJ @UKFSJSM38 what do you guys think of a github browser plugin that turns symbols into links?
is clj-kondo simple enough to surmise where a symbol is defined just from a single file’s text
@U061E2UBT clj-kondo is designed to work with single files, not with whole projects, yes but note that it doesn't work in ClojureScript today
so clj-kondo can work in js yeah?
actually I don’t see how we could get the definition’s line number in an external file, from just looking at a single file
or we can just make a PR to add clojure to GitHub‘s semantic library, and it would work: https://github.com/github/semantic
Last time I spoke with any of the Github people they told me their IDE features were supported by tree-sitter but what you're showing seems to be a Haskell project
hum, I thought they were using https://lsif.dev/, brother of LSP
github’s builtin code navigation uses semantic, which uses tree-sitter: https://github.com/github/semantic/blob/main/docs/adding-new-languages.md
I’ll ask in #tree-sitter
I can tell you right now that tree-sitter-clojure won't get you any semantic information about clojure
good to know
yeah the tree-sitter-clojure docs just point to clj-kondo for parsing semantic info: https://github.com/sogaiu/tree-sitter-clojure/blob/master/doc/scope.md
alright I think I’m caught up on the landscape of tooling that’s been done here. thanks yall