Code reference detail
open-file-hot-path.test.ts
packages/language/test/open-file-hot-path.test.ts
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| node_engine_open_path | done | This idea applies when `reqlan.languageServer.engine` is `node`. The default engine is [language_server_rust]. The node server populates a Langium AST for the open buffer at `DocumentState.Parsed`. Later builder phases attach scopes, links, and diagnostics. They must not replace that AST. Parsed-time handlers must not read Langium `.ref`. Use `$refText`, the symbolic extract, or `peekResolvedRef` until `ComputedScopes`. The linker must not resolve a cross-reference while that document is below `ComputedScopes`. Do not log the Langium warning. Do not store a failed link. Scope lookup, code lens, completion, and idea summaries use `readResolvedRef` or `peekResolvedRef` until that phase. When another `.rq` file changes, relink this document when the index says it is affected, when comment references name that file, or when this document's outbound targets include the changed URI. Do not relink every document that still has a linker error. Workspace load parses at most 8 files at a time ( [workspace_parse_concurrency] ). `fileIdeasCache` and `importPathCache` drop a URI when that document is removed ( [scope_cache_release] ). Related: [open_file_algorithm], [ast_lifecycle]. | 0.133 | |
| open_file_algorithm | done | When the editor opens or changes a `.rq` buffer, `reqlan-lsp` runs this sequence. Do not wait for the ideas index. Do not wait for a workspace crawl. Detail: [open_file_sequence_diagram]. Related: [open_file_reference_sequencing], [language_server_rust], [ast_lifecycle], [outbound_one_hop], [open_file_hot_path], [token_colour_sequence], [missing_reference_colour_sequence], [lazy_features_after_outbound]. The hot path finishes before the first diagnostics publish. 1. Parse this buffer once ( [ast_lifecycle] ). 2. Colour tokens from that parse ( [token_colour_sequence] ). 3. Emit same-file links and same-file missing-idea errors from that parse. 4. Parse each imported file once, at depth 1, for idea names and lines ( [outbound_one_hop] ). Link an imported name that exists. Underline an imported name that does not ( [missing_reference_colour_sequence] ). 5. Return. A qualified reference may link to its file from the path token. Do not read that file on this path. After that publish, a background pass fills the rest ( [lazy_features_after_outbound] ). That pass must not delay steps 1 – 5. The server sends the hot publish before it starts that pass. It runs that pass only while no client message waits. A hover or a definition request goes first. A change reuses the import roots loaded at open. It does not read the config again. The node engine keeps [node_engine_open_path]. | 0.330 | |
| open_file_hot_path | in-progress | Open-file work stays on the one parse of this buffer plus one parse per imported file. Reuse that model for document links, go-to-definition, hover, and diagnostics until the text or the import-root mapping changes. Keep that model, and the import name lists, only for open editors ( [native_cache_retention] ). Look up an open import by URI. Do not match on file basename. Do not read SQLite. Do not call `list_all_ideas`. At parse time, publish lex and parse diagnostics with same-file and import errors. The editor must not wait for a workspace link phase to see a broken parse. Handlers on this path read the open model. They do not build a workspace link graph. Related: [open_file_algorithm], [outbound_one_hop], [ast_lifecycle], [comment_backlink_sequence]. | 0.186 |
Reference labels
"../../../../packages/language/test/open-file-hot-path.test.ts:does not relink an unrelated file that still has linker errors", "../../../../packages/language/test/open-file-hot-path.test.ts:does not treat a same-name file as the loaded neighbor", "../../../../packages/language/test/open-file-hot-path.test.ts:relinks a host when its neighbor file changes", "../../../../packages/language/test/open-file-hot-path.test.ts:reparses the host native extract when this buffer text changes", "../../../../packages/language/test/open-file-hot-path.test.ts:reuses the host native extract for links and diagnostics", ../../../../packages/language/test/open-file-hot-path.test.ts:does not relink an unrelated file that still has linker errors, ../../../../packages/language/test/open-file-hot-path.test.ts:does not treat a same-name file as the loaded neighbor, ../../../../packages/language/test/open-file-hot-path.test.ts:relinks a host when its neighbor file changes, ../../../../packages/language/test/open-file-hot-path.test.ts:reparses the host native extract when this buffer text changes, ../../../../packages/language/test/open-file-hot-path.test.ts:reuses the host native extract for links and diagnostics