lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
rafaeldelboni 2020-09-21T13:05:19.002900Z

Hey I'm having a strange behavior with the current master: When I do a go to definition it works fine on the first time, but the subsequent ones to the same function doesn't work any more, this happens with all functions in my code, first time go to definition work subsequent ones doesn't. Logs:

WARN  clojure-lsp.handlers: Finding definition file:///home/delboni/dev/nu/indigo/src/indigo/controllers/challenge.clj row 24 col 48 cursor indigo.logic.challenge/status
WARN  clojure-lsp.main: DidCloseTextDocumentParams
WARN  clojure-lsp.handlers: Finding definition file:///home/delboni/dev/nu/indigo/src/indigo/controllers/challenge.clj row 24 col 48 cursor indigo.logic.challenge/status
WARN  clojure-lsp.handlers: Could not find definition for element under cursor, I think your cursor is: "logic.challenge/status" qualified as: indigo.logic.challenge/status
WARN  clojure-lsp.handlers: Finding definition file:///home/delboni/dev/nu/indigo/src/indigo/controllers/challenge.clj row 24 col 48 cursor indigo.logic.challenge/status
WARN  clojure-lsp.handlers: Could not find definition for element under cursor, I think your cursor is: "logic.challenge/status" qualified as: indigo.logic.challenge/status 

➕ 1
ericdallo 2020-09-21T13:54:20.003200Z

if you are using lsp-mode/emacs, you probably didn't imported the project correctly

ericdallo 2020-09-21T13:55:23.003400Z

Oh, I think you use vim, right?

rafaeldelboni 2020-09-21T14:18:02.003600Z

I'm using vim, what you mean with import the project?

ericdallo 2020-09-21T14:19:08.003800Z

at least for emacs, when you incorrectly import the project (not the project root, but some other file), the LSP functions work for the file, but when you change to another file, it stops working

rafaeldelboni 2020-09-21T15:07:08.004Z

In vim I just open the file, to set the root I have this settings on my lsp client provider:

"clojure-lsp": {
      "command": "bash",
      "args": ["-c", "clojure-lsp"],
      "filetypes": ["clojure"],
      "rootPatterns": ["project.clj", "deps.edn"],
      "additionalSchemes": ["zipfile", "jar"],
      "disableDiagnostics": false,
      "trace.server": "on",
      "initializationOptions": {}
    }

ericdallo 2020-09-21T15:59:57.004200Z

it looks ok to me :thinking_face:

rafaeldelboni 2020-09-21T20:14:15.004400Z

it's strange, that core clojure fn's I can use go to navigation, only my project fns that doesn't work, how can I debug this? It's even stating that my declarations are unused

rafaeldelboni 2020-09-21T20:32:00.004600Z

I rolled back to release-20200805T150718 and is working fine again :thinking_face:

ericdallo 2020-09-21T20:42:07.004800Z

@snoe uses vim, maybe he can help understand why this is happening

snoe 2020-09-21T21:01:18.005Z

@rafaeldelboni can you try latest again, but wipe out your .lsp/sqlite.1.db file before launching

snoe 2020-09-21T21:02:47.005200Z

on large projects - that initial crawl can take a long time too, until that happens you'll see the behaviour with goto def

rafaeldelboni 2020-09-21T21:04:42.005400Z

Hi I'm doing this every time and the problems still happens, I managed to trace where this started and was somewhere between release-20200828T065654 and release-20200910T181437

rafaeldelboni 2020-09-21T21:05:32.005600Z

I still have everything working on release-20200828T065654, but when I upgrade to release-20200910T181437 this behavior starts to happen

rafaeldelboni 2020-09-21T21:08:54.005800Z

after I do a lein bin I always do:

rm -rf .clj-kondo/.cache                                                                                         rm -rf .lsp

rafaeldelboni 2020-09-21T21:09:02.006Z

on the project I'm working

ericdallo 2020-09-21T21:12:32.006200Z

Hum, it's calling a didCloseTextDocument incorrectly in your log... that's why that file lost the LSP features

rafaeldelboni 2020-09-21T21:26:38.006600Z

I opened a issue if you need any more info let me know https://github.com/snoe/clojure-lsp/issues/184

snoe 2020-09-21T21:26:52.007Z

when it first starts up, do you see both `starting clj-kondo project classpath scan (this takes awhile)`   and `clj-kondo scanned project classpath in` ?

rafaeldelboni 2020-09-21T21:30:24.007400Z

coc only states: Starting LS languageserver.clojure-lsp I will paste the full initialization log here

rafaeldelboni 2020-09-21T21:30:45.007600Z

after deleting the caches

rafaeldelboni 2020-09-21T21:33:18.007800Z

In this log I have the full initialization and then I do a go to definition (that works), jump back to the previously file and tried to do the go to definition again.

rafaeldelboni 2020-09-21T21:35:45.008200Z

But yes, It says this:

INFO  clojure-lsp.crawler: starting clj-kondo project classpath scan (this takes awhile)
INFO  clojure-lsp.crawler: clj-kondo scanned project classpath in 44184ms
DEBUG clojure-lsp.main: :initialize 95239 ()
WARN  clojure-lsp.main: Initialized #object[org.eclipse.lsp4j.InitializedParams 0x1491a623 InitializedParams [