Skip to content

Include diagnostic ranges in VS Code MCP code checker#665

Open
Viktor-Gostyaikin wants to merge 1 commit into
microsoft:mainfrom
Viktor-Gostyaikin:fix-vscode-mcp-code-checker-ranges
Open

Include diagnostic ranges in VS Code MCP code checker#665
Viktor-Gostyaikin wants to merge 1 commit into
microsoft:mainfrom
Viktor-Gostyaikin:fix-vscode-mcp-code-checker-ranges

Conversation

@Viktor-Gostyaikin
Copy link
Copy Markdown

Summary

Extends the VS Code MCP code_checker tool output with diagnostic location metadata.

The tool already reads diagnostics through vscode.languages.getDiagnostics(), but previously returned only severity, message, and source. This change preserves range and code metadata so MCP clients can navigate to the exact diagnostic location.

Changes

  • Add 1-based diagnostic range fields:
    • startLineNumber
    • startColumn
    • endLineNumber
    • endColumn
  • Preserve diag.code
  • Preserve tags
  • Serialize relatedInformation with URI and range metadata

Motivation

External MCP clients and coding agents need file coordinates to act on diagnostics reliably. Without ranges, diagnostics with repeated messages are ambiguous in large files.

Testing

  • Built the VS Code MCP server locally.
  • Verified code_checker output includes diagnostic ranges.

@Viktor-Gostyaikin
Copy link
Copy Markdown
Author

#665

@Viktor-Gostyaikin
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant