fix(review): language-tagged suggestion fence for Gitea syntax highlighting
Gitea 1.26.x has no GitHub-style 'Apply suggestion' button — a ```suggestion fence is just an unknown-language code block, so chroma does not highlight it and there is no apply control. Switch inline_comment_body to wrap the suggested fix in a fence tagged with the file's language (new _lang_for_path helper, .java→java, .ts→typescript, .py→python, ...), so Gitea syntax-highlights the code. No capability lost (there was never an apply button on this Gitea version). Correct the docstrings/skills/README that wrongly claimed an apply-button was rendered. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -6,7 +6,7 @@ checked-out copy of the target repo at the PR head sha, then `opencode run` is
|
||||
launched there. The `pragent` primary agent reviews the diff with real tools
|
||||
(subagents, LSP/linters via bash, webfetch references) and emits a structured
|
||||
findings JSON. A thin Python shell posts that JSON back to Gitea as inline
|
||||
comments + ```suggestion blocks + a summary (dedupe + anchor validation stay
|
||||
comments + language-highlighted suggested-fix blocks + a summary (dedupe + anchor validation stay
|
||||
deterministic in Python).
|
||||
|
||||
## Layout
|
||||
@@ -40,7 +40,7 @@ flowchart TD
|
||||
PR --> JSON["final message: summary + ```json findings```"]
|
||||
JSON --> PARSE["ai_review.parse_review_output<br/>{summary, findings}"]
|
||||
PARSE --> ANCHOR["parse_diff_anchors → split_findings"]
|
||||
ANCHOR --> POST["post_inline_review<br/>summary + inline ```suggestion + ref links + sha marker"]
|
||||
ANCHOR --> POST["post_inline_review<br/>summary + inline lang-tagged fix block + ref links + sha marker"]
|
||||
```
|
||||
|
||||
## Lean by default
|
||||
|
||||
Reference in New Issue
Block a user