Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Extension recovers from an empty-then-configured activation without a window reload. Previously, if a user activated the extension before setting `tfvc.adoProject` (and without a `.vscode-tfvc/` folder), `activate()` early-returned without resolving a workspace root. After the user filled in settings, the config-change listener re-built the REST client but `root` stayed undefined, so `repo`/`scmProvider` were never created — every TFVC command then showed a misleading "Not configured" toast even though all settings were correct. The recovery now retries the root resolution from the config/PAT-change listener so the extension comes fully alive on the spot.

## [0.4.1]

### Fixed
Expand Down
15 changes: 15 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,21 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
// no visible cue. Surface the error as a warning toast pointing the
// user at their settings.
function reinitOrWarn(cause: string): void {
// Activation may have early-returned without resolving a workspace
// root (no .vscode-tfvc/ + no tfvc.adoProject at activation time).
// Now that the user has changed config or set a PAT, retry the
// root resolution so the extension can come fully alive without
// requiring a window reload — otherwise initRestClient builds the
// REST client but never creates `repo`/`scmProvider`, and any TFVC
// command shows a misleading "Not configured" toast.
if (!root) {
const tfvcRoots = findTfvcRoots();
const folders = vscode.workspace.workspaceFolders;
root = tfvcRoots[0] ?? folders?.[0]?.uri.fsPath;
if (root) {
outputChannel.appendLine(`TFVC workspace root resolved on ${cause.toLowerCase()} change: ${root}`);
}
}
initRestClient().catch(err => {
logError(`${cause} re-init failed: ${err}`);
const detail = err instanceof Error ? err.message : String(err);
Expand Down