Code reference detail
code_actions.rs
crates/reqlan-lsp/tests/code_actions.rs
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| barrel_page | done | When a `.rq` page grows large, barrel it into a container: create one sibling file per top-level idea, import those files into the current page, and replace the page body with a single container idea whose name the user chooses ( default: the sanitized file basename ). Same-file sibling refs are rewritten to qualified imports in the child files. Existing page imports are copied into each child. Top-level ideasets are preserved in the container file. Behaviour lives in ["../../core-architecture.rq".analytical_package] and is exposed via [cli] / ["../../cli/cli_package.rq".commands] ( `reqlan barrel` ). Extension: file-level source code action **Barrel page into container … ** and command palette **Barrel Page** ( `reqlan.barrelPage` ) prompt for the container name, confirm, then create child files and rewrite the active page via WorkspaceEdit. Related: [file_based_code_actions] [decompose] | 0.184 | |
| code_actions_ignore_error | done | A Quick Fix [code_actions] on a line with diagnostics inserts [comment_reference_ignore] ( `//rq-ignore-error` ) on the line before the error. The inserted comment uses the same indent as the error line. One action is offered per line when that line has one or more diagnostics. The action is omitted when that line is already suppressed, and when the client asks only for non-quickfix kinds. Available in `.rq` files and in a comment context in a code file ( ["../language/comment-references/functional-code-comment-references.rq".references_in_functional_code_comments] ). In `#` comments the action inserts `# //rq-ignore-error` so the line stays a comment. | 0.074 | |
| 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 | |
| create_idea_below_idea_containing_unresolved_reference_under_cursor | done | If a local idea reference does not resolve, a Quick Fix [code_actions] creates a new idea below the idea that contains the reference. The action uses the unresolved local idea names in the idea that contains the caret: - one unresolved name: apply `Create '<name>' below` directly - several unresolved names: offer `Create all unresolved ideas below` and one action per name Qualified file / import references are omitted. The new idea is an empty block inserted after the containing idea. | 0.074 | |
| 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 | |
| import_error | done | " Could not resolve reference " errors offer Quick Fix code actions ( lightbulb and editor right-click Quick Fix ). Fixes: - Add import from a matching idea found in loaded documents or the name catalog pushed from the index - Rewrite the reference to an anonymous qualified form `["path".name]` - Search the index for matching ideas, ideasets, or files ( same `reqlan.searchReference` path as [code_actions] / ["../../host/features-commands.rq".search_code_actions] ), then insert an import - Create the idea in a new. rq file and import it [general_errors] [code_actions] [quick_fixes] | 0.078 | |
| remote_imports | Reqlan files should support importing requirements from remote urls. Remote import syntax should follow import " https://company.com/reqs/style.rq" as styleguide. The extension should resolve, cache, and validate remote imports. Barrel imports should be recommended for token efficiency when many symbols are needed from one remote file. | 0.040 | ||
| 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 | |
| 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 | ||
| refactor_changes | On rename, move, or delete of files or symbols, the extension should update the idea index, import statements, embedded file references, comment references, and other idea references that are affected. The index should be resilient to duplication, particularly when ideas move between files: the old hosting file URI must be cleared before or when the destination is reindexed. [refactor_file_moves] [refactor_symbol_rename] [refactor_symbol_move] [refactor_symbol_delete] [comment_reference_refactor_support] Implemented by ["../../../packages/analytical/src/index-store/workspace-index.ts"], ["../../../packages/extension/src/analytical_submodule/index-store/index-service.ts"], ["../../../packages/language/src/reqlan-idea-refactor.ts"], and ["../../../packages/extension/src/mutation_module/register-file-mutation-hooks.ts"]. | 0.114 | ||
| refactor_symbol_delete | An idea declaration should offer a code action to delete it and update references. Deleting should remove the declaration, clear or rewrite AST and comment references that targeted it ( [comment_reference_refactor_support] ), and reindex affected files. [refactor_support] [refactor_changes] Implemented by ["../../../packages/language/src/reqlan-idea-refactor.ts"], ["../../../packages/language/src/reqlan-code-action-provider.ts"], ["../../../crates/reqlan-lsp/src/code_actions.rs"], and ["../../../packages/extension/src/mutation_module/refactor/register-idea-refactor-commands.ts"]. | 0.106 | ||
| refactor_symbol_move | done | An idea can move to another existing `.rq` file from a code action or the [command_palette]. Palette commands use the idea under the cursor, or a pick list when the cursor is not on an idea. 1. Move idea ( `reqlan.refactor.moveIdea` ) - Cut the declaration from the source file. - Insert it into the destination file. - Remove source imports that the move makes unused. - Add the imports that the moved idea needs to the destination. - If the source file still refers to the idea, import it from the destination. - Rewrite comment references per [comment_reference_refactor_support]. - Reindex without duplicate idea rows for the old hosting file. 2. Move idea content ( `reqlan.refactor.moveIdeaContent` ) - Do the same as ( 1 ). - Always import the destination file in the source. - Leave a one-liner stub in the source: `idea_name [alias.idea_name]`. Do not overlap [decompose]: decompose writes a new file. Move and decompose share the resolve-plan-apply sequence in ["../../../packages/extension/src/mutation_module/refactor/idea-extract-flow.ts"]. [refactor_support] [refactor_changes] | 0.106 |
Reference labels
"../../../../crates/reqlan-lsp/tests/code_actions.rs:appends_after_aliased_specifier_on_existing_from_import", "../../../../crates/reqlan-lsp/tests/code_actions.rs:appends_to_an_existing_from_import_for_the_same_path", "../../../../crates/reqlan-lsp/tests/code_actions.rs:creates_the_missing_idea_below_the_containing_idea", "../../../../crates/reqlan-lsp/tests/code_actions.rs:inserts_from_import_at_top_when_file_has_no_imports", "../../../../crates/reqlan-lsp/tests/code_actions.rs:inserts_new_from_import_after_existing_from_import_with_blank_line", "../../../../crates/reqlan-lsp/tests/code_actions.rs:inserts_new_from_import_after_existing_from_import_without_blank_line", "../../../../crates/reqlan-lsp/tests/code_actions.rs:inserts_new_from_import_after_existing_namespace_import", "../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_add_import_and_rewrite_when_a_matching_idea_exists_elsewhere", "../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_add_import_from_the_ideas_index", "../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_all_or_a_specific_unresolved_idea", "../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_barrel_page_source_action_when_the_file_has_top_level_ideas", "../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_ignore_error_quick_fix_on_a_line_with_a_linking_error", "../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_move_and_delete_actions_at_an_idea_declaration", "../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_search_code_action_when_cursor_is_inside_a_resolved_reference", "../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_wrap_code_action_for_a_prose_selection", "../../../../crates/reqlan-lsp/tests/code_actions.rs:omits_barrel_page_when_only_quickfix_is_requested_or_there_are_no_ideas", "../../../../crates/reqlan-lsp/tests/code_actions.rs:omits_create_below_for_a_qualified_unresolved_reference", "../../../../crates/reqlan-lsp/tests/code_actions.rs:omits_create_below_when_only_refactor_is_requested", "../../../../crates/reqlan-lsp/tests/code_actions.rs:omits_create_below_when_the_caret_idea_has_no_unresolved_local_references", "../../../../crates/reqlan-lsp/tests/code_actions.rs:omits_ignore_error_when_only_refactor_is_requested", "../../../../crates/reqlan-lsp/tests/code_actions.rs:search_and_create_actions_invoke_extension_commands", "../../../../crates/reqlan-lsp/tests/code_actions.rs:uses_name_catalog_matches_when_documents_are_not_loaded", "../../../../crates/reqlan-lsp/tests/code_actions.rs:wraps_the_word_under_the_cursor_when_selection_is_empty", "../../../crates/reqlan-lsp/tests/code_actions.rs", "../../../crates/reqlan-lsp/tests/code_actions.rs:creates_the_missing_idea_below_the_containing_idea", "../../../crates/reqlan-lsp/tests/code_actions.rs:offers_all_or_a_specific_unresolved_idea", "../../../crates/reqlan-lsp/tests/code_actions.rs:offers_barrel_page_source_action_when_the_file_has_top_level_ideas", "../../../crates/reqlan-lsp/tests/code_actions.rs:offers_ignore_error_quick_fix_on_a_line_with_a_linking_error", "../../../crates/reqlan-lsp/tests/code_actions.rs:offers_move_and_delete_actions_at_an_idea_declaration", "../../../crates/reqlan-lsp/tests/code_actions.rs:offers_search_code_action_when_cursor_is_inside_a_resolved_reference", "../../../crates/reqlan-lsp/tests/code_actions.rs:offers_wrap_code_action_for_a_prose_selection", "../../../crates/reqlan-lsp/tests/code_actions.rs:omits_barrel_page_when_only_quickfix_is_requested_or_there_are_no_ideas", "../../../crates/reqlan-lsp/tests/code_actions.rs:omits_create_below_for_a_qualified_unresolved_reference", "../../../crates/reqlan-lsp/tests/code_actions.rs:omits_create_below_when_only_refactor_is_requested", "../../../crates/reqlan-lsp/tests/code_actions.rs:omits_create_below_when_the_caret_idea_has_no_unresolved_local_references", "../../../crates/reqlan-lsp/tests/code_actions.rs:omits_ignore_error_when_only_refactor_is_requested", "../../../crates/reqlan-lsp/tests/code_actions.rs:wraps_the_word_under_the_cursor_when_selection_is_empty", ../../../../crates/reqlan-lsp/tests/code_actions.rs:appends_after_aliased_specifier_on_existing_from_import, ../../../../crates/reqlan-lsp/tests/code_actions.rs:appends_to_an_existing_from_import_for_the_same_path, ../../../../crates/reqlan-lsp/tests/code_actions.rs:creates_the_missing_idea_below_the_containing_idea, ../../../../crates/reqlan-lsp/tests/code_actions.rs:inserts_from_import_at_top_when_file_has_no_imports, ../../../../crates/reqlan-lsp/tests/code_actions.rs:inserts_new_from_import_after_existing_from_import_with_blank_line, ../../../../crates/reqlan-lsp/tests/code_actions.rs:inserts_new_from_import_after_existing_from_import_without_blank_line, ../../../../crates/reqlan-lsp/tests/code_actions.rs:inserts_new_from_import_after_existing_namespace_import, ../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_add_import_and_rewrite_when_a_matching_idea_exists_elsewhere, ../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_add_import_from_the_ideas_index, ../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_all_or_a_specific_unresolved_idea, ../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_barrel_page_source_action_when_the_file_has_top_level_ideas, ../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_ignore_error_quick_fix_on_a_line_with_a_linking_error, ../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_move_and_delete_actions_at_an_idea_declaration, ../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_search_code_action_when_cursor_is_inside_a_resolved_reference, ../../../../crates/reqlan-lsp/tests/code_actions.rs:offers_wrap_code_action_for_a_prose_selection, ../../../../crates/reqlan-lsp/tests/code_actions.rs:omits_barrel_page_when_only_quickfix_is_requested_or_there_are_no_ideas, ../../../../crates/reqlan-lsp/tests/code_actions.rs:omits_create_below_for_a_qualified_unresolved_reference, ../../../../crates/reqlan-lsp/tests/code_actions.rs:omits_create_below_when_only_refactor_is_requested, ../../../../crates/reqlan-lsp/tests/code_actions.rs:omits_create_below_when_the_caret_idea_has_no_unresolved_local_references, ../../../../crates/reqlan-lsp/tests/code_actions.rs:omits_ignore_error_when_only_refactor_is_requested, ../../../../crates/reqlan-lsp/tests/code_actions.rs:search_and_create_actions_invoke_extension_commands, ../../../../crates/reqlan-lsp/tests/code_actions.rs:uses_name_catalog_matches_when_documents_are_not_loaded, ../../../../crates/reqlan-lsp/tests/code_actions.rs:wraps_the_word_under_the_cursor_when_selection_is_empty, ../../../crates/reqlan-lsp/tests/code_actions.rs, ../../../crates/reqlan-lsp/tests/code_actions.rs:creates_the_missing_idea_below_the_containing_idea, ../../../crates/reqlan-lsp/tests/code_actions.rs:offers_all_or_a_specific_unresolved_idea, ../../../crates/reqlan-lsp/tests/code_actions.rs:offers_barrel_page_source_action_when_the_file_has_top_level_ideas, ../../../crates/reqlan-lsp/tests/code_actions.rs:offers_ignore_error_quick_fix_on_a_line_with_a_linking_error, ../../../crates/reqlan-lsp/tests/code_actions.rs:offers_move_and_delete_actions_at_an_idea_declaration, ../../../crates/reqlan-lsp/tests/code_actions.rs:offers_search_code_action_when_cursor_is_inside_a_resolved_reference, ../../../crates/reqlan-lsp/tests/code_actions.rs:offers_wrap_code_action_for_a_prose_selection, ../../../crates/reqlan-lsp/tests/code_actions.rs:omits_barrel_page_when_only_quickfix_is_requested_or_there_are_no_ideas, ../../../crates/reqlan-lsp/tests/code_actions.rs:omits_create_below_for_a_qualified_unresolved_reference, ../../../crates/reqlan-lsp/tests/code_actions.rs:omits_create_below_when_only_refactor_is_requested, ../../../crates/reqlan-lsp/tests/code_actions.rs:omits_create_below_when_the_caret_idea_has_no_unresolved_local_references, ../../../crates/reqlan-lsp/tests/code_actions.rs:omits_ignore_error_when_only_refactor_is_requested, ../../../crates/reqlan-lsp/tests/code_actions.rs:wraps_the_word_under_the_cursor_when_selection_is_empty