registrystack / registrystack/registry-stack

VS Code root detection reads only block-style top-level kind and apiVersion

Open
#864 0 comments 0 reactions 0 assignees View on GitHub
area:relay criticality:p3 enhancement javascript needs-jeremi-decision
Dominant language
Rust
Stars
2
Forks
0
Avg merge
2h 57m
Merged PRs (30d)
128

Description

The VS Code extension decides whether a directory is a Relay V2 project root by reading `registry.yaml` and taking `kind:` and `apiVersion:` only when they are written as top-level block keys at column zero with a plain or quoted scalar on the same line (`editors/vscode/src/projectRoot.ts`, `topLevelScalar`). The README states this rule. A `registry.yaml` written as a top-level flow mapping, or with whitespace before the colon, is valid YAML that the Relay compiler and language server read, but the extension does not recognise the root, so it starts no language server for that project and gives no diagnostics or navigation.

The extension has no YAML parser at runtime (`js-yaml` appears in `package.json` only as a dependency override), and the detector reads at most the first mebibyte of the marker file, so a parser would have to cope with a truncated document.

Options:

1. Keep the rule and leave it documented (current state).
2. Parse the marker with a YAML reader bounded to the same byte limit, treating a parse failure as "not a root", so the client accepts the same discriminator forms as the server.

Raised by review on the pull request that added the marker rule.

Contributor guide

Open the contributing guide

Research direction

Read editors/vscode/src/projectRoot.ts, especially topLevelScalar, and the README's description of the marker rule. Compare the extension's detection with the Relay compiler and language server behavior for the listed YAML forms, then determine which option should be adopted; done means the chosen behavior is documented and root detection remains bounded to the first mebibyte.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode, yaml
Domain
tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.