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

possibly unintuitive lua_ls root_dir detection logic #3165

Open
pitkling opened this issue May 20, 2024 · 0 comments
Open

possibly unintuitive lua_ls root_dir detection logic #3165

pitkling opened this issue May 20, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@pitkling
Copy link

Description

I had some problems with the root dir detection of the lua_ls language server. I took a look at the corresponding code and was surprised that finding the git ancestor has lower priority than the lua/ subdirectories (which, btw, is not mentioned in the documentation).

My specific problem with this: Consider the following directory structure:

HOME/
├─ workspaces/
│  ├─ lua/
│  ├─ python/
│  ├─ work/
│  │  ├─ SomeProjectWithLuaFiles/
│  │  │  ├─ .git/

The lua/ and python/ directories contain some miscellaneous language-specific projects I sometimes work on. The project directory under Work also contains some lua files. I expected the .git directory in the project to ensure that the project root dir is correctly detected to be …/SomeProjectWithLuaFiles. But since the search for the lua/ subdirectory is done first, my LSP detects HOME/workspaces/ as the root directory.

I know I can easily change this, I was just wondering if this is intended? While I know that many lua projects have a lua/ subdirectory, I feel that such language-specific workspace directories are not that uncommon, and that the search for the git ancestor should be done before looking for the lua/ subdirectory.

Even if it is intended, I think this should be at least mentioned in the documentation for the default lua_ls configuration.

@pitkling pitkling added the bug Something isn't working label May 20, 2024
@justinmk justinmk added documentation Improvements or additions to documentation question Further information is requested and removed bug Something isn't working labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants