Skip to content

Fix language client startup with a log output channel - #286

Merged
Aiday Marlen Kyzy (aiday-mar) merged 4 commits into
microsoft:mainfrom
JakLuminth:fix-log-output-channel
Sep 9, 2026
Merged

Aiday Marlen Kyzy (aiday-mar) merged 4 commits into
microsoft:mainfrom
JakLuminth:fix-log-output-channel

Conversation

@JakLuminth

@JakLuminth Jacob Searcy (JakLuminth) commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #276
Fixes #284

Summary

vscode-languageclient 10.1.0 requires LanguageClientOptions.outputChannel to be a vscode.LogOutputChannel. The extension currently supplies a plain output channel, causing language-client startup to fail when it invokes log methods such as .error().

This change creates the channel with { log: true } and declares the stored channel as vscode.LogOutputChannel. The client TypeScript configuration now uses Node16 module resolution so the vscode-languageclient v10 package is compiled with its modern module declarations.

The regression was introduced in pre-release v1.1.2026072818 when vscode-languageclient was upgraded to 10.1.0 by #274. Stable v1.0.8 predates that dependency update.

Validation

  • npm ci
  • npm run compile
  • npm run build
  • npm test (34 passed)
  • npm run lint (passes; one existing unused-parameter warning in client/src/waza/waza.ts:689)

Copilot AI lite review requested due to automatic review settings September 2, 2026 22:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is small, directly addresses the reported startup failure, and is compatible with the extension’s declared VS Code engine version.

Pull request overview

Updates the extension’s output channel to a VS Code log output channel so [email protected] can call log methods (e.g., .error()) during startup without crashing.

Changes:

  • Change the stored channel type to vscode.LogOutputChannel.
  • Create the output channel using vscode.window.createOutputChannel(..., { log: true }) to satisfy the language client’s requirements.
File summaries
File Description
client/src/extension.ts Switches the extension’s output channel to a LogOutputChannel so the language client can log errors during startup.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread client/src/extension.ts Resolved
@JakLuminth

Jacob Searcy (JakLuminth) commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Fixed the output channel lifecycle issue by registering it in context.subscriptions, so VS Code disposes it correctly on reload/deactivation and avoids leaking the channel across restarts.

Validated with npm run build

@aiday-mar

Copy link
Copy Markdown
Collaborator

Actually why did you delete the client options? I believe we still need them

auto-merge was automatically disabled September 3, 2026 15:07

Head branch was pushed to by a user without write access

@JakLuminth

Jacob Searcy (JakLuminth) commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Actually why did you delete the client options? I believe we still need them

It looked like the suggested change by Copilot accidentally removed that line while adding the output-channel registration, and it was restored in commit 277bf62. I initially pushed that commit to my fork’s main, and I've now updated the PR branch to include it as well.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is minimal, aligns with the stated vscode-languageclient 10.1.0 requirement, and adds proper disposal without introducing additional behavioral risk.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@JakLuminth

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

The client package uses `vscode-languageclient` 10.1.0. Use Node16
module and module resolution settings so TypeScript resolves that
package's declarations consistently and checks the `LogOutputChannel`
API used by this fix.

This is a client-only compiler change; the root package's existing
`vscode-languageclient` 9.0.1 dependency is unchanged.
@JakLuminth

Jacob Searcy (JakLuminth) commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews. All checks are passing, but I don’t have permissions to merge. Could someone with access merge this when convenient? It looks like the auto-merge Aiday Marlen Kyzy (@aiday-mar) set early on became disabled on a push.

@aiday-mar
Aiday Marlen Kyzy (aiday-mar) merged commit 6fa3f0d into microsoft:main Sep 9, 2026
2 checks passed
@aiday-mar

Copy link
Copy Markdown
Collaborator

Thank you for the PR

@vs-code-engineering vs-code-engineering Bot added this to the 1.138.0 milestone Sep 9, 2026
@JakLuminth
Jacob Searcy (JakLuminth) deleted the fix-log-output-channel branch September 11, 2026 19:48
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.

this.traceOutputChannel.onDidChangeLogLevel is not a function Chat customizations evaluations: this.outputChannel.error is not a function

5 participants