Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When is local config loaded? #11

Open
juxeii opened this issue Jun 20, 2023 · 1 comment
Open

When is local config loaded? #11

juxeii opened this issue Jun 20, 2023 · 1 comment

Comments

@juxeii
Copy link

juxeii commented Jun 20, 2023

Hi,

I have this .nvim.lua local project file:

local configs = require 'nvim_lsp/configs'

configs.clangd = {
	cmd = { 
        "clangd",
        "--pretty",
        "--header-insertion=iwyu",
        "--background-index",
        "-j=40",
        "--pch-storage=memory",
        "--clang-tidy",
        "--compile-commands-dir=build"
    },
}

After trusting this file, I get

Error executing lua callback: ...re/nvim/lazy/nvim-config-local/lua/config-local/init.lua:79: VimEnter Autocommands for "*"..script /workspace/project/.nvim.lua: Vim(source):E5113: Error while calling lua chunk: /workspace/project/.nvim.lua:1: module 'nvim_lsp/configs' not
found:
        no field package.preload['nvim_lsp/configs']

Is the local config sourced before or after the home config? Or is the local config the only one sourced?

@yungthai
Copy link

yungthai commented Jul 8, 2023

I think the name of nvim_lsp/configs may be wrong?

Perhap try:

require("lspconfig").clangd.setup({
	cmd = { 
        "clangd",
        "--pretty",
        "--header-insertion=iwyu",
        "--background-index",
        "-j=40",
        "--pch-storage=memory",
        "--clang-tidy",
        "--compile-commands-dir=build"
	},
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants