Skip to content

Conversation

@sofoxe1
Copy link

@sofoxe1 sofoxe1 commented Jan 6, 2026

currently to get unhandled event name one has to match for every event:

match event {
                xr::Event::SessionStateChanged(event) => {
                  info!("unknown event: SessionStateChanged");
                }
                xr::Event::InteractionProfileChanged(event) => {
                  info!("unknown event: InteractionProfileChanged");
                }
                ...
            }

this pr would allow for

match event {
                _ => {
                    info!("unknown event: {:?}",event);
                }
            }

or if less verbose output is desired

match event {
                _ => {
                    info!("unknown event: {}",event.name());
                }
            }

only testes if it builds but given what changed it should work
it's my first time using syn/quote so while this works there may be more "correct" way

Copy link
Owner

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

Seems reasonable.

match self{
#(Self::#event_names2(_)=>#event_names,)*
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

Please format conventionally.

}
let event_names2 = event_names
.iter()
.map(|s| TokenStream::from_str(&s).unwrap())
Copy link
Owner

Choose a reason for hiding this comment

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

Prefer Ident::new(s, Span::call_site()).

@sofoxe1
Copy link
Author

sofoxe1 commented Jan 7, 2026

no idea what's the convention so i copied how event_decodes is done

@sofoxe1 sofoxe1 requested a review from Ralith January 7, 2026 08:12
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