Code reference detail
server.rs
crates/reqlan-lsp/src/server.rs
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| language_server_rust | in-progress | A Rust binary replaces the Langium language-server process. The extension launches `reqlan-lsp` over stdio. Open `.rq` buffers parse with [parser_rust]. The open sequence is ["open-file-sequencing.rq".open_file_algorithm]. Workspace names and rename targets come from the ideas index under [application_memory]. Inbound hints wait for the host snapshot of that index. The inbound inlay hover is markdown. It lists each referencer as a file link. An idea hover shows styled idea content when ["../syntax/features-syntax.rq".idea_content_tooltip] is on. A closed file has no retained syntax tree. Go-to-definition cost is ["../syntax/features-syntax-highlighting.rq".reference_goto_definition_speed]. When the engine is `rust`, the server also serves `rq:[…]` document links, go-to-definition, and missing-idea diagnostics in non- `.rq` comments. One resolution supplies the link, the definition target, and the underline. The host strips file document links; Ctrl + click uses definition ( ["../syntax/features-syntax-highlighting.rq".editor_reference_activation] ). The host serves those links when the engine is `node`. Host commands prefer LSP custom requests, napi extract, and the ideas index. Move / delete planners still use Langium until index-backed planners land. The setting `reqlan.languageServer.engine` selects the binary. The default is `rust`. `node` remains only when the setting says so, or when the binary is not on disk yet. A local extension build compiles this binary with the napi addon ( [extension_host_native_stage] ). The extension launches `bin/reqlan-lsp`, else that release build. It never launches a debug build, because a debug build is slow and the extension build does not refresh it. Code actions match ["../vsc-primitives.rq".code_actions]: ignore, create below, import fixes, search or wrap, idea move and delete, and barrel page. Attribute and name catalogs drive completion. Rename and find-references use open buffers plus the ideas index. Inlay hints honour `reqlan.referencesInlayHints.enabled` and the host inbound snapshot. An import link uses the parser token span ( [import_from] ). The path links to the file. An imported idea name and its alias each link to that declaration. A namespace reference links the alias and the idea as separate names. A missing leaf reports an unresolved idea on that name. Related: [language_server], [grammar_and_parser], [analytical_rust_port], [vsix_export]. | 0.580 | |
| ast_lifecycle | done | The open buffer has one model. That model is the Rust parse of this buffer. [local_symbolic_analysis] is a file-local extract. The hot path does not run it as a second parse. Related: [open_file_algorithm], [open_file_sequence_diagram], [outbound_one_hop], [token_colour_sequence], [parse_budget_timeout], ["./initialisation-and-sequencing.rq".lsp_file_watch], [language_server_rust]. Populate. Parse this buffer when the editor opens it. Semantic tokens, same-file links, and the import list come from that parse. Replace. When this buffer text changes, parse again and replace the model. Do not patch the old model. A watched `.rq` change uses the same replace path ( [document_update_handler] ). When the text is unchanged, keep the current model. Drop. When the editor closes the buffer, drop the model. A closed file keeps no syntax tree ( [language_server_rust] ). Import files. [outbound_one_hop] stores a name list for each imported file. That list is not an open-buffer model. A change to an imported file does not replace this buffer's model. Read the imported file again when its content hash changes. Incomplete parse. When the budget fails, store an empty model plus diagnostics ( [parse_budget_timeout] ). Idea names stay empty until a later successful parse. The node engine follows [node_engine_open_path]. | 0.249 | |
| file_crawl_sequence | done | Workspace crawl is the indexer ( [index], [index_sequencing] ). It is not the open-file path. Native sync walks `.rq` files, then allowlisted code files, and writes SQLite. Open-file links must not wait for that walk ( [open_file_algorithm] ). The language server watches `.rq` files only ( ["./initialisation-and-sequencing.rq".lsp_file_watch] ). Related: [extension_startup_sequence], [background_startup]. | 0.040 | |
| lazy_features_after_outbound | done | After the hot path is on screen, show the rest when its data is ready. This pass must not delay [open_file_algorithm] steps 1 – 5. Related: [language_server], [unify_inbound_indexes], [background_startup], [inlay_hints], [codelens]. Work: - Confirm each qualified reference. Read that target file once, at depth 1. Then paint the idea line or the missing-idea error ( [missing_reference_colour_sequence] ). - Inbound backlinks: inlay hints and the file-top CodeLens, from the host snapshot ( [unify_inbound_indexes] ). - Attribute and name catalogs for completion and quick fixes. - Unqualified comment matches from that snapshot ( [comment_backlink_sequence] ). Until the first ready snapshot arrives, inlay hints and the file CodeLens stay empty. Those handlers do not open SQLite and do not call `list_all_ideas`. Later updates are incremental ready-state events ( ["../../../indexer/cache-reuse.rq".inbound_snapshot_events] ); last-good stays until replaced. When a ready snapshot arrives, refresh the visible editors. | 0.283 | |
| 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 | |
| complementary_information_rendering | The extension should render computed information inline in the editor as complementary text. Complementary rendering should include resolved references and optionally indirect references behind a toggle. Complementary rendering should not mutate source files unless the user explicitly applies a change. | 0.040 | ||
| reference_goto_definition_speed | done | Hover and go-to-definition are lookups on the open parse. The parse keeps its references sorted by start byte. A request finds the reference under the cursor by binary search. A request does not walk the syntax tree and does not convert each reference to a line and column. A request resolves each authored path once per parse. It does not `stat` that path again. A same-file idea uses that parse. An open neighbor uses that neighbor's buffer. A closed neighbor is parsed once. The server keeps its model, idea names, and name-token ranges. A later request does one `stat`. It reads and parses the file again only when the modified time or the size changed. A hover on a cross-file idea renders from that cached model. It does not read the file. The target is the name token of the idea, in the open editor when the target is open. An imported alias such as `[other]` reaches the imported idea. A folder reference has no definition. Its link is the folder-picker command. A hover renders idea content only when ["./features-syntax.rq".idea_content_tooltip] is on. A request does not wait behind the confirm pass of ["../support/open-file-sequencing.rq".lazy_features_after_outbound]. The editor calls this request on Ctrl + hover. The extension does not send the document text from that handler. The extension does not open a folder picker or a wildcard panel from that handler. A folder click and a wildcard click use the command document link. When the engine is node, the provider uses cached Langium ref objects for idea tokens. It does not scan the document text when the CST already covers the cursor. Related: [editor_reference_activation], ["../../../language/imports.rq".wildcard_references_webview]. | 0.179 | |
| view_references_as_inlay_hints | done | References should be shown as inlay hints in the editor. This should be a toggleable setting, which should be available in the command palette. N-lines ( configurable setting ) of hints should be shown below the idea. Inbound lookup must stay interactive on large graphs via [inbound_inlay_index_performance]. The Rust server honours `reqlan.referencesInlayHints.enabled` and the host inbound snapshot ( `byIdeaName` + `fileReferencers` ). Implemented by ["../../../../packages/language/src/reqlan-inlay-hint-provider.ts"], ["../../../../packages/language/src/reqlan-inbound-reference-inlay-label.ts"], ["../../../../packages/language/src/reqlan-inlay-hint-settings.ts"], ["../../../../packages/extension/src/extension/register-reference-inlay-hints.ts"], and ["../../../../crates/reqlan-lsp/src/session.rs"]. | 0.093 | |
| idea_content_tooltip | done | A hover on an idea name or on a reference shows that idea's content. The tooltip is markdown. It uses a heading, body lines, attributes, lists, and code fences. A reference in another file shows that file's idea content. The setting `reqlan.ideaContentTooltip.enabled` controls this hover. The default is on. When the setting is off, the hover shows the idea name and the one-line summary. Related: [syntax_hovering] ["../support/language-server-rust.rq".language_server_rust] | 0.149 | |
| syntax_features | The extension should provide language support for. rq files via the lsp. Syntax features should cover ideas, ideasets, imports, references, attributes, comments, and lists. Broken imports and references should be validated and reported in the editor. Go-to-definition and find-references should work for ideas, imports, and cross-file links. Find-references is served by ["../support/language-server-rust.rq".language_server_rust] ( `textDocument/references` ). Autoformatting should be supported for. rq files. | 0.046 | ||
| code_actions | done | Language-server code actions for `.rq` files, plus comment-file Quick Fixes for ignore-error: - Quick fixes for unresolved references ( add import, rewrite qualified ref, search, create file ) — ["./support/features-imports.rq".import_error] - Refactor: search / replace or wrap as idea reference — ["../host/features-commands.rq".search_code_actions] - Refactor: move or delete an idea declaration — ["../mutation/refactor_support.rq".refactor_symbol_move] ["../mutation/refactor_support.rq".refactor_symbol_delete] - File-level source action: barrel page — ["../host/features-commands.rq".barrel_page] - Quick Fix: insert `//rq-ignore-error` before a line with diagnostics — ["../host/features-commands.rq".code_actions_ignore_error] - Quick Fix: create a missing local idea below the idea that contains the unresolved reference — ["../host/features-commands.rq".create_idea_below_idea_containing_unresolved_reference_under_cursor] The Rust server returns the same set ( ["./support/language-server-rust.rq".language_server_rust] ). Command-backed search / replace and barrel actions omit LSP command arguments so VS Code does not cache disposable delegating ids; the extension resolves the active editor ( or document ) when the command runs. The same Quick Fix appears once in one request. Langium appends validation diagnostics when a document already has diagnostics. The diagnostic list stays when the document state is below Validated. The document builder removes previous built-in diagnostics before that append. One linking error gives one Quick Fix after repeated builds. | 0.169 | |
| codelens | Outbound classification CodeLens on references: ["./syntax/features-syntax-highlighting.rq".code_lens_reference_types]. File-top inbound file-reference CodeLens: ["./syntax/features-syntax-highlighting.rq".file_inbound_code_lens]. Idea inbound `@referenced-by` remains an inlay: ["./syntax/features-syntax-highlighting.rq".view_references_as_inlay_hints]. | 0.103 |
Reference labels
"../../../../crates/reqlan-lsp/src/server.rs", "../../../crates/reqlan-lsp/src/server.rs", ../../../../crates/reqlan-lsp/src/server.rs, ../../../crates/reqlan-lsp/src/server.rs