Idea detail
refactor_symbol_move
reqlan rq/extension/mutation/refactor_support.rq:68
Summary
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 idea_name`.
Do not overlap decompose: decompose writes a new file. Move and decompose share the resolve-plan-apply sequence in idea-extract-flow.ts.
refactor_support refactor_changes
Navigation
Attributes
| Key | Value |
|---|---|
| implementation | reqlan-idea-refactor.ts, reqlan-idea-move-imports.ts, reqlan-code-action-provider.ts, code_actions.rs, idea-extract-flow.ts, register-idea-refactor-commands.ts |
| status | done |
| tests | idea-refactor.test.ts:move plan cuts from source and inserts into destination, idea-refactor.test.ts:move plan rewrites qualified comment paths for the moved idea, idea-refactor.test.ts:move plan removes unused source imports and copies them to destination, idea-refactor.test.ts:move plan adds a sibling import on the destination, idea-refactor.test.ts:move content plan leaves a source stub that imports the moved idea, code-actions.test.ts:offers move and delete actions at an idea declaration, code_actions.rs:offers_move_and_delete_actions_at_an_idea_declaration, extension-package.test.ts:package.json contributes move idea and move idea content commands |
Ancestor context
No ancestor chain recorded.
Outbound references
Inbound references
| Kind | Idea | Path | Snippet |
|---|---|---|---|
| references | code_actions | reqlan rq/extension/language/vsc-primitives.rq | refactor_symbol_move |
| references | refactor_changes | reqlan rq/extension/mutation/refactor_support.rq | refactor_symbol_move |
| references | comment_reference_refactor_support | reqlan rq/extension/mutation/refactor_support.rq | refactor_symbol_move |
Unresolved references
| Kind | Idea | Path | Snippet |
|---|---|---|---|
| None | |||
Local graph
Initialising graph…