Skip to content

Commit 7985853

Browse files
committed
Use confdir instead of srcdir as a base path
1 parent 2ea6b5f commit 7985853

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
## [unreleased]
44

5+
- **Potential breaking change:** use `confdir` instead of `srcdir` as base path
6+
for `lua_ls_project_root`.
7+
8+
Prior to this change, `lua_ls_project_root` was resolved relative to the directory
9+
containing source `.rst` files. Documentation, however, was saying that it's resolved
10+
relative to the directory with `conf.py`.
11+
12+
This is not an issue, because in most projects `conf.py` and source `.rst` files
13+
are located in the same directory. Still, I've decided to be consistent with
14+
other Sphinx extensions and use `confdir` instead of `srcdir`.
15+
16+
This is a breaking change, but I don't believe there are any projects that
17+
use separate `confdir` and `srcdir` (the only reason to do this is if you're
18+
hosting multiple documentation sites in the same repo.) For this reason,
19+
this change is released as a minor version change.
20+
521
## [3.3.0]
622

723
- Added an option to extend list options (like `:exclude-members:`) without overriding

sphinx_lua_ls/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def set_options(app: sphinx.application.Sphinx):
172172
config = app.config
173173

174174
project_root = _path(
175-
"lua_ls_project_root", config["lua_ls_project_root"] or "", app.srcdir
175+
"lua_ls_project_root", config["lua_ls_project_root"] or "", app.confdir
176176
)
177177

178178
domain_config = LuaDomainConfig(project_root=project_root)
@@ -260,7 +260,7 @@ def set_options(app: sphinx.application.Sphinx):
260260
domain_config.apidoc_roots = _api_roots(
261261
"lua_ls_apidoc_roots",
262262
config["lua_ls_apidoc_roots"],
263-
app.srcdir,
263+
app.confdir,
264264
domain_config.apidoc_max_depth,
265265
domain_config.apidoc_default_options,
266266
domain_config.apidoc_ignored_modules,

0 commit comments

Comments
 (0)