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

"Wrap with widget" does not move the text cursor to the new parent widget when the 'previewLsp' setting is enabled #3143

Closed
doppio opened this issue Feb 15, 2021 · 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 bug
Milestone

Comments

@doppio
Copy link

doppio commented Feb 15, 2021

Describe the bug
Normally, when the context menu is used to "Wrap with widget...", the cursor automatically selects the new "widget" text so the user can immediately type the name of the new parent widget. However, when the "previewLsp" setting is enabled, the cursor does not move from where it was when the context menu was invoked.

To Reproduce
Steps to reproduce the behavior:

  1. Enable the "previewLsp" setting
  2. Move the text cursor to a widget name
  3. Open the context menu (Ctrl + .)
  4. Select "Wrap with widget..."

Expected behavior
The text cursor should immediately select the newly added "widget" text.

Versions (please complete the following information):

  • VS Code version: 1.53.2
  • Dart extension version: 3.19.2
  • Dart/Flutter SDK version: Dart 2.12.0, Flutter 1.26.0-17.5.pre
@doppio doppio added the is bug label Feb 15, 2021
@DanTup
Copy link
Member

DanTup commented Feb 16, 2021

I looked into this, and re-discovered that it's because LSP has no support for code snippets (required to set cursor positions) in code actions. This might be a result of VS Code not having a good API for this either (the way it works in non-LSP involves custom code to apply the edit that is not trivial for LSP).

The relevant LSP issues are at:

@DanTup DanTup added the blocked on vs code / lsp / dap Requires a change in VS Code to progress label Feb 16, 2021
@DanTup DanTup added this to the Backlog milestone Feb 16, 2021
@DanTup DanTup added in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server labels Feb 16, 2021
@DanTup DanTup removed the blocked on vs code / lsp / dap Requires a change in VS Code to progress label Mar 16, 2021
@DanTup DanTup modified the milestones: Backlog, v3.21.0 Mar 16, 2021
DanTup added a commit that referenced this issue Mar 16, 2021
DanTup added a commit that referenced this issue Mar 24, 2021
DanTup added a commit that referenced this issue Mar 24, 2021
@DanTup
Copy link
Member

DanTup commented Mar 24, 2021

This is fixed by #3215.

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 bug
Projects
None yet
Development

No branches or pull requests

2 participants