You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
The text was updated successfully, but these errors were encountered:
If I get right the point is to limit lua workspace by lua/ subdir of a large repo. In this case it makes sense to take longest value of util.root_pattern 'lua/' and util.find_git_ancestor results.
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 thelua/
subdirectories (which, btw, is not mentioned in the documentation).My specific problem with this: Consider the following directory structure:
The
lua/
andpython/
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 thelua/
subdirectory is done first, my LSP detectsHOME/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 thelua/
subdirectory.Even if it is intended, I think this should be at least mentioned in the documentation for the default
lua_ls
configuration.The text was updated successfully, but these errors were encountered: