Skip to content

feat: surface extension and analyzer versions for issue reports - #68

Merged
Arthurvdv merged 1 commit into
mainfrom
feat/surface-analyzer-version
Sep 3, 2026
Merged

Arthurvdv merged 1 commit into
mainfrom
feat/surface-analyzer-version

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Problem

When users create an issue there's confusion about which version they are on: the VS Code extension has its own version, but most of the time the version of the downloaded ALCops.Analyzers NuGet package is what actually matters. That version is recorded in .alcops-manifest.json but surfaced nowhere persistent — the status bar shows only a count, there is no output channel, and version strings appear only in 5-second auto-dismissing toasts.

Solution

Follows the pattern used by extensions with separately-versioned downloaded components (rust-analyzer, Python's language server, CMake Tools, C/C++):

  • New command ALCops: Copy Version Information — copies a ready-to-paste diagnostics block to the clipboard:
    ALCops extension: 1.4.1
    ALCops.Analyzers: 0.9.2 (channel: stable)
    AL Language extension: 18.0.123456
    VS Code: 1.103.1
    OS: win32 x64 (Windows_NT 10.0.26200)
    Analyzers path: <path>
    Downloaded at: <timestamp>
    Target framework: net8.0
    
  • New "ALCops" output channel (LogOutputChannel) — version banner on activation and after every install/update; all existing console.* logging routed through it via a new src/logger.ts facade (console fallback keeps pure-Node modules importable in vitest)
  • Status bar tooltip now shows extension, analyzers (with channel), and AL Language versions as markdown; the ALCops: <n> text and click-to-select behavior are unchanged. Version info is cached and invalidated only on install or alcops.versionChannel change

src/version-info.ts is the single source of truth: gatherVersionInfo() plus pure formatters shared by the tooltip, clipboard block, and log banners. Handles AL extension missing, manifest missing/corrupt, and the pending-update 'unknown' placeholder as "not installed".

Notification wording and .github/ISSUE_TEMPLATE are deliberately untouched.

Testing

  • 49/49 unit tests pass (11 new in tests/version-info.test.ts), lint clean, typecheck clean, bundle builds
  • Manually verified in the extension host: output channel banner, tooltip, copy command (including "not installed" state), install logging, and live tooltip refresh on channel change

🤖 Generated with Claude Code

Users filing issues report the VS Code extension version when the
version of the downloaded ALCops.Analyzers package is what actually
matters. Make both versions easy to find and copy:

- Add "ALCops: Copy Version Information" command that copies a
  ready-to-paste block (extension, analyzers + channel, AL Language,
  VS Code, OS, analyzers path) to the clipboard
- Add "ALCops" output channel (LogOutputChannel) with a version banner
  on activation and after every install/update; route existing
  console.* logging through it
- Enrich the status bar tooltip with extension, analyzers (with
  channel), and AL Language versions; text and click behavior unchanged

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Arthurvdv
Arthurvdv merged commit d87963c into main Sep 3, 2026
1 check passed
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