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
Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ It's funny that all AI plugins for Neovim are quite complex to interact with, li
12
12
13
13
## Features
14
14
15
-
-**Context aware**: Sends your current buffer, cwd, and selection as context.
15
+
-**Context aware**: Sends your current buffer, cwd, selection, and optional diagnostics as context.
16
16
-**Unsaved-buffer aware**: Tells pi to treat the sent Neovim buffer content as the source of truth, even if the on-disk file is stale.
17
17
-**Simple configuration**: Just set your preferred AI model.
18
18
-**Gets out of your way**: You ask it. It does it. Done.
@@ -69,6 +69,9 @@ require("pi").setup({
69
69
selection= {
70
70
surrounding_lines=40,
71
71
},
72
+
diagnostics= {
73
+
enabled=false,
74
+
},
72
75
},
73
76
skills=true,
74
77
extensions=true,
@@ -86,6 +89,7 @@ require("pi").setup({
86
89
|`context.max_bytes`|`24000`| Maximum size in bytes for sent context before trimming. |
87
90
|`context.ask.surrounding_lines`|`80`| Number of lines before and after the current cursor line to include for `:PiAsk`. |
88
91
|`context.selection.surrounding_lines`|`40`| Number of lines before and after the current visual selection to include for `:PiAskSelection`. |
92
+
|`context.diagnostics.enabled`|`false`| Includes Neovim diagnostics in the sent context. `:PiAsk` sends all buffer diagnostics; `:PiAskSelection` sends only diagnostics overlapping the selected lines. |
89
93
|`skills`|`true`| Whether pi discovers and loads skills. Set to `false` to pass `--no-skills`. |
90
94
|`extensions`|`true`| Whether pi discovers and loads extensions. Set to `false` to pass `--no-extensions`. |
Copy file name to clipboardExpand all lines: lua/pi/context.lua
+146Lines changed: 146 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
--- Context builders for pi.nvim prompts.
1
2
localM= {}
2
3
3
4
localSYSTEM_PROMPT=[[You are running inside the pi.nvim Neovim plugin. The user has sent a request and will not be able to reply back. You must complete the task immediately without asking any questions or requesting clarification. Take action now and do what was asked.
@@ -8,6 +9,9 @@ local BUFFER_SOURCE_OF_TRUTH_NOTE = [[NOTE: The context below comes from the cur
8
9
9
10
localEMPTY_FILE_NOTE=[[NOTE: This file is currently empty. Please create or populate it directly by applying the necessary edits so pi.nvim can write the file.]]
10
11
12
+
--- Returns whether a buffer contains only empty or whitespace-only lines.
13
+
--- @parambufnrinteger Buffer handle.
14
+
--- @returnboolean is_empty Whether the buffer has meaningful content.
0 commit comments