Skip to content

Commit

Permalink
fix: interface_statement have decorator_list (#8)
Browse files Browse the repository at this point in the history
* fix: Allow `interface_statement` to have `decorator_list`

Indeed, the web documentation makes it appear at first glance that interface does not have decorators,
but looking at the implementation, it does.
It is also shown in the example code.

<https://github.com/microsoft/typespec/blob/a939c140980805dc66a9b6fef70be5647b1c9680/packages/samples/specs/versioning/main.tsp#L51>

The PR to fix the standard and documentation has not yet been merged, but has already been submitted.

[docs: interface statement can have decorators by ncaq · Pull Request #5202 · microsoft/typespec](microsoft/typespec#5202)

I found it because of a problem that the parser here could not highlight the sample code correctly.
  • Loading branch information
ncaq authored Nov 29, 2024
1 parent 0acb668 commit 53d892f
Show file tree
Hide file tree
Showing 4 changed files with 8,980 additions and 8,588 deletions.
1 change: 1 addition & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ module.exports = grammar({
scalar_extends: $ => seq("extends", $._expression),

interface_statement: $ => seq(
optional($.decorator_list),
"interface",
field("name", $.identifier),
optional($.template_parameters),
Expand Down
12 changes: 12 additions & 0 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 53d892f

Please sign in to comment.