Comments (20)
Your Neovim version is much too old. Please test the latest nightly.
from neovim.
Not an Nvim issue. The hover content comes from the language server and the highlights are provided by your colorscheme.
from neovim.
No it seem that the colorscheme is not the issue here, I change it from dracula to catppuccin - which a very popular colorscheme and you tell me that it does not have the syntax highlight for vim.lsp.buf.hover?
from neovim.
Who knows; we don't maintain these. (There's a reason the issue template requests reproduction steps with nvim --clean
.)
from neovim.
And how I can I do that step, can you guide me please?
from neovim.
https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#reporting-problems
from neovim.
Continue this thread, I have gone to the clangd issue and have some progress:
After reading the lsp.log, they find out that:
- clangd is indeed sending plain-text hover information instead of markdown
- the reason for this in turn is that the client does not indicate support for markdown in its client capabilities
So the first conclusion is that this is the client issue.
and after extracting the lsp.log, they say this.
Here is my lsp capabilities and attatch:
local lsp_servers = {
'clangd',
'lua_ls',
}
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
if not lspconfig_status_ok then
return
end
local my_on_attatch = function(client)
-- function lsp_highlight_document
if client.server_capabilities.documentHighlight then
vim.api.nvim_exec(
[[
augroup lsp_document_highlight
autocmd! * <buffer>
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
]],
false
)
end
client.server_capabilities.documentFormattingProvider = true
-- import lsp_keymaps function
require('user.configs.nvim_keymap').lsp_keymaps()
end
local my_capabilities = {
require('cmp_nvim_lsp').default_capabilities(),
}
for _, lsp_server in pairs(lsp_servers) do
local opts = {
on_attach = my_on_attatch,
capabilities = my_capabilities,
}
lsp_server = vim.split(lsp_server, "@")[1]
local require_ok, conf_opts = pcall(require, "user.configs.plugin_lsp.settings." .. lsp_server)
if require_ok then
opts = vim.tbl_deep_extend("force", conf_opts, opts)
end
lspconfig[lsp_server].setup(opts)
end
vim.lsp.set_log_level("DEBUG")
My apologize, gently ping @clason.
from neovim.
Please try the latest development version; the hover support has been extensively rewritten.
from neovim.
Ok I change my nvim to 0.9.5, if this is not the version you want me to change to please tell me, here is the lsp.log.
from neovim.
I meant the latest nightly (which you can download as an appimage from our releases page).
from neovim.
NVIM v0.10.0-dev-2427+geb4783fb6
Build type: RelWithDebInfo
LuaJIT 2.1.1707061634
this one?
from neovim.
Yes.
from neovim.
Here is the lsp.log for nvim 0.10.0 nightly. The hover still don't work on this version.
from neovim.
Works for me. So please create a minimal reproducible example (without plugins) I can test with nvim --clean -u test.lua
together with a C file.
from neovim.
And your log is full of ERROR
s; I'd recommend looking at and fixing those first.
from neovim.
Here is the lsp.log for nvim 0.10.0 nightly. The hover still don't work on this version.
The log still shows the client sending broken client capabilities.
I'm pretty sure the issue is related to the lines mentioning capabilities
in your config.
from neovim.
Ok the issue fix somewhat thanks to @HighCommander4, I change:
local my_capabilities = {
require('cmp_nvim_lsp').default_capabilities(),
}
to:
local my_capabilities = require('cmp_nvim_lsp').default_capabilities()
but the format not the syntax color still don't work like I want:
The hover still don't show any comment of the function, it did have syntax highlight but it should have more information like the next image. This only happen when I'm in main.c
.
Like this, this is when I'm in the file the function is define:
However it should separate the @param
and the brief comment of the function. Something like how the vscode is showing:
The function it self:
/*
* The function creates a GPIO driver object and initializes it with the specified device driver.
*
* @param dev_driver The dev_driver parameter is a pointer to a structure of type gpio_dt_spec. This
* structure contains the necessary information for initializing the GPIO driver, such as pin
* configurations and other settings.
*
* @return a pointer to a gpio_driver_t structure.
*/
gpio_driver_t *GPIO_DRIVER_Create(const struct gpio_dt_spec *dev_driver){
gpio_driver_t *dev = malloc(sizeof(gpio_driver_t));
dev->driver = dev_driver;
if (dev != NULL)
{
GPIO_DRIVER_Init(dev, GPIO_CONFIG_Input, GPIO_CONFIG_Output,
GPIO_SET, GPIO_RESET);
}
return dev;
}
Here is the lsp.log.
from neovim.
Works for me:
Again, your setup is broken, as your log clearly shows. Clangd needs a project database to get cross-file information.
And we don't care what VS Code does; we implement the LSP specification, and nothing else.
from neovim.
Thanks clason for your help.
from neovim.
However it should separate the
@param
and the brief comment of the function. Something like how the vscode is showing:
This part is a missing feature in clangd (parsing doxygen the way vscode's default c++ language server does it). We have clangd/clangd#529 on file about it.
from neovim.
Related Issues (20)
- Regression bug with `nvim_buf_set_lines` on Neovim nightly HOT 11
- nvim detects wrong background in tmux HOT 4
- CmdlineEnter is triggered when entering a file or directory via netrw
- Using the default setup for lua_ls: Undefined global "vim" HOT 3
- QuickFix and LocationList window statusline does not respect global statusline HOT 1
- Unable to resolve dependency 'memurai-developer.install' HOT 1
- Bracketed Paste handling differs in insert mode vs normal mode HOT 11
- vim.lsp.start on_init/before_init not respecting changes to config settings HOT 6
- Neovim automatically inserts "* " add the start of every new line in css files if previous line also begins with "*" HOT 1
- `WinEnter` event not triggerd after exiting builtin terminal HOT 1
- Would like better documentation of `&channel`
- Add Windows 10/11 support for Python from MS Store (solution inside) HOT 6
- Wrong description about parameters of treesitter functions
- fswatch `--latency` argument is locale dependent
- buftype variable not cleared for tab drop when splitright is true HOT 2
- Add `SessionWritePost` event HOT 3
- Add a function for async rpcrequest HOT 3
- Inconsistent behavior around vim.api.nvim_tabpage_set_var and vim.api.nvim_tabpage_get_var HOT 2
- completeopt=popup crashing neovim HOT 1
- multibyte 'langmap' doesn't work for custom mapping HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neovim.