Skip to content

Highlight Rust async and await as keywords - #3849

Closed
coyaSONG wants to merge 3 commits into
sharkdp:masterfrom
coyaSONG:fix/rust-async-await
Closed

Highlight Rust async and await as keywords#3849
coyaSONG wants to merge 3 commits into
sharkdp:masterfrom
coyaSONG:fix/rust-async-await

Conversation

@coyaSONG

Copy link
Copy Markdown

Summary

  • extend bat's existing Rust syntax patch so async and await use the control-keyword scope
  • add the issue's async function and chained .await expression to the Rust syntax fixture
  • commit the regenerated highlighted fixture while leaving generated binary asset caches out of the pull request

Closes #1534.

Root cause

bat's pinned Sublime Packages revision predates Rust async/await syntax, so both tokens fell through to ordinary identifier styling.

Validation

  • verified the updated patch applies cleanly to the exact pinned syntax source
  • ran the full repository asset builder successfully
  • rebuilt bat and confirmed async/await render with the Rust control-keyword color while async_foo remains a function identifier
  • confirmed the committed Rust fixture is byte-identical to a fresh focused render
  • cargo fmt --check
  • cargo test --locked
  • git diff --check

AI assistance

OpenAI Codex was used to inspect the issue and repository guidance, implement the change, and run the checks listed above.

@JMak-Security

Copy link
Copy Markdown

Since this has been open since 2026-07-18 with no review activity, I've carried the fix forward in #3892 — same patch, plus verification that it applies cleanly against the exact pinned submodule commit (759d6eed) rather than current upstream, which has since restructured this section entirely. Thanks for the original diagnosis and test case @coyaSONG, they made this straightforward to port over.

@coyaSONG

Copy link
Copy Markdown
Author

Closing this draft because #3892 has carried the fix forward and is ready for maintainer review. I rechecked both PRs against the same current base: the syntax patch and both regression-fixture blobs are identical, with only the changelog PR/author attribution differing, and both CI suites are green. Keeping #3892 as the single active implementation avoids duplicate review work. Thanks @JMak-Security for preserving the diagnosis and test case.

@coyaSONG coyaSONG closed this Aug 29, 2026
@JMak-Security

Copy link
Copy Markdown

@coyaSONG, Thanks for the update! Glad to help get this fixed.

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.

Rust's async await is not highlighted correctly

2 participants