Repository navigation
Format + @name = value method annotations; migrate the deprecated above-method form - #22
Merged
Merged
Conversation
…-method form webrpc v0.48.0 moved method annotations to `+ @name[:value]` meta-lines below the `- Method()` line and added method-level `+ @success NNN`. - Format `+ @name[:value]` / `+ @success NNN` lines under methods, one annotation per line; unquoted values run to end of line. - Move deprecated above-method `@annotations` below the method as `+ @annotation` lines automatically; multi-annotation lines are split, inline comments stay attached. - Stop treating `#` inside quoted values (e.g. `@see:"#frag"`) as a comment, and split name/value on the first colon only (URLs in values). - Normalize `@success:NNN` to the space-separated form webrpc expects. Verified against webrpc v0.48.0: formatted output parses warning-free. Co-Authored-By: DeepSeek v4.1 Flash <noreply@deepseek.com>
webrpc replaced the below-method `+ @name:value` form with `+ @name = value`, using struct field tag value rules: bare values are a single word, anything with spaces needs quotes. - Emit `+ @name = value`; normalize the shipped colon form to `=`. - Auto-quote multi-word values; values with `"` or `\` that webrpc can't represent are left unchanged for the parser to flag. - Keep `@success` in its route-code space form (`+ @success 200|201`), normalizing `:`/`=` variants and spaced pipe lists. - Old-form `@success:...` stays above the method: below a method the name is route-scoped and webrpc asks users to rename it themselves. - Track escaped quotes in findCommentIndex so `\"` inside a quoted value doesn't leak comment detection; raw multi-word old-form values are quoted on migration instead of space-stripped. Verified against webrpc master (d78d1d0): formatted corpus parses warning-free and formats idempotently. Co-Authored-By: DeepSeek v4.1 Flash <noreply@deepseek.com>
+ @name[:value] method annotations; migrate the deprecated above-method form+ @name = value method annotations; migrate the deprecated above-method form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
webrpc v0.48.0 moved method annotations below the
- Method()line, and webrpc#537 settled the syntax:+ @name = valuewith struct field tag value rules. ridlfmt now speaks that syntax and migrates the deprecated above-method form for you.What changed
+ @name = valueand+ @success 200|201meta-lines under methods are formatted one per line at method indent. Bare values are a single word; quoted values stay verbatim;#comments are preserved.+ @auth:ApiKeyAuth), now rejected by the parser, normalizes to=. Multi-word values get quoted automatically so the output parses.@annotationsmove below the method as+ @name = valuelines. Multi-annotation lines split one per line, inline comments stay attached.@successkeeps its route-code space form:+ @success:200,+ @success = 200and+ @success 200 | 201all become+ @success 200|201. Old-form@success:...above a method deliberately stays put — below a method the name is route-scoped and webrpc asks users to pick a new name themselves."or\in a value that needs quoting) are left byte-unchanged so the parser can flag them, instead of emitting an "escaped" form the parser would reject anyway.#inside quoted values (including after escaped quotes) is no longer mistaken for a comment.Example
formats to:
Test plan
go test ./...green, incl. colon→equals normalization, auto-quoting, escaped-quote#round-trips,@successvariants, old-form migration, and format-twice idempotency.Agent spend: 💰 $4.70, 2h18m active
🤖 This message was generated by pi using Kimi K3 on behalf of Vojtech.