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

   _Claude Code on behalf of davsclaus_
   
   ## What
   
   In the source editor, a YAML route line that sends to a `direct:` or `seda:` 
endpoint no route of the project consumes is marked as a **note** (amber ⚠, 
counted under `notes` in the title). For example, `to: direct:cheese` while no 
route has `from: direct:cheese`. A note does not block the save; the save 
notice still says it.
   
   This is the check `camel validate` and `camel_validate_source` have had 
since CAMEL-24955. The editor left it out because it reads every route file of 
the project, which it should not do on each keystroke.
   
   ## How
   
   - **camel-jbang-core**: `EndpointConsumerChecks.consumed(dir, file, 
catalog)` is now public. The new `validateYamlConsumers(content, 
consumedElsewhere)` puts each message on the lines that name the endpoint 
(`Line N: ...`), including `direct://cheese?...`. It skips comment lines and 
longer names such as `direct:cheeseburger`.
   - **New `ConsumedEndpoints`** in the TUI plugin: it reads the endpoints the 
other route files consume (YAML, Java and XML) on the background executor and 
keeps them for 10 seconds, or until another file opens. While the first read 
runs, nothing is said. When a read finds something else, the file shown is 
marked again through `reloadIfShowing`; while editing, the next background 
check after a keystroke picks it up.
   - **`SourceViewer`**: the `setKameletNotes` hook is renamed `setYamlNotes`, 
since it now carries both kinds of note. `SourceViewer` and `SourceEditAssist` 
are at their `SourceSizeTest` caps, so neither grows.
   - The check stays quiet when the other files cannot tell: an input that is a 
placeholder, a route template, a directory that is only part of a Maven or 
Gradle project, or more files than the scan reads.
   
   Java and XML route files are left out for now. Their checks share one 
channel with no separate notes, and in XML anything on that channel blocks the 
save.
   
   ## Tests and docs
   
   - `SourceValidatorEndpointConsumersTest`: line placement, a route in the 
same file that consumes the endpoint, and unknown other files.
   - `SourceConsumerNotesTest`: the editor flow with the background read run by 
hand: open, read, marked, saved with the note. It also covers one read per 
file, a read for another file opened during a read, and a file outside the 
project directory.
   - Ran the tests of the camel-jbang-core `ai` package (733) and the whole TUI 
module (2221): all green.
   - Docs: a paragraph in `camel-jbang-tui-source-editor.adoc`.
   
   Not tried in a running TUI.
   
   🤖 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