Skip to content

feat: support for async python syntax#18

Merged
guibeira merged 2 commits intomainfrom
fix-async-python
Apr 8, 2026
Merged

feat: support for async python syntax#18
guibeira merged 2 commits intomainfrom
fix-async-python

Conversation

@guibeira
Copy link
Copy Markdown
Collaborator

@guibeira guibeira commented Apr 8, 2026

Summary by CodeRabbit

  • New Features
    • Language server now recognizes async trigger calls alongside standard trigger invocations, enabling completions and diagnostics inside async trigger contexts.
    • Language server (iii-lsp) added to the registry as a binary worker, providing autocompletion and hover for engine functions/triggers across supported platforms.
  • Tests
    • Added tests covering async trigger completion contexts, payload sub-field completion, and multi-line/incomplete string scenarios.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9f8da928-2ecc-4046-999f-479c72806c6b

📥 Commits

Reviewing files that changed from the base of the PR and between bf701bd and 3ae393c.

📒 Files selected for processing (3)
  • iii-lsp/src/analyzer.rs
  • iii-lsp/src/diagnostics.rs
  • registry/index.json
✅ Files skipped from review due to trivial changes (1)
  • registry/index.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • iii-lsp/src/analyzer.rs
  • iii-lsp/src/diagnostics.rs

📝 Walkthrough

Walkthrough

The PR extends trigger detection to recognize trigger_async in the LSP analyzer and diagnostics, adds Python tests covering async trigger invocations and payload contexts, and registers a new iii-lsp worker entry in registry/index.json.

Changes

Cohort / File(s) Summary
Async Trigger Recognition & Tests
iii-lsp/src/analyzer.rs, iii-lsp/src/diagnostics.rs
Treat trigger_async as a trigger method alongside trigger. Add Python tests asserting CompletionContext::FunctionId and PayloadProperty for await iii.trigger_async(...) in dict-style and keyword-arg forms, including payload sub-field and multi-line/incomplete-string cases.
Worker Registry
registry/index.json
Add workers.iii-lsp registry entry (type: "binary") with description, repo: "iii-hq/workers", tag_prefix: "iii-lsp", supported targets, has_checksum: true, default_config: {}, and version: "0.1.0".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • sergiofilhowz

Poem

🐰 I sniff the async breeze at dawn,
trigger_async hops and is now drawn,
Tests nibble payloads, dicts, and strings,
The LSP hums with newly-charted things,
Hooray — a carrot-shaped feature sings! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: extending support for async Python syntax (specifically trigger_async) across the analyzer, diagnostics, and registry components.
Docstring Coverage ✅ Passed Docstring coverage is 86.36% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-async-python

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@registry/index.json`:
- Around line 25-33: The registry entries for "iii-lsp" and "image-resize" list
only two supported_targets but the CI builds nine platforms; fix by updating
each worker's supported_targets array to include all 9 platforms built by the
workflow (add the missing target strings to the "supported_targets" arrays in
the entries for iii-lsp and image-resize) or alternatively modify the workflow
to skip building targets not declared in each worker's supported_targets (add
per-worker filtering logic in the build job to consult supported_targets before
queuing platform builds). Ensure references: the "iii-lsp" and "image-resize"
entries and the CI workflow target list are aligned.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 590d40c3-c5b3-4a4d-8bda-f0b3f3418c38

📥 Commits

Reviewing files that changed from the base of the PR and between b0f6adc and bf701bd.

📒 Files selected for processing (3)
  • iii-lsp/src/analyzer.rs
  • iii-lsp/src/diagnostics.rs
  • registry/index.json

Comment on lines +25 to +33
"iii-lsp": {
"type": "binary",
"description": "III Language Server — autocompletion and hover for III engine functions and triggers",
"repo": "iii-hq/workers",
"version": "0.1.0",
"latest": "latest"
"tag_prefix": "iii-lsp",
"supported_targets": ["aarch64-apple-darwin", "x86_64-unknown-linux-gnu"],
"has_checksum": true,
"default_config": {},
"version": "0.1.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

python - <<'PY'
import json, re, pathlib

registry_path = pathlib.Path("registry/index.json")
workflow_path = pathlib.Path(".github/workflows/_rust-binary.yml")

registry = json.loads(registry_path.read_text())
declared = set(registry["workers"]["iii-lsp"]["supported_targets"])

wf = workflow_path.read_text()
workflow_targets = set(re.findall(r'- target:\s*([A-Za-z0-9._-]+)', wf))

print("Declared iii-lsp targets:", sorted(declared))
print("Workflow matrix targets:", sorted(workflow_targets))
print("In workflow but not declared:", sorted(workflow_targets - declared))
print("Declared but not in workflow:", sorted(declared - workflow_targets))
PY

Repository: iii-hq/workers

Length of output: 660


🏁 Script executed:

cat .github/workflows/_rust-binary.yml | head -150

Repository: iii-hq/workers

Length of output: 4683


🏁 Script executed:

# Check if there are per-worker filters or configurations in the workflow
rg -A 5 -B 5 "iii-lsp" .github/workflows/

Repository: iii-hq/workers

Length of output: 2652


🏁 Script executed:

# Check other workers for similar patterns
python3 << 'PY'
import json

with open("registry/index.json") as f:
    registry = json.load(f)

workers = registry.get("workers", {})
for worker_name, config in sorted(workers.items()):
    targets = config.get("supported_targets", [])
    print(f"{worker_name}: {len(targets)} target(s) - {targets[:2]}{'...' if len(targets) > 2 else ''}")
PY

Repository: iii-hq/workers

Length of output: 281


Registry under-declares supported targets for binary workers

The registry declares only 2 supported_targets for iii-lsp (aarch64-apple-darwin, x86_64-unknown-linux-gnu), but .github/workflows/_rust-binary.yml builds for 9 targets without per-worker filtering. This also affects image-resize, which has the same 2 declared targets despite the workflow building all 9. The mismatch creates inconsistency: either the registry needs to include all 9 targets, or the workflow must be configured to skip undeclared platforms.

Update registry entries or add workflow logic to align declared and built targets.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@registry/index.json` around lines 25 - 33, The registry entries for "iii-lsp"
and "image-resize" list only two supported_targets but the CI builds nine
platforms; fix by updating each worker's supported_targets array to include all
9 platforms built by the workflow (add the missing target strings to the
"supported_targets" arrays in the entries for iii-lsp and image-resize) or
alternatively modify the workflow to skip building targets not declared in each
worker's supported_targets (add per-worker filtering logic in the build job to
consult supported_targets before queuing platform builds). Ensure references:
the "iii-lsp" and "image-resize" entries and the CI workflow target list are
aligned.

@guibeira guibeira merged commit 5f853ac into main Apr 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant