Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rust-analyzer doesn't show errors and suggestions neovim

I have updated my arch setup and compiled neovim 0.9.1 on just installed Debian 12.

rust-analyzer doesn't show any messages and doesn't give any autocomplete suggestions.

rust-analyzer is installed by mason, by rustup component add and by npm install.

I also have added it to the PATH so there is no errors in it.

As i understand it runs (because it doesn't throw any errors) but it just ignores the file content.

This is part of my config which is related to the issue.

vim.cmd [[packadd packer.nvim]]
require("packer").startup(function(use)
  use "wbthompson/packer.nvim"
  use "vim-airline/vim-airline"
  use 'vim-airline/vim-airline-themes'
  use 'ryanoasis/vim-devicons'
  use 'jpalardy/vim-slime'
  use 'shime/vim-livedown'
  use 'ap/vim-css-color'
  use 'terryma/vim-multiple-cursors'
  use 'mattn/emmet-vim'
  use 'scrooloose/nerdtree'
  use 'pacha/vem-tabline'
-- LSP
  use {
    'VonHeikemen/lsp-zero.nvim',
    requires = {
      -- LSP Support
      {'neovim/nvim-lspconfig'},
      {'williamboman/mason.nvim'},
      {'williamboman/mason-lspconfig.nvim'},

      -- Autocompletion
      {'hrsh7th/nvim-cmp'},
      {'hrsh7th/cmp-buffer'},
      {'hrsh7th/cmp-path'},
      {'saadparwaiz1/cmp_luasnip'},
      {'hrsh7th/cmp-nvim-lsp'},
      {'hrsh7th/cmp-nvim-lua'},
      {'hrsh7th/cmp-nvim-lsp-signature-help'},
      {'hrsh7th/cmp-vsnip'},
      {'hrsh7th/vim-vsnip'},

      -- Snippets
      {'L3MON4D3/LuaSnip'},
      {'rafamadriz/friendly-snippets'},
    },
    config = function ()
      require('mason.settings').set({
        log_level = vim.log.levels.DEBUG
      })
    end
  }
end)

require([[lspconfig]]).rust_analyzer.setup({
  on_attach = function (client, buff)
    print([[rust_analyzer is attached]])
  end,
  flags = {
    debounce_text_changes = 150
  },
  cmd = {
    [[rustup]],
    [[run]],
    [[stable]],
    [[rust-analyzer]],
    --    vim.env.HOME .. '/.cargo/bin/rust_analyzer'
  }
})

I have tried to install rust-tools and coc.nvim. rust-tools bringed no changes. coc.nvim didn't respond at all.

I also tried to install package as it helped me here neovim's lsp does not show error messages but it didn't help

If you need more info about my config here is the last I used before this issue https://github.com/onemorebruh/configs/tree/master/nvim

UPD: pyright doesn't work as i expect it too

like image 467
bruh Avatar asked Sep 18 '25 06:09

bruh


1 Answers

well i just deleted the previous project. did cargo new project_name and now it works. sorry for bothering.

the same with pyright. i just did git clone and lsp started to work.

like image 80
bruh Avatar answered Sep 23 '25 05:09

bruh