Skip to content

feat(adapters): Go syntax-aware and PowerShell native-location adapters - #18

Merged
joncrangle merged 6 commits into
masterfrom
feat/13-go-powershell-adapters
Sep 9, 2026
Merged

joncrangle merged 6 commits into
masterfrom
feat/13-go-powershell-adapters

Conversation

@joncrangle

@joncrangle joncrangle commented Sep 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #13.

Why

Go and PowerShell/pwsh still use line-oriented wrapper instrumentation with synthetic per-line tracking, wrapper-shifted diagnostics, and magic offset corrections. Migrate both to the adapter/event pipeline using the strongest source-location mechanism available per runtime (syntax-aware for Go, native invocation metadata for PowerShell), keeping dosbatch/CMD on the compatibility adapter.

What

  • Go: Tree-sitter targeted instrumentation of fmt/log Print/Printf/Println (callee-only rewrites, line-preserving, multiline-safe); locations via runtime.Caller; native compiler/panic diagnostics. No Tree-sitter parser on the system? An embedded comment/string-aware scanner produces byte-identical rewrites (equivalence-tested) — no new hard requirement, no legacy wrapper on any path.
  • PowerShell/pwsh: one adapter for pwsh + Windows PowerShell; output proxies using Get-PSCallStack line/column with user-file attribution; stream-mapped framed events (output/host to stdout, warning to warning, error to error); same-scope appended resilience trap with native InvocationInfo locations; native stderr parsing for throw/command-not-found/parse errors.
  • Shared utils.make_adapter_tmpdir / utils.is_user_file; runtimes wired to the new adapters; transitional wrapper tests removed/retargeted.
  • CI installs the Go Tree-sitter parser as a test-only dependency (nvim-treesitter master pin + MSVC setup on Windows) so the primary path is exercised; README documents the Tree-sitter benefit.

Verification

  • Tests
  • Manual Check

Full suite: 155 cases, 0 fails (local, incl. pwsh + Windows PowerShell e2e, TS/lexer equivalence, forced-scanner run). Go log output renders as stdout, not error diagnostics. Neovim 0.11 floor kept: verified neither 0.11 nor 0.12 ships a go parser, so the floor costs nothing with the scanner fallback.

@joncrangle
joncrangle merged commit 07fe65e into master Sep 9, 2026
4 checks passed
@joncrangle
joncrangle deleted the feat/13-go-powershell-adapters branch September 9, 2026 21:03
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.

Replace Go and PowerShell wrappers with syntax-aware/native-location instrumentation

1 participant