MapColonies / MapColonies/infra-tools

vscode: a values file already open when the window starts is never checked

Open Beginner friendly
#40 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
22h 52m
Merged PRs (30d)
13

Description

## Parent

#17

## Current behaviour

`activate` registers `vscode.workspace.onDidOpenTextDocument` and nothing else, and never sweeps `vscode.workspace.textDocuments`. With `onStartupFinished` activation, editors restored from the previous session are opened *before* the extension activates, so that event never fires for them.

A developer who closes VS Code with a values file open and reopens it sees no checkmarks, no squiggles, and nothing in the Problems panel, until they close and reopen the tab.

Confirmed with a throwaway probe extension using the same `onStartupFinished` activation, launched with a values file open:

```
ACTIVATE at 2026-09-16T12:40:33.688Z
textDocuments already open at activation:
- /tmp/ext-ws/values.yaml (lang=yaml)
```

The document is present in `workspace.textDocuments` at activation, and `onDidOpenTextDocument` does not fire for it.

## Expected behaviour

Values files already open at activation are checked, so restoring a window gives the same result as opening the file by hand.

## Why this is not already covered

Spec #17 names its triggers exhaustively — "Checks run on document open and 750 milliseconds after typing stops" — and activation is not among them, so this is a gap in the spec rather than a slice someone already scoped.

- #28 re-checks after an *edit*; it masks this only for a file the developer happens to type in.
- #24 covers file scope and `appVersion`-change re-checks.
- #27 covers caching.
- #29 is closest: a tree that "lists the active file's references with their status and follows the active editor" cannot work on a restored file without this sweep. It would likely force the fix, but it sits two tickets downstream of #24.

## Notes

Pre-existing since #31, the tracer bullet that added the open listener. Found while investigating a separate report during #22; the fix was deliberately kept out of that PR as unrelated.

Worth deciding alongside #27, since sweeping every open values file at activation costs one registry request per reference until the cache lands.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the extension's activate path, including onDidOpenTextDocument and workspace.textDocuments, then reproduce startup with a values.yaml file already open. Ensure restored values files receive the same checks as manually opened files, and verify checkmarks, squiggles, and Problems-panel results after window restoration.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.