Skip to content

Add support for uuid and interfaces deriving from each other#48

Merged
asklar merged 1 commit intoasklar:mainfrom
jonwis:main
Sep 12, 2025
Merged

Add support for uuid and interfaces deriving from each other#48
asklar merged 1 commit intoasklar:mainfrom
jonwis:main

Conversation

@jonwis
Copy link

@jonwis jonwis commented Sep 12, 2025

While it's not super common, people do say interface IFoo : IInspectable at times.

And they like to specify the [uuid()] on interfaces too.

@asklar asklar requested a review from Copilot September 12, 2025 22:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for UUID attributes and interface inheritance in IDL files. The changes enable interfaces to inherit from other interfaces (like IInspectable) and allow UUID attributes to be specified on interfaces.

  • Added support for interface inheritance syntax using extends clause
  • Added uuid and contractversion to the list of supported attributes
  • Updated VS Code settings for ESLint configuration

Reviewed Changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

File Description
server/src/test/assets/interfaces.idl Adds test case for interface with UUID attribute and inheritance from IInspectable
server/src/server.ts Adds uuid and contractversion to completion suggestions
server/src/midl.pegjs Updates grammar to support optional extends clause in interface declarations
.vscode/settings.json Updates ESLint setting from boolean to explicit string value

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


/* INTERFACE DECL */
ifaceDecl = _ "interface" _ interfaceName _ ((requires? _ openBrace _ ifaceMember* _ closeBrace) / ";")
ifaceDecl = _ "interface" _ interfaceName _ ((extends? _ requires? _ openBrace _ ifaceMember* _ closeBrace) / ";")
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grammar rule is missing the definition for the extends clause. You've added extends? to the interface declaration but there's no corresponding rule defining what extends should match. This will likely cause parsing errors when encountering interface inheritance syntax.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's right up there on line 111. Are you sure?

@asklar asklar merged commit 26fd45b into asklar:main Sep 12, 2025
1 check passed
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.

2 participants