Claus Ibsen created CAMEL-24617:
-----------------------------------

             Summary: Camel TUI: Add YAML DSL refactoring menu to Source tab 
editor (F5/Ctrl+R)
                 Key: CAMEL-24617
                 URL: https://issues.apache.org/jira/browse/CAMEL-24617
             Project: Camel
          Issue Type: New Feature
          Components: camel-jbang
            Reporter: Claus Ibsen


Add a refactoring popup to the Source tab's YAML DSL editor, triggered by *F5 
or Ctrl+R* when the cursor is on an EIP/URI node. The popup lists applicable 
refactoring actions for the current cursor position:

*1. Extract EIP block to new file*
Cut the current EIP node and all its children out of the route, write them to a 
new YAML file as a standalone route with `from: direct:<name>`, and replace the 
extracted block with `- to: direct:<name>` in the original file. The target 
direct: name is prompted via a name-entry dialog.

*2. Replace URI*
Replace the component URI on the current line (inline from:, to:, toD: or block 
uri: form) with a new URI entered in a dialog that supports the existing Camel 
catalog tab-completion. The query parameters of the original URI are stripped — 
only the scheme:path is kept as the basis for replacement.

*3. Extract value to property placeholder*
Replace the literal value on the current line with {{key}} and append key=value 
to application.properties (creating the file if absent). The property key is 
prompted via a name-entry dialog.

The refactor popup should only show actions that are applicable to the current 
cursor position (e.g. Replace URI only when on a URI/endpoint line, Extract EIP 
only on a step node with children).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to