Skip to content

Commit 262c240

Browse files
cbochsgithub-actions[bot]
authored andcommitted
chore(docs): auto generate docs
1 parent 65350ee commit 262c240

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

doc/grapple.nvim.txt

+37-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*grapple.nvim.txt* For NVIM v0.8.0 Last change: 2023 March 01
1+
*grapple.nvim.txt* For NVIM v0.8.0 Last change: 2023 March 04
22

33
==============================================================================
44
Table of Contents *grapple.nvim-table-of-contents*
@@ -497,6 +497,42 @@ guarantee that a scope is found.
497497
<
498498

499499

500+
GRAPPLE.SCOPEROOT_FROM_BUFFER
501+
502+
Create a scope resolver that generates a project scope by looking upwards for
503+
directories containing a specific file or directory _from the current buffer_.
504+
505+
**API**`require("grapple.scope").root(root_names, opts)`
506+
507+
**returns**|grapple.nvim-`grapple.scoperesolver`|
508+
509+
**root_names**`string` | `string[]`
510+
511+
**opts?**|grapple.nvim-`grapple.scopeoptions`|
512+
513+
514+
- **cache?**`boolean` | `string` | `string[]` | `integer` (default: `"BufEnter"`)
515+
- **persist?**`boolean` (default: `true`)
516+
517+
**Note**it is recommended to use this with a **fallback scope resolver** to
518+
guarantee that a scope is found.
519+
520+
**Example**
521+
522+
>lua
523+
-- Create a buffer-based root scope resolver that looks for a directory
524+
-- containing a "Cargo.toml" file
525+
require("grapple.scope").root_from_buffer("Cargo.toml")
526+
527+
-- Create a buffer-based root scope resolver that falls back to using
528+
-- the initial working directory for your neovim session
529+
require("grapple.scope").fallback({
530+
require("grapple.scope").root_from_buffer("Cargo.toml"),
531+
require("grapple").resolvers.static,
532+
})
533+
<
534+
535+
500536
GRAPPLE.SCOPEFALLBACK
501537

502538
Create a scope resolver that generates a project scope by attempting to get the

0 commit comments

Comments
 (0)