Fork me on GitHub

That's pretty neat.


There are a few nice things I've seen on emacs, like showing the number of references to a particular function, beside the function. I suppose 'tho, that would be (in my case) a conjure thing to do. (or maybe not, not sure how that would work)


coc + clojure-lsp does this out of the box!


Is the code hosted somewhere? I cannot seem to find it


Yeah, I was looking for the github too


thanks, my search engine did not find it for some reason..


You're welcome 😉


I wonder if there could be a plugin for neovim + clojure-lsp that shows the references, aka


Just curious, but why is this useful to you?


I care about vars with no references, but now I wonder if I may be missing some trick with the actual ref count.


It shows quickly, in a namespace, if it's been used elsewhere


that is all. Just a fact, doesn't mean I have to act upon it 🙂


(perhaps a fn with too high a reference count, could indicate something important to look at 🙂 )


Got it, thanks 👍


which emac'ers see.


is this something else than coc-references ?


It's related to it


You are talking specifically about the floating text above the function(s)?


(and it can appear at the side too)


I think perhaps, that may be further extension for the new coc-clojure plugin by @nbtheduke?


if you do coc-references, which I map to ,cs for me, it opens up the quickfix window


i see, that would be neat. Does the text typically flash or stay permanent next to the function?


I would suspect permanent, but configurable? I.e., on cursor move, after 500ms, remove it?

Noah Bogart10:07:48

The references appear if you turn on code lens and are running neovim. I’m on my phone so I don’t have the coc setting on hand


I have this exact behavior working with coc + clojure-lsp. I believe it just works out of the box, although I may also have something in my config that enables it. Will look soon and confirm.


it's probably a setting


codeLens.enable on my coc-settings.json

👍 4

I keep getting double warnings and such. I think it is maybe because I have both clj-kondo and clojure-lsp set up in my coc-settings.json. Should I take out the clj-kondo stuff as clojure-lsp is using it?


Actually that specific warning is only coming from clojure-lsp, not kondo


The only linter in lsp is currently unused-public-var because clj-kondo doesn't have that one


I also get similar behavior if it's just a clj-kondo lint as well


if you are using clojure-lsp you can turn clj-kondo off, because clojure-lsp is using clj-kondo for linting as well

👍 3

That's what I was thinking. I should have tested this all myself before bugging you folks. Thanks for the quick response!


Actually, that didn't help. I only have clojure-lsp in my coc-settings.json and am still getting the double warning. Hmmm.


Actually, it's the new coc-clojure plugin that was causing it. @nbtheduke

Noah Bogart17:07:39

do you use ALE? if so, make sure you set the g:ale_linters setting for clojure to [''] , as clojure-lsp uses clj-kondo and doesn’t need a second warning, and let g:ale_disable_lsp = 1 to disable ale’s built-in lsp support so only coc.nvim’s lsp is running


I only use coc.nvim. Maybe it's conjure? Not sure if it's calling out to the lsp

Noah Bogart17:07:12

hmm i’m not sure

Noah Bogart17:07:22

what’s your vimrc?

Noah Bogart17:07:46

You need to remove the clojure-lsp section from your coc-settings.json file

Noah Bogart17:07:56

the coc-clojure plugin supersedes it


that works, cool. Simplifies my config quite a bit then.

Noah Bogart17:07:10

so glad to help!


I noticed you aren't keeping your dotfiles repo on github up to date. I was hoping to be lazy and steal all these new coc-clojure keybindings from you.

Noah Bogart17:07:01

ah damn, true! lemme do that now


lol, sweet

Noah Bogart18:07:48

my vimrc is long and messy, so my apologies

Noah Bogart18:07:10

the coc stuff is mostly copied from the coc.nvim repo


Awesome, thanks for doing that. I was mostly having fun, not asking you to put in the work.


You only have the thread last keybinding anyways it seems. You haven't started using your own fancy new plugin yet, have ya? haha


@nbtheduke not all the clojure-lsp from the coc-settings, surely?

Noah Bogart18:07:28

haha I only defined that one to test it out! I just run the code actions or CocCommands to do stuff normally


for example, my coc-settings, I have this:


"languageserver": {
    "clojure-lsp": {
      "command": "clojure-lsp",
      "filetypes": ["clojure"],
      "disableDiagnostics": false,
      "rootPatterns": ["deps.edn", "project.clj"],
      "additionalSchemes": ["jar", "zipfile"],
      "trace.server": "verbose",
      "initializationOptions": {
        "project-specs": [
          "project-path": "deps.edn",
          "classpath-cmd": ["clj", "-Spath"]
          "project-path": "project.clj",
          "classpath-cmd": ["lein", "classpath"]
        "use-metadata-for-privacy?": true,
        "ignore-classpath-directories": true


In what you say above, you say remove the clojure-lsp section from the coc-settings


Ahh, I didn't think of that. I removed it wholesale cuz I only had the base settings copy and pasted in there. I didn't have it customized


Right, so, how does that work with the coc-clojure plugin now?

Noah Bogart18:07:40

good point, i’ll update the readme

Noah Bogart18:07:30

the languageserver object in coc-settings.json is for defining ad-hoc lsps, so it lets you define the lsp-specific settings there and some various coc.nvim specific settings for defining an lsp


Is that section, therefore, not required if using the coc-clojure plugin?


And if so, how do I then pass enable things like rootPatters, tracing the server, and ensuring the diagnostics are not disabled (which will cause the interaction with clojure-lsp and clj-kondo to fail)

Noah Bogart18:07:43

right, it’s not. if you want to carry some of those settings over, you define them in the base coc-settings.json object:

"clojure.executable": "/Users/noah/Personal/clojure-lsp/clojure-lsp",
    "clojure.startup-message": true,
    "clojure.trace.server": "verbose",
    "clojure.initialization-options.text-document-sync-kind": ":incremental",
    "clojure.initialization-options.use-metadata-for-privacy?": true,
    "clojure.initialization-options.ignore-classpath-directories": true,


and the project-specs?

Noah Bogart18:07:46

either define them locally (project/.lsp/config.edn) or globally (~/.lsp/config.edn) or rely on the defaults

Noah Bogart18:07:36

i think i left that out cuz i couldn’t figure out how to write it in the coc settings definition language, but we’ll see

Noah Bogart18:07:50

def gotta be explicit about these options


Looks like my project specs aren't required, as those are the defaults anyway!

👍 2

I wish there was a central place that contains all the configs everywhere, curated to be the best possible experience....

Noah Bogart18:07:09

yeah that would be great 😞


@nbtheduke can I pick up on something again as I'm trying to understand. Let's say I want to have this option carried forward "disableDiagnostics". I had this in my language server clojure-lsp block (see previously). Looking though the code, of coc-clojure, I notice that you gather up all the values of the clojure.initialization-options, here , then you pass them through to the language server as client options here, . Does this mean, that, I would need to do clojure.initialization-options.disableDiagnostics: false in order for that option to be preserved as I had before? Thank you.