Step 250: structured diagnostic format (error codes, nodeIds, fix suggestions)
Unified diagnostic stream merging parse errors (E01xx), annotation validation (E02xx), and strategy violations (E03xx) with severity levels, AST node references, and machine-applicable fix mutations. New getDiagnostics RPC method with severity/source filtering. 18 MCP tools total. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -646,6 +646,30 @@ private:
|
||||
};
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Step 250: Register diagnostic tools
|
||||
// ---------------------------------------------------------------
|
||||
void registerDiagnosticTools() {
|
||||
tools_.push_back({"whetstone_get_diagnostics",
|
||||
"Get structured diagnostics for the active buffer. Combines "
|
||||
"parse errors, annotation validation, and strategy violations "
|
||||
"into one stream with error codes, nodeIds, and fix suggestions. "
|
||||
"Filter by severity (error/warning/info/hint) or source "
|
||||
"(parser/annotation/strategy).",
|
||||
{{"type", "object"}, {"properties", {
|
||||
{"severity", {{"type", "string"},
|
||||
{"enum", {"error", "warning", "info", "hint"}},
|
||||
{"description", "Maximum severity level to include"}}},
|
||||
{"source", {{"type", "string"},
|
||||
{"enum", {"parser", "annotation", "strategy"}},
|
||||
{"description", "Filter by diagnostic source"}}}
|
||||
}}}
|
||||
});
|
||||
toolHandlers_["whetstone_get_diagnostics"] = [this](const json& args) {
|
||||
return callWhetstone("getDiagnostics", args);
|
||||
};
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Register all tools
|
||||
// ---------------------------------------------------------------
|
||||
@@ -653,5 +677,6 @@ private:
|
||||
registerASTTools();
|
||||
registerAnnotationTools();
|
||||
registerFileTools();
|
||||
registerDiagnosticTools();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user