Skip to content

feat: add diagnostic kill switch to VS Code and GoLand extensions (#19)#20

Merged
willibrandon merged 5 commits intomainfrom
feature/diagnostic-kill-swtich
Aug 4, 2025
Merged

feat: add diagnostic kill switch to VS Code and GoLand extensions (#19)#20
willibrandon merged 5 commits intomainfrom
feature/diagnostic-kill-swtich

Conversation

@willibrandon
Copy link
Owner

@willibrandon willibrandon commented Aug 4, 2025

Description

Implements a diagnostic kill switch for both VS Code and GoLand extensions, allowing users to quickly disable enable mtlog-analyzer diagnostics when needed. This addresses user frustration when diagnostics become disruptive during debugging, legacy code work, or tight deadlines.

VS Code Changes

  • Added command palette commands for enable/disable diagnostics
  • Added clickable status bar item showing analyzer state with diagnostic counts
  • Added quick action on diagnostics to suppress specific diagnostic types
  • State persists in workspace settings

GoLand Changes

  • Added status bar widget with visual state indicator (play/pause icons)
  • Added notification bar on startup with Disable/Settings actions
  • Added diagnostic suppression with immediate UI updates (no edit required)
  • Added intention actions and quick fixes for suppressing diagnostics
  • Fixed critical deadlock issue in template argument quick fix during preview
  • Integrated with IntelliJ's standard inspection mechanisms

Type of change

  • Bug fix
  • New feature
  • Performance improvement
  • Documentation update

Checklist

  • Tests pass (go test ./...)
  • Linter passes (golangci-lint run)
  • Benchmarks checked (if performance-related)
  • Documentation updated (if needed)
  • Zero-allocation promise maintained (if applicable)

Additional notes

  • Both extensions now provide <2 click disable/enable functionality
  • State persists across IDE/editor restarts
  • No user configuration is lost when toggling
  • GoLand plugin includes test coverage for new features

Fixes #19

- Add diagnostic IDs (MTLOG001-008) for all analyzer checks
- Add --disable-all flag for global kill switch
 - Add --suppress flag for selective diagnostic suppression
 - Add environment variable support (MTLOG_SUPPRESS) for VS Code
 - Update VS Code extension with suppression management UI
 - Add status bar with diagnostic counts and Problems panel toggle
 - Add tests for suppression functionality
- Implement suppression via MTLOG_SUPPRESS environment variable
- Add manage suppressed diagnostics dialog with checkboxes
- Add suppress diagnostic action to annotation popup menu
- Fix WriteCommandAction deadlock in TemplateArgumentQuickFix
- Fix severity parsing for diagnostics with [MTLOGXXX] prefix
- Add plain text stderr parsing for go vet output
…tus bar

- Add status bar widget to toggle analyzer on/off with visual state indicator
- Add notification service for analyzer active state with Disable/Settings actions
- Implement diagnostic suppression with immediate UI updates (no edit required)
- Fix template argument quick fix deadlock during preview generation
- Add diagnostic ID extraction and filtering in parser
- Clear both service and annotator caches on suppression changes
- Enable inspection by default for better user experience
- Add tests for notification service functionality
@willibrandon willibrandon self-assigned this Aug 4, 2025
@willibrandon willibrandon requested a review from Copilot August 4, 2025 09:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a comprehensive diagnostic kill switch system for both VS Code and GoLand extensions, enabling users to quickly disable/enable mtlog-analyzer diagnostics or suppress specific diagnostic types. The implementation provides <2 click disable/enable functionality with persistent state across IDE restarts.

  • Added global kill switch and granular diagnostic suppression via environment variables and flags
  • Implemented status bar widgets and command palette integration for easy access
  • Added diagnostic suppression management UI with quick fixes and intention actions

Reviewed Changes

Copilot reviewed 31 out of 32 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
vscode-extension/mtlog-analyzer/src/extension.ts Adds toggle commands, suppression management, status bar integration, and environment variable support
vscode-extension/mtlog-analyzer/package.json Registers new commands, keybindings, and configuration schema for diagnostic management
goland-plugin/src/main/kotlin/com/mtlog/analyzer/statusbar/* Implements status bar widget with play/pause icons for visual state indication
goland-plugin/src/main/kotlin/com/mtlog/analyzer/service/MtlogProjectService.kt Adds suppression state management and environment variable integration
goland-plugin/src/main/kotlin/com/mtlog/analyzer/quickfix/SuppressDiagnosticQuickFix.kt Provides quick fix actions for diagnostic suppression
cmd/mtlog-analyzer/analyzer/analyzer.go Implements core suppression logic with diagnostic IDs and environment variable support
Comments suppressed due to low confidence (1)

goland-plugin/src/main/kotlin/com/mtlog/analyzer/service/MtlogProjectService.kt:278

  • Logging the entire stderr output at WARN level could impact performance and log readability. Consider truncating or using DEBUG level for large outputs.
                LOG.debug("Analyzer stderr (${errors.length} chars): $errors")

- Fix non-working binary download URLs in VS Code extension
- Add constants to eliminate magic numbers across components
- Extract helper functions to reduce code duplication
- Fix potential data loss in config parsing
- Add truncateForLog function for debug output limiting
- Extract write action logic to separate method
@willibrandon willibrandon merged commit 92be59a into main Aug 4, 2025
23 checks passed
@willibrandon willibrandon deleted the feature/diagnostic-kill-swtich branch August 4, 2025 10:34
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.

Add diagnostic kill switch to VS Code and GoLand extensions

1 participant