Skip to content

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

Closed

Description

@UCetinkaya94

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

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    and removed on Jul 18, 2022
  2. DanTup commented on Jul 18, 2022

    @DanTup
    Member

    @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

  3. bwilkerson commented on Jul 18, 2022

    @bwilkerson

    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.

  4. added this to the v3.46.0 milestone on Jul 18, 2022
  5. modified the milestones: v3.46.0, v3.48.0 on Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions