Preserve output channel visibility on restart - #1849
Preserve output channel visibility on restart#1849Pradeep Ramola (pradeep-ramola) wants to merge 3 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:
|
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 matches VS Code log output resources by normalized log-channel resource suffix instead of using a broad substring match. This avoids treating another visible output channel as a match when, for example, the extension id contains the channel name, and it 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(208 passing)