Skip to content
Discussion options

You must be logged in to vote

add .nvim.lua at project root

vim.g.rustaceanvim = {
  server = {
    root_dir = vim.fn.getcwd()
  },
}

edited:

according to mrcjkb said
vim.lsp.config("rust-analyzer", { root_dir = vim.fn.getcwd() }) and :h vim.lsp.Config

• {reuse_client}?  (`fun(client: vim.lsp.Client, config: vim.lsp.ClientConfig): boolean`)
                         Predicate which decides if a client should be
                         re-used. Used on all running clients. The default
                         implementation re-uses a client if name and root_dir
                         matches.

vim.lsp.config("rust-analyzer", { root_dir = vim.fn.getcwd(), reuse_client = true })

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mrcjkb
Comment options

@eihqnh
Comment options

Answer selected by eihqnh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants