Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Cohost document highlighting #10656
Cohost document highlighting #10656
Changes from 8 commits
e47b5c6
e6a914d
1ebf1de
6831461
626a8ab
31936ef
fb77765
97c0acd
1371cb5
761afd2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 love elevating this concept so that any service can use it. I have a few ideas and thoughts that you can take or leave:
Data
or something else is a better name. To me, the wordsResult
andResponse
are bit too close semantically and are pretty much interchangeable.T : class
constraint?HasData
and/orTryGetData(...)
APIs. IfT
is constrained toclass
, declareData
asT?
and then add[MemberNotNullWhen(true, Data)]
toHasData
and[NotNullWhen(true)]
toTryGetData
.StopHandling
feels a little awkward to "handle" on the client side. I wonder if there's a better name or combination of signals. In general, it feels strange that the remote service would have so much knowledge about what the client does with the response. It also feels a bit odd to me that aRemoteResponse
might have aResult
andStopHandling == false
. I don't have any great suggestions, so please don't make any changes related to this unless you have better ideas. However, I suggest that we keep thinking on this logic.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.
This type is the epitomy of "naming is hard". Trying to work out names for the parameters, and the helper properties, that didn't clash and meant something etc. I do not disagree with any of your feedback.
I'd like to re-use part of this PR in the inlay hint work I'm currently doing though, so if you don't mind I think I'll merge this as is, but will do another pass on this class specifically in a separate PR. I think making it not a record might be the key, so we can separate out consructor params, properties etc. and allow some more nuance in these.
I will say for your item number 2, at the moment no, the first use of this was with Roslyn's
TextChange
which is a struct. It certainly would have made the nullability bits easier though :)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 have no problem with merging this as is. I just wanted to write my thoughts down. We can definitely get back to them later as we go.