Code reference detail
main.ts
packages/extension/src/language/main.ts
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| extension_package | `packages/extension` ( npm `reqlan-extension` ) is the editor product per [distribution.extension_package]. It registers `.rq` language support, TextMate grammars, starts the language client, and owns activity bar, Ideas Summary, chat, skills, and mutation hooks. Ideas index engine lives in [analytical_package] / [indexer]; the extension only hosts a thin VS Code adapter ( [editor_index_adapter] ) for watchers and UI. Host entry: [extension_main]. LSP process: [lsp_rust.language_server_rust]. Node fallback: [language_server_main]. Depends on [language_package] and [analytical_package]. Follows [extension_architecture.event_driven] and [extension_architecture.state_machine_mindset] for JS state; webview UI standards in ["./codestyle/typescript.rq".ui_state_management]. This is the one Marketplace / Open VSX shippable; see [package_versioning]. | 0.128 | ||
| language_server | The language server is the `reqlan-lsp` binary ( [lsp_rust.language_server_rust] ). The extension launches it over stdio ( [extension_main] ). It parses open `.rq` buffers for definition, completion, semantic tokens, inlays, document links, and validation. It reads the ideas index for workspace names. It does not keep a syntax tree for every file. A Node Langium process remains only when `reqlan.languageServer.engine` is `node`, or when the binary is missing ( [language_server_main] ). Product expectation for LSP navigation and validation: [extension_scope.lsp_support]. | 0.167 | ||
| command_palette | done | Extension commands should be available via the vscode command palette and configurable keyboard shortcuts. Command titles should not repeat the category prefix; use category " reqlan " with plain titles so the palette shows " Reqlan: List All Ideas ", not " Reqlan: Reqlan:... " or " RQ: RQ:... ". Commands belong to product domains; this file is the palette naming hub under host lifecycle. Agent: [agent_ai.add_to_chat]. Index host: [index_diagnostics.open_index_diagnostics]. Diff: [diff_webview]. Export: [export_functions.export_html] and siblings. Mutation: [refactor_support], [barrel_page], [decompose]. Language: [search_code_actions], [code_actions_ignore_error], [create_idea_below_idea_containing_unresolved_reference_under_cursor]. | 0.087 | |
| search_code_actions | done | when cursor is in a `[reference]`, there shouls be a code action to search for references to that idea. it should also allow wrapping a selected string, or the word at the cursor when in idea-body prose, as a new `[reference]`. it should open up a webview modal that shows a search dialog that allows the user to search for potential references. the search menu should preserve / show the context of the would-be reference: the rest of the containing idea, with styling, and with the selected text pulsing / styled prominently. it should support fuzzy / partial searching via [search_analysis.fuzzy_search]. it should list the closest matches in a paginated view. selecting the idea should fill / replace the reference ( or wrap the selection as `[name]` ) and an import ( if required ) appropiately The lightbulb command ( `reqlan.searchReference` ) is arg-less because VS Code caches arg-bearing code-action commands and may dispose them on refresh ( error text like Actual command not found ). At invoke time the extension resolves the site via LSP `reqlan/referenceSearchSite`, or a local parse of the active editor when the language client is not yet running — it must not fail with a false " language server is not ready " when a local site can be resolved. | 0.116 | |
| 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 | |
| token_colour_sequence | done | Token colour has two layers. They must not wait for the ideas index. TextMate paints first from the buffer text. Semantic tokens paint from the one parse ( [ast_lifecycle] ). A second extract does not paint tokens. A missing reference keeps the same token colour. The error underline is a diagnostic ( [missing_reference_colour_sequence], [reference_rendering] ). Related: [syntax_highlighting]. | 0.117 | |
| 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 | ||
| import_keywords | The keywords import, from, and as are reserved for import statements. Import keywords may also appear as ordinary words in idea body text when not at statement start. | 0.047 | ||
| wildcard_references | done | Qualified path + idea-pattern references match multiple ideas across files. Surface forms: bracket `[…]` and wikilink `[[…]]` ( same `WildcardReference` target ). Path is a quoted string that may include shell-style globs ( `*`, `**`, `?` ) and `@/` import-root aliases ( [configuration_import_root_alias] ). Relative globs resolve against the defining document directory; `.` / `..` segments are collapsed before matching. Idea pattern is an unquoted `WILDCARD_NAME` that must contain at least one `*` or `?` Exact quoted-path plus idea stays ["./syntax.rq".reference_qualified]. Matching uses anchored globs ( not full JS regex ): path `*` is one segment, `**` crosses segments; idea `*` / `?` match within the idea name. Zero matches produce a warning diagnostic. One match also produces a warning — a wildcard is for many ideas; use a concrete ["./syntax.rq".reference_qualified] when only one idea matches ( ["../core_analysis/check.rq".check_wildcard_one] ). Path segment `/**/` must not be lexed as an empty block comment — see ["./syntax.rq".comments]. Lexer note: `ID` is a prefix of many wildcard names ( `import_` vs `import_*` ); the token builder sets `ID.LONGER_ALT = WILDCARD_NAME` so `import_*` is one token. Body prose `*` tokens are accepted via `WILDCARD_NAME` in PlainText so ordinary `*` characters still parse. Without that longer-alt, a live wildcard inside a block body can fail Idea recovery and leave later top-level ideas unindexed ( soft mtime sync will not rebuild until the `.rq` file changes ). Navigation does not emit N LocationLinks. A document-link click opens `reqlan.openWildcardReference` with `{ pathPattern, ideaPattern, fromUri }` ( see [wildcard_references_webview] ). Go-to-definition does not open that panel. Indexing fans out per ["../indexer/indexer.rq".wildcard_reference_edges] ( owned under ["../indexer/indexer.rq".index] ): native extract writes one `wildcard_reference` edge per catalog match; empty catalog / zero matches → one unresolved edge of that kind labeled with the pattern text. ["../core_analysis/check.rq".check] handles 0 - match and 1 - match fan-out through ["../core_analysis/check.rq".check_wildcard_zero] and ["../core_analysis/check.rq".check_wildcard_one] ( ["../core_analysis/check.rq".check_wildcard_sparse] ). Ideas Summary graph toggles those edges via ["../extension/workspace-summary/ideas_summary/graphical_graph.rq".wildcard_refs_toggle]. The server can answer `reqlan/wildcardReferenceAt`. Go-to-definition does not call it. Related: ["./syntax.rq".reference_embedding], ["./syntax.rq".reference_brackets], ["./syntax.rq".reference_wikilink], ["../indexer/indexer.rq".wildcard_reference_edges], ["../core_analysis/check.rq".check_wildcard_sparse], ["../core_analysis/check.rq".check_wildcard_zero], ["../core_analysis/check.rq".check_wildcard_one]. Illustrative forms ( fenced so this file does not embed live wildcards ): | 0.486 | |
| comment_reference_ignore | done | Comment reference ignore syntax uses `//rq-ignore-error`. Comment reference ignore suppresses diagnostics on the immediately following line. The language server and the CLI use the same core scanner [rq_ignore]. | 0.511 | |
| extension | done | The extension contains the editor product features. Host: [extension_main]; scope: ["./extension/host/scope.rq".vscode_extension], ["./extension/host/scope.rq".lsp_support]. Architecture: ["./extension/host/architecture.rq".event_driven]; packages: ["./core-architecture.rq".extension_package]. Domain hierarchy: ["./extension/extension.rq".extension_product], ["./extension/extension.rq".extension_domains]. | 0.102 | |
| idea | done | A reqlan core unit is an idea. Syntax: ["./language/syntax.rq".simple_idea], ["./language/syntax.rq".block_idea]. Grammar: [reqlan_grammar] `Idea` / `OneLinerIdea`; index records: [analytical_types] `IdeaRecord`. Extract: [idea_extractor], [rust_extract]; AST: [rust_ast]. Product surface: [ideas_summary_tabs] Ideas tab per ["./extension/workspace-summary/ideas_summary/webview.rq".ontology_aligned_tabs]. | 0.110 |
Reference labels
"../../../packages/extension/src/language/main.ts", "../../packages/extension/src/language/main.ts", "../packages/extension/src/language/main.ts", ../../../../packages/extension/src/language/main.ts, ../../../packages/extension/src/language/main.ts, ../../packages/extension/src/language/main.ts, ../packages/extension/src/language/main.ts