Skip to content

fix(rsc): treat strings as directives only at the top - #1396

Merged
hi-ogawa merged 2 commits into
mainfrom
fix/issue-1390
Aug 5, 2026
Merged

fix(rsc): treat strings as directives only at the top#1396
hi-ogawa merged 2 commits into
mainfrom
fix/issue-1390

Conversation

@hi-ogawa

@hi-ogawa hi-ogawa commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Module and inline transforms currently treat any matching string expression as a directive, so misplaced, parenthesized, or ordinary block strings can select directive behavior.

This PR uses the parser-provided directive metadata for module and function-body recognition, which limits matching to actual directive prologues.

Co-authored-by: OpenCode <noreply@opencode.ai>
@hi-ogawa hi-ogawa changed the title fix(rsc): recognize directive prologues fix(rsc): treat strings as directives only at the top Aug 5, 2026
Co-authored-by: OpenCode <noreply@opencode.ai>
@hi-ogawa
hi-ogawa marked this pull request as ready for review August 5, 2026 00:39
@hi-ogawa
hi-ogawa merged commit fcb0ca5 into main Aug 5, 2026
22 checks passed
@hi-ogawa
hi-ogawa deleted the fix/issue-1390 branch August 5, 2026 00:48
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.

Treat string literal as file/inline directives only when they are at the top

1 participant