User/mattwar/treeviewbug#104
Merged
Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses two related UX/runtime issues in the VS Code extension: (1) prevents Kusto Explorer’s tree selection updates from forcibly revealing the view while it’s hidden (stealing focus), and (2) introduces a host-bridged AAD token acquisition fallback so the language server can authenticate via VS Code’s Microsoft account UI when Kusto.Data’s native flow fails in non-interactive environments.
Changes:
- Add an
IAuthenticationProviderbridge and fallback auth path (server requests token from client; connection retries once after native auth failure). - Add client-side token acquisition using VS Code’s built-in
microsoftauthentication provider, with caching. - Avoid
TreeView.reveal()when the connections tree view is hidden; re-sync selection when the view becomes visible again.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Server/Connections/IAuthenticationProvider.cs | Introduces an abstraction for acquiring AAD access tokens (typically via host UI). |
| src/Server/Connections/ConnectionManager.cs | Adds fallback-auth builder creation, cluster-level fallback promotion, and retry-on-auth-failure execution path. |
| src/Server/Server.cs | Implements IAuthenticationProvider by sending an LSP request to the client to acquire tokens; wires provider when launched with vscode arg. |
| src/Client/features/server.ts | Registers an LSP handler to service server token requests via the client authentication bridge. |
| src/Client/features/authentication.ts | Implements scope derivation and Microsoft-auth-provider token acquisition with caching. |
| src/Client/features/connectionsPanel.ts | Prevents hidden tree reveals and re-applies selection when the view becomes visible. |
| src/ServerTests/Features/ConnectionManagerTests.cs | Adds tests validating primary vs fallback builder behavior and provider invocation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <copilot@github.com>
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT license. | ||
|
|
||
| import { describe, it, expect } from 'vitest'; |
| import { | ||
| acquireMicrosoftAuthenticationToken, | ||
| GetAuthenticationTokenParams, | ||
| GetAuthenticationTokenResult, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix problem with connection panel aggressively taking focus when other activity side bars are in use.
Add fallback connection authentication through vscode when kusto primary authentication path fails.