Skip to content

Comments

Code quality improvements#33

Open
shaiku wants to merge 6 commits intoCodingWithCalvin:mainfrom
shaiku:code-quality
Open

Code quality improvements#33
shaiku wants to merge 6 commits intoCodingWithCalvin:mainfrom
shaiku:code-quality

Conversation

@shaiku
Copy link

@shaiku shaiku commented Feb 13, 2026

Description

  • Update both ModelContextProtocol and ModelContextProtocol.AspNetCore from 0.2.0-preview.2 to 0.8.0-preview.1, the latest available version.
  • fix: resolve build warnings and improve code quality
    • Fix CS8600 null reference warnings by declaring nullable types
    • Remove duplicate using directive for Microsoft.VisualStudio.Shell.TableManager
    • Add null check for MCPServerPackage.Instance in ServerCommands
    • Apply pragma suppressions for console I/O VSTHRD103 warnings
    • Add project-level suppression for VSTHRD threading analyzer warnings
    • Ensure consistent code style with braces on separate lines
    • These changes result in a clean build with 0 warnings and 0 errors.

Type of Change

  • feat - New feature
  • fix - Bug fix
  • docs - Documentation only
  • refactor - Code change that neither fixes a bug nor adds a feature
  • test - Adding or updating tests
  • chore - Maintenance tasks
  • ci - CI/CD changes

Checklist

  • My code follows the project's code style
  • I have tested my changes locally
  • I have updated documentation if needed
  • My commits follow the conventional commit format
  • This PR has a descriptive title using conventional commit format

Implement 5 new MCP tools for enhanced debugger functionality:
- debugger_add_breakpoint: Set breakpoint at file:line (works in any mode)
- debugger_remove_breakpoint: Remove breakpoint by file:line (destructive)
- debugger_list_breakpoints: List all breakpoints with metadata
- debugger_get_locals: Inspect local variables in Break mode
- debugger_get_callstack: Inspect call stack frames with file/line info

Also improve document_read pagination:
- Add offset (1-based line start) and limit (max lines) parameters
- Reduce default limit from 2000 to 500 to prevent token overflow
- Return numbered lines with continuation hints for large files
- Enables safe reading of files > 100K characters
…put pane access

Implement three new MCP tools for accessing Visual Studio diagnostics:

- errors_list: Read build errors, warnings, and messages from the Error List using the modern Table Control API (IErrorList/IWpfTableControl)
- output_read: Read content from Visual Studio Output window panes
- output_list_panes: List all available Output window panes (built-in and custom)

Key improvements:
- Use IErrorList and IWpfTableControl for reliable, type-safe error access
- Properly map __VSERRORCATEGORY enum to Error/Warning/Message severity
- Extract all error details: code, project, file path, line, column, description
- Support severity filtering on errors_list tool
- Implement proper RPC contracts and service layer integration
- Add Microsoft.VisualStudio.Editor package for text view support

The diagnostics tools enable AI assistants to inspect build output and error details during development.
Update both ModelContextProtocol and ModelContextProtocol.AspNetCore from 0.2.0-preview.2 to 0.8.0-preview.1, the latest available version. This brings compatibility with the latest MCP protocol features and improvements.
- Fix CS8600 null reference warnings by declaring nullable types
- Remove duplicate using directive for Microsoft.VisualStudio.Shell.TableManager
- Add null check for MCPServerPackage.Instance in ServerCommands
- Apply pragma suppressions for console I/O VSTHRD103 warnings
- Add project-level suppression for VSTHRD threading analyzer warnings
- Ensure consistent code style with braces on separate lines

These changes result in a clean build with 0 warnings and 0 errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant