summaryrefslogtreecommitdiff
path: root/core/builtins.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/builtins.zig')
-rw-r--r--core/builtins.zig68
1 files changed, 49 insertions, 19 deletions
diff --git a/core/builtins.zig b/core/builtins.zig
index fb072141..626e8ec3 100644
--- a/core/builtins.zig
+++ b/core/builtins.zig
@@ -2047,8 +2047,9 @@ pub const Jumplist = struct {
/// Go to the definition of the symbol under the cursor.
///
-/// With an argument (a 2-1 chord's selection), of that symbol, where it is
-/// nearest.
+/// With an argument (a 2-1 chord's selection), of that symbol, asked at its
+/// occurrence nearest the cursor. One answer is a jump; several open a list,
+/// the keyboard on its current row; none says so. `g d` does the same.
pub const Def = struct {
pub const takes_arg = true;
/// Its answer says what it found, a jump or a list or why not; its
@@ -2061,8 +2062,9 @@ pub const Def = struct {
/// List the references to the symbol under the cursor.
///
-/// With an argument (a 2-1 chord's selection), to that symbol, where it is
-/// nearest.
+/// With an argument (a 2-1 chord's selection), to that symbol, asked at its
+/// occurrence nearest the cursor; a single reference is a jump. `g r` does
+/// the same.
pub const Refs = struct {
pub const takes_arg = true;
pub const quiet = true; // as Def
@@ -2071,14 +2073,15 @@ pub const Refs = struct {
}
};
-/// Ask the language server about the symbol under the cursor.
+/// Ask the language server about the symbol under the cursor, its answer in a
+/// +Hover.
pub const Hover = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .hover, "");
}
};
-/// List the language server's code actions for the cursor.
+/// List the language server's code actions for the cursor, in a +Lsp.
pub const CodeAction = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .code_action, "");
@@ -2092,21 +2095,24 @@ pub const SelectRefs = struct {
}
};
-/// List the file's symbols from the language server.
+/// List this file's symbols in a +Search.
pub const Symbols = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .document_symbols, "");
}
};
-/// List the file's diagnostics from the language server.
+/// List this file's diagnostics in a +Search.
+///
+/// `] d` and `[ d` step through them in the text, `] D` and `[ D` to the last
+/// and the first.
pub const Diagnostics = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .diagnostics, "");
}
};
-/// List the workspace's diagnostics from the language server.
+/// List the diagnostics of the whole workspace in a +Search.
pub const WsDiagnostics = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .workspace_diagnostics, "");
@@ -2116,49 +2122,66 @@ pub const WsDiagnostics = struct {
/// Run the file's language indexer at its project root, writing its
/// index.scip.
///
-/// The language words ask that index first.
+/// The language words ask the nearest index.scip above a file first, and its
+/// language server only when the index has nothing to say; an index older
+/// than the file still answers, and says so once.
pub const Index = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .index, "");
}
};
-/// Show outermost callers first, with signatures and call sites (gc).
+/// Show the callers of the function under the cursor as a tree, outermost
+/// first, in a +Callstack.
+///
+/// Each caller with its place to open and its signature, the line of each
+/// call under it; callers named for tests after the rest, a recursion marked
+/// `↻`. CallstackDepth sets how many levels (8 by default); a deeper tree
+/// says where to go on from. `g c` does the same.
pub const Callstack = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .callstack, "");
}
};
-/// List the callers of the function under the cursor.
+/// List the functions that call the one under the cursor, one level up; a
+/// single one is a jump.
pub const Callers = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .incoming_calls, "");
}
};
-/// List the functions the function under the cursor calls.
+/// List the functions the one under the cursor calls, one level down; a
+/// single one is a jump.
pub const Callees = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .outgoing_calls, "");
}
};
-/// List the supertypes of the type under the cursor.
+/// List the supertypes of the type under the cursor in a +Search; a single
+/// one is a jump.
pub const Supertypes = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .supertypes, "");
}
};
-/// List the subtypes of the type under the cursor.
+/// List the subtypes of the type under the cursor in a +Search; a single one
+/// is a jump.
pub const Subtypes = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .subtypes, "");
}
};
-/// Rename the symbol under the cursor everywhere, to its argument.
+/// Rename the symbol under the cursor to its argument, wherever the language
+/// server finds it.
+///
+/// Bare, it asks for the new name. Within this file it is done at once,
+/// saying how many places changed; one that reaches other files changes
+/// nothing and lists its edits in a +Search to look over.
pub const Rename = struct {
pub const takes_arg = true;
pub const requires_arg = true;
@@ -2169,7 +2192,8 @@ pub const Rename = struct {
}
};
-/// Search the workspace's symbols for its argument.
+/// Search the workspace's symbols for its argument, in a +Search; bare, it
+/// asks for the name.
pub const WsSymbols = struct {
pub const takes_arg = true;
pub const requires_arg = true;
@@ -2180,14 +2204,20 @@ pub const WsSymbols = struct {
}
};
-/// Show which language servers serve this file and their state.
+/// Show which index and language server serve this file, and their state, in
+/// a +Lsp.
+///
+/// The index.scip it asks (or the Index that would write one), its server and
+/// the server's state (not started yet, failed and waiting to retry), and
+/// what answered each query lately.
pub const Lspinfo = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .status, "");
}
};
-/// Explain how the last language server request was answered, step by step.
+/// Explain, step by step in a +Lsp, how the last language server request was
+/// answered.
pub const Lspwhy = struct {
pub fn run(c: Ctx) void {
c.p.lspRequest(c.id, .explain, "");