This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-16
Channels
- # announcements (3)
- # babashka (25)
- # beginners (71)
- # calva (18)
- # clj-kondo (52)
- # cljs-dev (94)
- # cljsrn (12)
- # clojure (33)
- # clojure-europe (52)
- # clojure-nl (2)
- # clojure-uk (27)
- # clojurescript (18)
- # clojureverse-ops (4)
- # datomic (64)
- # deps-new (27)
- # depstar (5)
- # events (5)
- # fulcro (5)
- # graalvm (12)
- # graalvm-mobile (82)
- # helix (2)
- # introduce-yourself (1)
- # juxt (5)
- # lsp (10)
- # malli (7)
- # missionary (1)
- # off-topic (41)
- # pathom (69)
- # pedestal (6)
- # re-frame (4)
- # reagent (8)
- # releases (9)
- # remote-jobs (8)
- # shadow-cljs (3)
- # sql (46)
- # tools-deps (44)
- # uncomplicate (1)
- # vim (83)
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)
I wonder if there could be a plugin for neovim + clojure-lsp that shows the references, aka
I care about vars with no references, but now I wonder if I may be missing some trick with the actual ref count.
(perhaps a fn with too high a reference count, could indicate something important to look at 🙂 )
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?
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.
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?
The only linter in lsp is currently unused-public-var because clj-kondo doesn't have that one
if you are using clojure-lsp you can turn clj-kondo off, because clojure-lsp is using clj-kondo for linting as well
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
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
hmm i’m not sure
what’s your vimrc?
You need to remove the clojure-lsp
section from your coc-settings.json file
the coc-clojure plugin supersedes it
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.
ah damn, true! lemme do that now
updated
my vimrc is long and messy, so my apologies
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?
haha I only defined that one to test it out! I just run the code actions or CocCommands to do stuff normally
@U11EL3P9U what do you mean?
"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
good point, i’ll update the readme
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
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)
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,
either define them locally (project/.lsp/config.edn) or globally (~/.lsp/config.edn) or rely on the defaults https://github.com/clojure-lsp/clojure-lsp/blob/96c5e5b60b0c5ca6d772572a56e513321728088f/src/clojure_lsp/crawler.clj#L58-L67
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
def gotta be explicit about these options
I wish there was a central place that contains all the configs everywhere, curated to be the best possible experience....
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.
Actually, it's the new coc-clojure
plugin that was causing it. @nbtheduke