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
Add usings on paste #48501
Add usings on paste #48501
Changes from 20 commits
2568592
0091ea7
df94296
493b1b3
59ea5b0
152c6c4
3873ece
27d5d86
97ac747
0524931
5f61773
97f4015
d8f65bf
fe5ee18
166f67d
941bdb9
1e6b5ab
7b9804d
ec24927
a515b46
ec66018
f3581a3
b425c0a
37fd002
bce4b47
78a0270
0c61992
44ca881
898f074
4c43c6a
8567a39
4bbf76f
aaae96c
2bc116a
c33060a
4428713
279d531
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.
this means we don't support this for razor. is that ok?
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 think it's fine for now. I'll follow up with razor folks to see if it is something they want enabled.
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 don't totally see the beneift of extracting this method. why not just have it be in Execute?
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.
It helps me mentally break apart the goal of execute, which is to do/not do
something
. Thatsomething
is this method call. I don't feel strongly if it's blocker, but it does add value to my understanding of the code when I reread it.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.
sorry, github doesn't show me these items. They're in a collapsed block, and they don't appear when i'm in the 'files' portoin of the review (where i do 100% of my reviewing).
In this case, the major issue i see is that the split doesn't actually make sense. I agree that the split should be
which is to do/not do something.
. However, that's not the split here. For example, despite callingAddMissingImportsForPaste
, there are still several more checks that are done which cause the missing imports to not be added. If you change it so that all the bail out checks are done frst, and then extract the code to actually add the imports, that would make a lot more sense to me. Thanks!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.
can you clarify why we still need the PasteTrackingCommandHandler if we have your new feature?
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.
If a user has this feature disabled, then we still want to provide a fix that they can use.
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.
Should we then have the features flip/flop? in essence, if you have 'add imports on paste', then this would be disabled, and vice versa?
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.
comment still applies. do we still want both running at the same time? just trying to get some clarity on the overall design. i do think we should possibly have the features flip. so if add-import-on-paste is on, then we disable the other feature. thoughts?
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 want both of these available for now. Even if the command is enabled for usings on paste, if the user cancels then presenting the option after may still be useful. If the command does execute and usings are added, it should be very little overhead to determine that there are no missing usings that need to be added.
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 isn't accurate as per the method name. All this is saying is are we on the root buffer or not? Other examples that trigger this would be just a normal razor projection view.
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 is the same hack that was used in inline parameter hints (where I got the code from), I just moved it to be shared so at least we're all being hacky in the same way. The name/comment came from there. Do you know a better way? Better name?
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.
see above for better name.
note: this won't work for razor.
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 the previous comment (which you actually reviewed iirc :P) was wrong? That's fine. I just don't think a name like
IsRootBuffer
is meaningful to intent. Instead it just tells me what the line of code is, and acts like a needless comment. The intent of the code was to check that we weren't performing these actions on the interactive window. Again, is there a better way to check that we're in the interactive window?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'm not sure. @tmat may know.
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 i'm ok with this helper. but we should just basically say "IsNotSurfaceBufferOfTextView" to at least be honest about what it is doing.
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.
IsNotSurfaceBufferOfTextView
seems fine to me, I'll rename.