Skip to content

Commit

Permalink
fix: interface_statement have decorator_list
Browse files Browse the repository at this point in the history
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.

I'll submit a PR here first as well.
  • Loading branch information
ncaq committed Nov 29, 2024
1 parent 0acb668 commit 7047f16
Showing 1 changed file with 1 addition and 0 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

0 comments on commit 7047f16

Please sign in to comment.