Comments (2)
How can I "move" this 1-line change into my user settings?
You'd have to move the whole config.
Do I copy all of lang.lua into one of the lua/user files? Can I re-run the language-server's setup() function from one of those? Is there some clever way to just send my 1 extra config option to the language server at run-time or something?
Pretty much, you can re-run the setup() function after.lua
, but beware, as we found in #90 it's a bit buggy, and you need to wrap it invim.schedule()
:
vim.schedule(function()
lspconfig.rust_analyzer.setup({
importPrefix = "by_self",
},
cargo = {
loadOutDirsFromCheck = true,
runBuildScripts = true
},
end)
This gave me an idea, we could probably export the built-in LSP configs so you can extend them. Basically we can pull out the table (aka object, thanks lua) out of the setup params into a file called lsp_configs.lua
, which we then import in lang.lua
. You could then import the same file in after.lua
and override anything you wanted by merging a custom config in (cue in google how to merge tables in lua, lol).
I'm not sure I'll have time to work on that anytime soon, but would accept a PR.
from nvim.
Thanks Luan, I think that did it?!?
I had to copy over some dependencies from lang.lua
, so now my full ~/.config/nvim/lua/user/after.lua
looks like this, and it seems to be working...
local lspconfig = require('lspconfig')
local capabilities = vim.lsp.protocol.make_client_capabilities()
local lsp_status = require('lsp-status')
local on_attach = function(client, bufnr)
lsp_status.on_attach(client, bufnr)
require('lsp_signature').on_attach({
debug = false,
handler_opts = {
border = "single",
},
})
end
vim.schedule(function()
lspconfig.rust_analyzer.setup({
capabilities = capabilities,
on_attach = on_attach,
settings = {
["rust-analyzer"] = {
assist = {
importGranularity = "module",
importPrefix = "by_self",
},
cargo = {
loadOutDirsFromCheck = true,
runBuildScripts = true
},
procMacro = {
enable = true
},
},
},
})
end)
Thank you!
from nvim.
Related Issues (20)
- Tmux + Tests: Is there a way to automate it exit from visual/search mode? HOT 2
- Add uninstall instructions
- fzf.vim commands not found HOT 2
- Support Macs with `arm` architecture HOT 2
- Vim-grepper is a private repo
- PackerSync fails on a fresh install HOT 2
- Plugins not properly functioning on fresh install until "PackerSync" is run and treesitter runs background update. HOT 2
- <Plug>CloserClose being printed when pressing ENTER HOT 1
- Mixing custom `.vim` configurations HOT 1
- nvim_lsp deprecated
- Error when saving files with go syntax errors: 'Error detected while processing BufWritePre Autocommands for "*.go":' HOT 2
- The after.lua script is not being loaded
- go plugin fails healthcheck with: "attempt to index global '_GO_NVIM_CFG' (a nil value)" HOT 9
- Support for hidden files HOT 4
- telescope find_files broken HOT 4
- Replace vim-ultest with neotest HOT 1
- Error in plugin nvim-autopairs lisp is null
- How to suppress automatic installation message when opening nvim HOT 2
- treesitter errors after update HOT 1
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 nvim.