question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Newbie] Cannot alter extra_paths from neovim lspconfig setup

See original GitHub issue

Using jedi-vim I can do let g:jedi#added_sys_path = ['./lib', './src',] and enjoy completion with lookup in local modules.

For the love of God I cannot make it work with neovim, 0.7.2, 0.8, 0.9 in particular.

I am using nvim-lsp-installer to easy install the plugin, then nvim-lspconfig in particular. Thus extending should happen in the setup, here is what I try:

require('lspconfig')['jedi_language_server'].setup{
...
settings = { ... }
root_dir = require("lspconfig/utils").root_pattern(".git") -- ensure root directory is found for proejcts
...
}

Added references:

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dpopchevcommented, Oct 17, 2022

GREAT! 5 days of pain ended!

require('lspconfig')['jedi_language_server'].setup{
    on_attach = on_attach,
    flags = lsp_flags,
    root_dir = require("lspconfig/util").root_pattern(".git"),
    init_options = {
            workspace = {
                extraPaths = {'./lib'}
            }
        }
}
0reactions
pappasamcommented, Oct 17, 2022

👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

nvim-lspconfig/server_configurations.md at master - GitHub
To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. --Enable (broadcasting) snippet ...
Read more >
Newbie LSP configuration problems : r/neovim - Reddit
Hi, I'm switching from Vim/CoC to Neovim/Native-LSP. For some reason the Lua LSP isn't working. After I open Neovim I receive this message...
Read more >
Neovim (nvim) unable to find local Python modules
I'm still not sure how to make this happen automatically. require("lspconfig").pyright.setup { settings = { python = { analysis = { extraPaths = ......
Read more >
Pyright unable to resolve imports that are in my PYTHONPATH
I'm running neovim with nvim-lspconfig plugin with pyright. ... so I've got a PYTHONPATH environment variable set up to help python find all...
Read more >
Setting up LSP Config in Neovim for beautiful error diagnostics
Now that we know a bit about how LSP works, let's get to setting up LSP configuration for Neovim. · Install nvim-lspconfig ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found