Preserve output channel visibility on restart - #1849
Pradeep Ramola (pradeep-ramola) wants to merge 6 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
Output-channel matching is unreliable, and the tests bypass that detection logic.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Preserves a language client’s output-channel visibility across successful restarts.
Changes:
- Detects whether the output channel is visible before stopping.
- Restores visible channels without stealing focus.
- Adds restart sequencing tests.
File summaries
| File | Description |
|---|---|
client/src/node/main.ts |
Captures and restores visibility around restart. |
client/src/common/client.ts |
Implements visibility detection and restoration. |
client-node-tests/src/integration.test.ts |
Adds restart behavior tests. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Pradeep Ramola (@pradeep-ramola) can you have a look at the copilot comments. |
|
Addressed the Copilot review comments in What changed:
Validated locally with:
|
…erve-output-channel-on-restart # Conflicts: # client-node-tests/src/integration.test.ts
|
Resolved the merge conflict with current The conflict was in Validation after resolving conflicts:
|
There was a problem hiding this comment.
🟡 Changes recommended
Name-only suffix matching can incorrectly identify another extension’s same-named output channel.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
|
Addressed the latest Copilot comment in What changed:
Validated locally with:
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Case-insensitive matching can confuse distinct case-sensitive output-channel names.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
Resolved since last review (1)
|
Pradeep Ramola (@pradeep-ramola) see latest Copilot comments. They do make sense to me. |

Summary
Preserves a language client's output channel visibility across
LanguageClient.restart().If the output channel is already visible before restart, the client shows it again after restart succeeds using
show(true)so focus is preserved. If the output channel is hidden or has not been created, restart behavior is unchanged.The visibility detector now matches VS Code log output resources by a normalized
<outputChannelId>.<outputChannelName>.logresource name.outputChannelIdcan be supplied throughLanguageClientOptions(for example, an extension id such aspublisher.extension) and falls back to the language client id when omitted. This avoids treating another visible output channel with the same display name, or an extension id containing the channel name, as this client's output channel. It also handles channel names that VS Code sanitizes in log file names.This moves the behavior requested in microsoft/vscode-eslint#2206 into the shared LSP client library so other clients can benefit from it too.
Validation
npm run compile:clientnpm run compile:client-node-testsnpm run lint --prefix clientnpm run lint --prefix client-node-testsnpm run test --prefix client-node-tests(211 passing)