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

Unexpected behaviour when executing ":LspStart lua" in "init.lua" file #2842

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

didedoshka
Copy link
Contributor

Language server

lua_language_server

Problem

I have nvim config, looking like this (which I believe is common):

nvim/
  lua/
    <a bunch of .lua files>
  init.lua

When I do nvim init.lua LSP client starts, but in single_file_mode. If I do :LspStop and then :LspStart lua it doesn't start, because it can't find the root directory.

Proposed solution

If parent directory contains lua/ directory, parent should be the root directory, not parent .. "lua/".

What happens

This way the root directory for init.lua is nvim/ and for lua/file.lua is nvim/ as well, instead of what happens now (can't find root directory for init.lua and for lua/file.lua root directory is nvim/lua/)

@justinmk justinmk merged commit 55cff4b into neovim:master Jan 29, 2024
9 checks passed
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

Successfully merging this pull request may close these issues.

2 participants