davsclaus opened a new pull request, #27234:
URL: https://github.com/apache/camel/pull/27234

   Stacked on #27232 (simple completion); the base is its branch, so this diff 
is only the quick doc. It retargets to `main` when #27232 merges.
   
   In edit mode the quick doc panel at the bottom of the source editor now 
follows the cursor within a simple expression, in YAML, Java and XML routes:
   
   | Cursor on | Panel shows |
   |---|---|
   | a function (`${date:now:yyyyMMdd}`) | `date:command — Date — Evaluates to 
a java.util.Date object.`, an example, the parameters |
   | `${header.priority}` | `header.name`, plus the header: `priority — Set in 
this file`, or the catalog description of a component header such as 
`CamelKafkaKey` |
   | an operator after a function (`contains`) | the operator, its syntax and 
an example |
   | anything else on the line | the line's doc, as before |
   
   Outside edit mode (no cursor column) the selected line adds `Simple 
functions: header.name, date:command`.
   
   ![simple quick 
doc](https://raw.githubusercontent.com/apache/camel/fix/CAMEL-25219-quick-doc/docs/user-manual/modules/ROOT/images/jbang/camel-tui-source-simple-quick-doc.png)
   
   ### Changes
   - `SimpleCompletionContext.functionAt` / `functions`: the `${...}` spans of 
a line, innermost one under the cursor, unclosed ones running to the end of the 
line.
   - `SimpleQuickDoc`: maps a written function back to the catalog (the reverse 
of the completion's insert text: `date:` → `date(command)`, `bean:` → 
`bean(name.method)`, overloads such as `a2a:emit` by their number of arguments, 
OGNL as in `body.length`). The simple model and that map are cached per 
catalog, as the panel is drawn on every render.
   - `SourceViewer`: a `CursorQuickDocProvider` hook whose entries go before 
the line's in edit mode, and after them in the view. `EditQuickDocProvider` and 
its wrappers are unchanged.
   - `SimpleCompletions.names`: a component header that the file also uses 
keeps its place first but gets the catalog description (the completion details 
benefit too).
   - Help, doc page and a screenshot.
   
   ### Testing
   - `SimpleQuickDocTest`: span finding (nested, on `${` and `}`, unclosed), 
resolving written functions, function/header/operator docs, the view summary.
   - The `camel-jbang-plugin-tui` suite passes (1557 tests).
   - Tried live in the TUI; the screenshot is from that run.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to