-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dotnet] Annotate nullable reference types on input devices #14804
base: trunk
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
{ | ||
return this.CreatePause(TimeSpan.Zero); | ||
} | ||
public Interaction CreatePause() => this.CreatePause(TimeSpan.Zero); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for method, topic for editorconfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we need a consistent rule here? I like to use method expressions if the method contains no real logic, just alternate parameters or for a wrapper.
If we want to always use method bodies, I can revert this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please revert, for methods. This question is out of scope of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to use method expressions if the method contains no real logic, just alternate parameters or for a wrapper.
I like to preserve a placeholder via { }
to add more code inside when a method becomes to not if the method contains no real logic
.
It is more for internal conventions (editorconfig topic), at this time let us be less destructive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I completely get that, it allows for much smaller diffs. I'll try to stick to that convention. The editorconfig PR is updated with the latest thinking btw :)
} | ||
|
||
if (elementReference == null) | ||
if (this.target is IWrapsElement { WrappedElement: IWebDriverObjectReference wrappedElement }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So modernized! I am old-school (I am not alone).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember I used to jump on every modern innovation, and turn code into a mess just to use new features. These days I pick and choose.
I really like the property pattern matching personally, this method is now much shorter.
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Annotates nullable reference types on
InputDevice
and derived types. Implement modernization, simplification, and more XML documentation along the way.Motivation and Context
Contributes to #14640
Types of changes
Checklist
PR Type
enhancement, documentation
Description
Changes walkthrough 📝
InputDevice.cs
Annotate nullable types and modernize InputDevice class
dotnet/src/webdriver/Interactions/InputDevice.cs
DeviceName
.KeyInputDevice.cs
Annotate nullable types and simplify KeyInputDevice
dotnet/src/webdriver/Interactions/KeyInputDevice.cs
PointerInputDevice.cs
Enhance PointerInputDevice with nullable annotations
dotnet/src/webdriver/Interactions/PointerInputDevice.cs
WheelInputDevice.cs
Enhance WheelInputDevice with nullable annotations
dotnet/src/webdriver/Interactions/WheelInputDevice.cs