The current code_checker tool in mcp-server-vscode retrieves diagnostics via vscode.languages.getDiagnostics(), but the returned MCP payload drops important diagnostic metadata.
Current output includes only:
{
severity: DiagnosticSeverity[diag.severity],
message: diag.message,
source: diag.source || '',
}
This makes it hard for external MCP clients and coding agents to act on diagnostics, because they cannot identify the exact file range, diagnostic code, or target documentation link.
VS Code diagnostics already contain this data. For example, the Problems panel exposes fields like:
{
"resource": "/path/to/file.bsl",
"code": {
"value": "UnreachableCode",
"target": {
"path": "/bsl-language-server/diagnostics/UnreachableCode",
"scheme": "https",
"authority": "1c-syntax.github.io"
}
},
"severity": 8,
"message": "Fix the algorithm because this code will never be executed",
"source": "bsl-language-server",
"startLineNumber": 54,
"startColumn": 3,
"endLineNumber": 54,
"endColumn": 85
}
Request
Please extend code_checker output to include diagnostic range and code metadata.
Suggested shape:
.map((diag) => ({
severity: DiagnosticSeverity[diag.severity],
message: diag.message,
source: diag.source || '',
code: diag.code,
range: {
startLineNumber: diag.range.start.line + 1,
startColumn: diag.range.start.character + 1,
endLineNumber: diag.range.end.line + 1,
endColumn: diag.range.end.character + 1,
},
tags: diag.tags,
relatedInformation: diag.relatedInformation,
}))
Using 1-based line and column numbers would align the MCP output with VS Code Problems JSON and make it easier for agents to report and fix diagnostics precisely.
Why This Matters
Without coordinates, an MCP client can only report diagnostic text. In larger files, repeated diagnostics from the same source become ambiguous. Returning range and code would allow agents to:
- navigate directly to the affected location;
- group diagnostics by rule code;
- link to diagnostic documentation;
- apply targeted fixes safely;
- produce actionable summaries with file and line references.
Acceptance Criteria
code_checker returns range for each diagnostic.
range includes start/end line and column.
code is preserved when provided by VS Code.
- Existing fields
severity, message, and source remain backward-compatible.
- If possible, the output also includes
tags and relatedInformation.
The current
code_checkertool inmcp-server-vscoderetrieves diagnostics viavscode.languages.getDiagnostics(), but the returned MCP payload drops important diagnostic metadata.Current output includes only:
This makes it hard for external MCP clients and coding agents to act on diagnostics, because they cannot identify the exact file range, diagnostic code, or target documentation link.
VS Code diagnostics already contain this data. For example, the Problems panel exposes fields like:
{ "resource": "/path/to/file.bsl", "code": { "value": "UnreachableCode", "target": { "path": "/bsl-language-server/diagnostics/UnreachableCode", "scheme": "https", "authority": "1c-syntax.github.io" } }, "severity": 8, "message": "Fix the algorithm because this code will never be executed", "source": "bsl-language-server", "startLineNumber": 54, "startColumn": 3, "endLineNumber": 54, "endColumn": 85 }Request
Please extend
code_checkeroutput to include diagnostic range and code metadata.Suggested shape:
Using 1-based line and column numbers would align the MCP output with VS Code Problems JSON and make it easier for agents to report and fix diagnostics precisely.
Why This Matters
Without coordinates, an MCP client can only report diagnostic text. In larger files, repeated diagnostics from the same source become ambiguous. Returning
rangeandcodewould allow agents to:Acceptance Criteria
code_checkerreturnsrangefor each diagnostic.rangeincludes start/end line and column.codeis preserved when provided by VS Code.severity,message, andsourceremain backward-compatible.tagsandrelatedInformation.