Comments (3)
Quick little update, the entire table only consists of inlay_hints
which is an empty table and setup
which is the setup function.
from rust-tools.nvim.
from rust-tools.nvim.
I looked into your nvim config in your repo, and I saw that you are using mason_lspconfig.setup_handlers to install the capabilities. This function will setup all of your LSPs detected by Mason.
This plugin automatically sets up nvim-lspconfig for rust_analyzer for you, so don't do that manually, as it causes conflicts.
This means, that Mason sets up rust_analyzer for you, not your configuration. Try to change your config to be something like this:
local handlers = {
function(server_name)
require('lspconfig')[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
filetypes = (servers[server_name] or {}).filetypes,
}
end,
["rust_analyzer"] = function() -- This will "skip" setting up rust_analyzer
end
}
mason_lspconfig.setup_handlers(handlers)
To setup the rust_analyzer, you want to call the modified version of on_attach function, since you want to add another keymappings. Maybe something like this:
local rt = require("rust-tools")
rt.setup({
server = {
on_attach = function(_, bufnr)
on_attach(_, bufnr) -- This calls your default on_attach function, so every keymap will be loaded correctly
vim.keymap.set("n", "<leader>ca", require("rust-tools.code_action_group").code_action_group, { buffer = bufnr})
vim.keymap.set("n", "<leader>ha", require("rust-tools.hover_actions").hover_actions, { buffer = bufnr})
end,
},
})
from rust-tools.nvim.
Related Issues (20)
- Inlay hints not working HOT 1
- Frequent SEGFAULTs after upgrading to latest version of rust-tools HOT 1
- Unable to find executable HOT 1
- Where are user commands actually getting defined? (None are available for me) HOT 1
- Change winhighlight like nvim-cmp
- Split output to the side
- cargo's toolchain uses default instead of overridden toolchain of project HOT 1
- None of the settings work
- Why I can not click run or debug in the main or test function? HOT 1
- Debugger crashing on MacOS (fatal Python error: config_get_locale_encoding)
- Inlay hints is giving wrong hints for recursive functions HOT 1
- rust-analyzer initializes again when jumping to code outside of current workspace HOT 7
- Is this tool still maintained? HOT 7
- proc macro `[name]` not expanded: Failed to run proc-macro server from path
- Rust Debuggables Window Size Too Small
- Git checkout / fugitive index error
- RustDebugables not work
- DAP not working on macOS HOT 1
- Error detected while processing TextChanuedI Autocommands for "*"
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 rust-tools.nvim.