This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-14
Channels
- # aleph (3)
- # announcements (1)
- # babashka (36)
- # babashka-sci-dev (4)
- # beginners (62)
- # biff (2)
- # calva (13)
- # cider (4)
- # clj-kondo (6)
- # cljdoc (17)
- # clojure (142)
- # clojure-dev (6)
- # clojure-europe (62)
- # clojurescript (20)
- # core-async (26)
- # cursive (18)
- # data-oriented-programming (9)
- # data-science (1)
- # datahike (18)
- # events (4)
- # fulcro (4)
- # graalvm (2)
- # hyperfiddle (15)
- # interop (1)
- # jobs-discuss (8)
- # leiningen (2)
- # lsp (91)
- # malli (1)
- # missionary (11)
- # nbb (65)
- # off-topic (50)
- # practicalli (2)
- # programming-beginners (4)
- # re-frame (18)
- # remote-jobs (1)
- # shadow-cljs (53)
- # spacemacs (1)
- # specter (2)
- # sql (17)
- # tools-build (63)
- # web-security (1)
- # xtdb (15)
also, how you are creating the new file? and is it inside the source-paths from server-info?
Found the following clients for /home/mpenet/code/iam/modules/client/src/exoscale/iam/client/xzzzzzzzzzzzzz.clj: (server-id clojure-lsp, priority 0) The following clients were selected based on priority: (server-id clojure-lsp, priority 0)
ok, the workspace is somewhat broken I think , it's a multi module repository and it's connected to the root not the module itself
:project-root-uri "file:///home/mpenet/code/iam/modules/client/src/exoscale/iam/client",
is file:///home/mpenet/code/iam/modules/client/src/exoscale/iam/client
really correct for the project root? looks like it's duplicated client folder
hum, so the issue is not related to wrong source-paths /project-root as this feature relies on the same
Found the following clients for /home/mpenet/code/iam/modules/client/src/exoscale/iam/client/zzzzzzzzzzzzz.clj: (server-id clojure-lsp, priority 0) The following clients were selected based on priority: (server-id clojure-lsp, priority 0)
2022-07-14T14:40:45.190Z WARN [clojure-lsp.kondo:260] - Non-fatal error from clj-kondo: No configs copied. 2022-07-14T14:40:45.190Z INFO [clojure-lsp.handlers:124] - :did-open 3ms 2022-07-14T14:40:45.190Z INFO [clojure-lsp.server:107] - :refreshing-test-tree 0ms 2022-07-14T14:40:45.190Z INFO [clojure-lsp.handlers:418] - :code-lens 0ms 2022-07-14T14:40:45.190Z INFO [clojure-lsp.handlers:437] - :semantic-tokens-range 0ms 2022-07-14T14:40:45.212Z INFO [clojure-lsp.handlers:252] - :document-highlight 0ms 2022-07-14T14:40:45.212Z INFO [clojure-lsp.handlers:437] - :semantic-tokens-range 0ms 2022-07-14T14:40:45.212Z INFO [clojure-lsp.handlers:404] - :code-actions 0ms 2022-07-14T14:40:45.223Z INFO [clojure-lsp.handlers:418] - :code-lens 0ms 2022-07-14T14:40:45.290Z DEBUG [clojure-lsp.server:82] - Publishing 0 diagnostics for file:///home/mpenet/code/iam/modules/client/src/exoscale/iam/client/bbbbbbbbbbbbbbbbbb.clj 2022-07-14T14:40:45.291Z INFO [clojure-lsp.server:83] - :publish-diagnostics 0ms 2022-07-14T14:40:45.714Z INFO [clojure-lsp.handlers:252] - :document-highlight 0ms 2022-07-14T14:40:45.714Z INFO [clojure-lsp.handlers:430] - :semantic-tokens-full 0ms 2022-07-14T14:40:45.715Z INFO [clojure-lsp.handlers:404] - :code-actions 1ms 2022-07-14T14:40:45.715Z INFO [clojure-lsp.handlers:369] - :hover 0ms
file:///home/mpenet/code/iam/modules/client/src/exoscale/iam/client/bbbbbbbbbbbbbbbbbb.clj
is not inside a valid source-path, it would need to be on file:///home/mpenet/code/iam/modules/client/src/exoscale/iam/client/src/bbbbbbbbbbbbbbbbbb.clj
Hello, I'm having an issue where certain LSP features such as go-to-definition and get-references are getting results from the output directory in a ClojureScript project. This output directory is under the resources/ directory, which sounds like it should be ignored by default by the :source-paths-ignore-regex setting. How might I diagnose whether I need to fix some local configuration, or if this is a bug?
❯ clojure-lsp --version
clojure-lsp 2022.06.29-19.32.13
clj-kondo 2022.06.22
I continued to experience this after upgrading to a version of clojure-lsp
that supported source-paths-ignore-regex. It went away after I deleted the clj-kondo and clojure-lsp caches and restarted clojure-lsp
I'm using Kakoune, so I don't have that Emacs info. I did try to delete the caches and restart, but it didn't work. I'll try that again just in case I missed something the first time. 1. Delete all caches
rm -rf .clj-kondo/.cache
rm -rf .lsp
rm -rf .cpcache # didn't do this the first time
2. Start editor; wait for lsp to initialize3. Try list-symbol-references... ...and I'm still seeing a reference in the out directory.
we need the server info
information, emacs and calva have commands to retrieve that
I'm looking into that, but in the meantime is there a way to get this when running the server from the command line?
hum, not really this is mostly a information important for the long running session
One thing to note is that after updating to the latest version, deleting the caches, and restarting the lsp server, I don't seem to be able to hit an output directory via go-to-definition, but it is showing up in the list-refrences results.
Ok, I have the server info from Calva, but may have to sanitize it since it's a private project. What info would you be after from that?
{
"client-settings":{
"auto-add-ns-to-new-files?":true,
"document-formatting?":false,
"dependency-scheme":"jar",
"keep-require-at-start?":true,
"linters":{
},
"document-range-formatting?":false,
"cljfmt-config-path":".cljfmt.edn"
},
"project-root-uri":"file:///Users/<user>/repos/<project>",
"cljfmt-raw":"{:paths [\"src\" \"test\"], :indents {fn-traced [[:inner 0]]}}",
"clj-kondo-version":"2022.06.22",
"final-settings":{
"auto-add-ns-to-new-files?":true,
"document-formatting?":false,
"dependency-scheme":"jar",
"keep-require-at-start?":true,
"source-paths":[
"/Users/<user>/repos/<project>/src/clj",
"/Users/<user>/repos/<project>/dev-resources",
"/Users/<user>/repos/<project>/src/cljc",
"/Users/<user>/repos/<project>/env/dev/clj",
"/Users/<user>/repos/<project>/test",
"/Users/<user>/repos/<project>/src",
"/Users/<user>/repos/<project>/src/cljs"
],
"project-specs":[
{
"project-path":"project.clj",
"classpath-cmd":[
"lein",
"with-profile",
"+test,+dev",
"classpath"
]
},
{
"project-path":"deps.edn",
"classpath-cmd":[
"clojure",
"-A:test:dev",
"-Spath"
]
},
{
"project-path":"build.boot",
"classpath-cmd":[
"boot",
"show",
"--fake-classpath"
]
},
{
"project-path":"shadow-cljs.edn",
"classpath-cmd":[
"npx",
"shadow-cljs",
"classpath"
]
},
{
"project-path":"bb.edn",
"classpath-cmd":[
"bb",
"print-deps",
"--format",
"classpath"
]
}
],
"linters":{
},
"source-aliases":[
"dev",
"test"
],
"uri-format":{
"upper-case-drive-letter?":false,
"encode-colons-in-path?":false
},
"document-range-formatting?":false,
"cljfmt-config-path":".cljfmt.edn"
},
"classpath":[
...<.m2 paths cut>,
"/Users/<user>/repos/<project>/resources",
"/Users/<user>/repos/<project>/src/clj",
"/Users/<user>/repos/<project>/dev-resources",
"/Users/<user>/repos/<project>/target/classes",
"src",
"/Users/<user>/repos/<project>/src/cljc",
"/Users/<user>/repos/<project>/env/dev/clj",
"/Users/<user>/repos/<project>/test",
"/Users/<user>/repos/<project>/src",
"/Users/<user>/repos/<project>/src/cljs",
"test",
],
"port":"NREPL only available on :debug profile (`make debug-cli`)",
"server-version":"2022.06.29-19.32.13",
"log-path":"/var/folders/r4/0dgj2cyx4_v74vmp43t1sy700000gs/T/clojure-lsp.2977080460538470698.out",
"project-settings":{
}
}
I don't see any resources
on the source-paths, which looks correct, but I do see "/Users/<user>/repos/<project>/dev-resources"
, is your generated code on that folder?
source-paths
looks pretty correct, it's excluding both target and resource folders, so the only reason is if you opened that target file manually, could you try restart the editor and close all files before that to avoid editor opening those files?
No, dev-resources doesn't have any generated code in it. I've closed everything down, deleted the cache directories, and restarted my editor. But it sounds like something else must be holding onto the resources path... Aside from the cache directories I mentioned above, are there any others you might know if, or that would be stored outside of the project?
No, we do have a global cache for other purposes though, /.cache/clojure-lsp or /.config/clojure-lsp
So the good news is that after updating to the latest version of clojure-lsp, I haven't been able to get to an output file via go-to-definition. But I do still see some out references in the results of list-symbol-references command. If that holds, then at least it means I can avoid the output files if I'm paying a little bit of attention when looking at references, but I'm curious to know what's going on since this seems like it shouldn't be a possible scenario. Also, I feel like I should mention that other than this, the lsp server is working great and I've seen it improve a lot over the years, so thanks for your work on it!