简体   繁体   中英

clojure-lsp in neovim is not navigating to function definitions/namespaces

I'm using neovim with clojure lsp for clojure development. My neovim config are exactly same as this repo .

The autosuggesting is working fine with this configuration. But when I like to navigate to function/namespace definitions, it is not working.

For example, I've local repository which it in github here. Let's say I'm working on the file src/clj/guestbook/routes/home.clj . I'm trying to click and navigate to save-message! in line 39 . But command + click or ctrl + click is not working.

功能导航不工作

Similarly when I try to navigate the namespaces, command + click is enabled as in the below image.

命名空间导航不起作用

But when I click the namespace, it open the browser with link guestbook.middleware as in the below image.

命名空间导航不起作用

nvim version -

% nvim --version
NVIM v0.9.0-dev-730+g0344bfad0-dirty
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by rnatarajan@ip-10-250-24-51.us-west-2.compute.internal

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/HEAD-0344bfa/share/nvim"

Run :checkhealth for more info

clojure-lsp details -

% clojure-lsp --version
clojure-lsp 2022.12.09-16.00.34-nightly
clj-kondo 2022.12.08

Any idea how to make clojure lsp navigation work in neovim?

I think the click that you're doing is your terminal opening up the text as a hyperlink. To go to the namespace or any other definition using clojure-lsp you can try using :lua vim.lsp.buf.definition() with the cursor on the symbol.

Hey this setup doesn't have any custom bind for the mouse command you using, so probably you getting the default nvim behaviour when ctrl + clicking in the forms.

You probably want gd to Go to Definition of a function or namespace, to use it navigate your cursor over an function name or namespace and press g and then d .

You can check all the presets command listed here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM