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

Wrapping a widget moves the cursor to the closing bracket #4061

Closed
UCetinkaya94 opened this issue Jul 16, 2022 · 2 comments
Closed

Wrapping a widget moves the cursor to the closing bracket #4061

UCetinkaya94 opened this issue Jul 16, 2022 · 2 comments
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is enhancement
Milestone

Comments

@UCetinkaya94
Copy link

Describe the bug
Wrapping a widget moves the cursor to the closing bracket.

To Reproduce

wrap_widget.mp4

Expected behavior
Wrapping a widget should move the cursor to the opening bracket.

Please complete the following information:

  • Operating System and version: Windows 10 and macOS Big Sur
  • VS Code version: 1.69.1
  • Dart extension version: 3.44.0
  • Dart/Flutter SDK version: 3.0.3
@DanTup DanTup added is enhancement in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server and removed is bug labels Jul 18, 2022
@DanTup
Copy link
Member

DanTup commented Jul 18, 2022

@bwilkerson this sounds reasonable to me and would be a fairly simple fix. Although the cursor defaulting to the end of the string may be LSP-specific (there is an implicit final tabstop at the end of any snippet if there isn't an explicit one) so I don't know how adding a selection offset to the edit may affect other clients. Any thoughts?

The change I would propose is something like this:

Screenshot 2022-07-18 at 14 07 33

@bwilkerson
Copy link

The same assist in IntelliJ currently leaves the cursor at the same offset as before the edit was applied, so adding a reasonable selection point seems like a win there as well.

@DanTup DanTup added this to the v3.46.0 milestone Jul 18, 2022
@DanTup DanTup modified the milestones: v3.46.0, v3.48.0 Jul 18, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is enhancement
Projects
None yet
Development

No branches or pull requests

3 participants