Skip to content

windows-rdl / clang: propget support - #4243

Merged
Kenny Kerr (kennykerr) merged 5 commits into
masterfrom
copilot/add-propget-support-clarification
Apr 21, 2026
Merged

windows-rdl / clang: propget support#4243
Kenny Kerr (kennykerr) merged 5 commits into
masterfrom
copilot/add-propget-support-clarification

Conversation

Copilot AI commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

COM virtual methods annotated with [propget] in their MIDL-generated block comment now emit #[special] in the generated RDL.

Before:

struct __declspec(uuid("cd33ad7d-cb91-471d-a494-6a178012a31f"))
IFoo {
    virtual /* [id][helpstring][propget] */ unsigned int __stdcall get_Count() = 0;
};
interface IFoo {
    fn get_Count(&self) -> u32;
}

After:

interface IFoo {
    #[special]
    fn get_Count(&self) -> u32;
}

Changes

  • clang/interface.rs — Added MethodModifiers struct with MethodModifiers::from_tokens() that scans the method's token stream up to (not past) the function name, detecting [propget] in any CXToken_Comment token. The MethodModifiers doc comment now accurately describes these as MIDL attributes, noting that propget indicates a property accessor function. InterfaceMethod gains an is_propget field; write() emits #[special] when set.
  • roundtrip/propget.h / propget.rdl — New roundtrip golden test covering a method with [propget], one with an unrelated comment, and one with no comment.

Copilot AI changed the title [WIP] Add propget support to clang crate windows-rdl / clang: propget support Apr 21, 2026
/// Verifies that a pure-virtual method preceded by a `/* ... [propget] ... */`
/// block comment emits `#[special]`, while methods with no such comment do not.
#[test]
fn propget() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copilot this test is redundant - the roundtrip test validates this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in 37bdbf2.

Comment thread crates/libs/rdl/src/clang/interface.rs Outdated
Comment thread crates/libs/rdl/src/clang/interface.rs Outdated
@riverar

Copy link
Copy Markdown
Collaborator

Copilot Check out my comments above.

@kennykerr
Kenny Kerr (kennykerr) marked this pull request as ready for review April 21, 2026 20:13
@kennykerr
Kenny Kerr (kennykerr) merged commit 83aa51f into master Apr 21, 2026
27 checks passed
@kennykerr
Kenny Kerr (kennykerr) deleted the copilot/add-propget-support-clarification branch April 21, 2026 21:10
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.

windows-rdl / clang: propget support

3 participants