Skip to content

Commit 36aa11d

Browse files
committed
fix: incorrect docstring for rooter settings
1 parent 6a7f162 commit 36aa11d

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,21 @@ local opts = {
136136
-- "lsp" : lsp detection
137137
-- string[] : a list of directory patterns to look for
138138
-- fun(bufnr: integer): string|string[] : a function that takes a buffer number and outputs detected roots
139-
detector = { "lsp", { ".git", "_darcs", ".hg", ".bzr", ".svn", "lua", "Makefile", "package.json" } },
139+
detector = {
140+
"lsp", -- highest priority is getting workspace from running language servers
141+
{ ".git", "_darcs", ".hg", ".bzr", ".svn" }, -- next check for a version controlled parent directory
142+
{ "lua", "MakeFile", "package.json" }, -- lastly check for known project root files
143+
},
140144
-- ignore things from root detection
141145
ignore = {
142146
servers = {}, -- list of language server names to ignore (Ex. { "efm" })
143147
dirs = {}, -- list of directory patterns (Ex. { "~/.cargo/*" })
144148
},
145-
-- whether or not to disable automatic working directory updating (update with `:AstroRoot`)
146-
autochdir = true,
149+
-- automatically update working directory (update manually with `:AstroRoot`)
150+
autochdir = false,
147151
-- scope of working directory to change ("global"|"tab"|"win")
148152
scope = "global",
149-
-- whether or not to notify on every working directory change
153+
-- show notification on every working directory change
150154
notify = false,
151155
},
152156
-- Configuration table of session options for AstroNvim's session management powered by Resession

lua/astrocore/config.lua

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,19 +219,23 @@
219219
---}
220220
---```
221221
---@field git_worktrees AstroCoreGitWorktree[]?
222-
---Enable git integration for detached worktrees
222+
---Enable and configure project root detection
223223
---Example:
224224
--
225225
---```lua
226226
---rooter = {
227-
--- autochdir = true,
228-
--- detector = { "lsp", { ".git" } },
227+
--- detector = {
228+
--- "lsp", -- highest priority is getting workspace from running language servers
229+
--- { ".git", "_darcs", ".hg", ".bzr", ".svn" }, -- next check for a version controlled parent directory
230+
--- { "lua", "MakeFile", "package.json" }, -- lastly check for known project root files
231+
--- },
229232
--- ignore = {
230-
--- dirs = {},
231-
--- servers = {},
232-
--- }
233-
--- notify = false,
234-
--- scope = "global",
233+
--- servers = {}, -- list of language server names to ignore (Ex. { "efm" })
234+
--- dirs = {}, -- list of directory patterns (Ex. { "~/.cargo/*" })
235+
--- },
236+
--- autochdir = false, -- automatically update working directory
237+
--- scope = "global", -- scope of working directory to change ("global"|"tab"|"win")
238+
--- notify = false, -- show notification on every working directory change
235239
---}
236240
---```
237241
---@field rooter AstroCoreRooterOpts|false?

0 commit comments

Comments
 (0)