You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue where go to definition doesn't work on classes and files. I compared it to VSCode which works similarly if it doesn't run the recipe parsing. So I can hover on inherit and get info about it, but if you go to definition on a class nothing happens. After scanning in VSCode it works as expected in VSCode. Neovim doesn't appear to do any recipe parsing which maybe is the issue.
I have set it up using mason and lspconfig. Excerpt of my config (using lazy.nvim, config based on kickstart.nvim, excluded some parts):
{
-- Main LSP Configuration
'neovim/nvim-lspconfig',
lazy = false,
dependencies = {
-- Automatically install LSPs and related tools to stdpath for Neovim
{ 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants
'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
-- Useful status updates for LSP.
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', opts = {} },
-- Allows extra capabilities provided by nvim-cmp
'hrsh7th/cmp-nvim-lsp',
},
config = function()
require('mason').setup()
-- you can add other tools here that you want mason to install
-- for you, so that they are available from within neovim.
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
'stylua', -- used to format lua code
})
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
require('mason-lspconfig').setup {
handlers = {
function(server_name)
local server = servers[server_name] or {}
-- this handles overriding only values explicitly passed
-- by the server configuration above. useful when disabling
-- certain features of an lsp (for example, turning off formatting for ts_ls)
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
require('lspconfig')[server_name].setup(server)
end,
},
}
-- add servers not supported by mason-lspconfig
require('lspconfig').bitbake_ls.setup {
root_dir = vim.fn.getcwd(),
settings = {
bitbake = {
pathtobuildfolder = '/mnt/build/prod/build/',
pathtoenvscript = '/mnt/build/prod/oe-init-build-env',
pathtobitbakefolder = '/mnt/build/prod/bitbake',
workingdirectory = '/mnt/build/prod/',
},
},
}
end,
And I can see it launches the server when I use LspInfo:
lspconfig: require("lspconfig.health").check()
LSP configs active in this session (globally) ~
- Configured servers: rust_analyzer, bashls, fortls, lua_ls, eslint, clangd, vtsls, bitbake_ls, asm_lsp
- OK Deprecated servers: (none)
LSP configs active in this buffer (bufnr: 4) ~
- Language client log: ~/.local/state/nvim/lsp.log
- Detected filetype: `bitbake`
- 1 client(s) attached to this buffer
- Client: `bitbake_ls` (id: 1, bufnr: [4])
root directory: /mnt/build/prod/
filetypes: bitbake
cmd: ~/.local/share/nvim/mason/bin/language-server-bitbake --stdio
version: `?` (Failed to get version)
executable: true
autostart: true
Docs for active configs: ~
- bitbake_ls docs: >markdown
https://github.com/yoctoproject/vscode-bitbake/tree/staging/server
https://www.npmjs.com/package/language-server-bitbake
Official Bitbake Language Server for the Yocto Project.
Can be installed from npm or github.
npm install -g language-server-bitbake
When viewing LspLog with debugging on it looks like the client does request dfinition but gets an empty result in the response. So it probably has to do with recipe parsing?
Hello @Knaifhogg
Indeed, the standalone language server boasts less features than the VSCode integration.
Like you guessed, there is no project/recipe scan on VIM, so we cannot generate the list of classes or references to other files present in your bitbake environment.
Currently, the main features available on VIM are completion and hover for official Yocto variables with their documentation. (Ex: Typing DEPE will suggest DEPENDS, and show the doc).
All the BitBake commands are run on the VSCode-client side in the current implementation, as well as many other features. Some major changes would be required to make more of them available for Vim. Although this is definitely something the Yocto Project would like to do, but we currently don't have the resources for it.
deribaucourt
changed the title
Go to definition not working in Neovim for classes and recipes
Go to definition not available in Neovim for classes and recipes
Jan 8, 2025
I have an issue where go to definition doesn't work on classes and files. I compared it to VSCode which works similarly if it doesn't run the recipe parsing. So I can hover on inherit and get info about it, but if you go to definition on a class nothing happens. After scanning in VSCode it works as expected in VSCode. Neovim doesn't appear to do any recipe parsing which maybe is the issue.
I have set it up using mason and lspconfig. Excerpt of my config (using lazy.nvim, config based on kickstart.nvim, excluded some parts):
And I can see it launches the server when I use LspInfo:
When viewing LspLog with debugging on it looks like the client does request dfinition but gets an empty result in the response. So it probably has to do with recipe parsing?
LspLog:
The text was updated successfully, but these errors were encountered: