tagQueryAt decides in one check, within detekt's return limit
CI & Build / Python lint (push) Successful in 2s
CI & Build / Build now, or wait for Android? (push) Successful in 2s
Android / Build, or is the channel already serving this? (push) Successful in 3s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Skipped
Desktop (Tauri) / Tauri desktop (Linux) (push) Skipped
Desktop (Tauri) / Windows installer (cross-compiled) (push) Skipped
Desktop (Tauri) / Update manifest (push) Skipped
CI & Build / Web typecheck and unit tests (push) Successful in 9s
CI & Build / Python tests (push) Successful in 12s
Android / Core and FFI clippy and tests (push) Successful in 25s
CI & Build / integration (push) Successful in 1m29s
CI & Build / Build & push image (push) Skipped
Android / Kotlin + Rust (APK) (push) Successful in 6m56s
Android / Build the server image (push) Successful in 1s

Task #6316.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 16:38:36 -04:00
co-authored by Claude Opus 5.5
parent 7e96683f01
commit 66fd5707b7
@@ -37,14 +37,16 @@ fun tagQueryAt(
text: String,
caret: Int,
): TagQuery? {
if (caret < 0 || caret > text.length) return null
var i = caret
while (i > 0 && text[i - 1].isTagChar()) i--
if (i == 0 || text[i - 1] != '#') return null
val hash = i - 1
if (hash > 0 && !text[hash - 1].isWhitespace()) return null
val query = text.substring(i, caret)
if (query.isNotEmpty() && !Character.isAlphabetic(query[0].code)) return null
val inTag =
hash >= 0 &&
text[hash] == '#' &&
(hash == 0 || text[hash - 1].isWhitespace()) &&
(query.isEmpty() || Character.isAlphabetic(query[0].code))
if (!inTag) return null
var end = caret
while (end < text.length && text[end].isTagChar()) end++
return TagQuery(start = hash, end = end, query = query)