Skip to content
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

Fixed prop snippet caret position #64732

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

DoctorKrolic
Copy link
Contributor

Fixes: #64731

@akhera99 I don't know why you've chosen that cursor position in the first place, but I have 2 arguments for this one:

  1. It matches end caret position of legacy non-semantic snippet variant
  2. It has a benifit of being able to press Enter and jump to new line without need to move cursor with your mouse or keyboard. At the same time I don't see any clear benifits from position you've chosen

@DoctorKrolic DoctorKrolic requested a review from a team as a code owner October 14, 2022 11:28
@ghost ghost added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Oct 14, 2022
Copy link
Member

@genlu genlu left a comment

Choose a reason for hiding this comment

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

Thanks! This change makes sense to me. But @akhera99 should confirm in case current behavior is intentional.

Copy link
Member

@akhera99 akhera99 left a comment

Choose a reason for hiding this comment

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

I kept the caret there so users would be able to modify the get and set, but if it makes more sense to users to have it at the end of the property, then I'm okay with that

@DoctorKrolic
Copy link
Contributor Author

modify the get and set

Considering that they are not highlighted to be modifiered, user still needs a lot of keybord/mouse actions to edit them. At the same time, as I already described above, having caret at the end of line enables the ability to quickly jump to the next line, which is really useful

@CyrusNajmabadi
Copy link
Member

What is our current behavior? I'd prefer we preserve whatever we've shipped before so we don't end up frustrating people with a new experience that behaves differently from what they've gotten used to. Perhaps we can add a new tab-stop though at the end of the prop for people who are willing to hit tab one more time?

@DoctorKrolic
Copy link
Contributor Author

Old behaviour:

public [|int|] [|MyProperty|] { get; set; }$$

New behaviour before this fix:

public [|int|] [|MyProperty|] {$$ get; set; }

New behaviour after this fix:

public [|int|] [|MyProperty|] { get; set; }$$

I guess, we can merge since I aligned new behaviour with the old one

@akhera99 akhera99 merged commit 048f695 into dotnet:main Oct 17, 2022
@ghost ghost added this to the Next milestone Oct 17, 2022
@akhera99
Copy link
Member

@DoctorKrolic thanks for the contribution!

@DoctorKrolic DoctorKrolic deleted the fix-prop-caret-position branch October 17, 2022 19:30
@RikkiGibson RikkiGibson modified the milestones: Next, 17.5 P1 Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee. OnDeckForServicing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New prop semantic snippet doesn't place cursor where expected
6 participants