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

Code completion inserts unnecessary tabstops in LSP #2975

Closed
sooxt98 opened this issue Dec 2, 2020 · 7 comments
Closed

Code completion inserts unnecessary tabstops in LSP #2975

sooxt98 opened this issue Dec 2, 2020 · 7 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

@sooxt98
Copy link

sooxt98 commented Dec 2, 2020

Is there a way to disable auto comma before this this get fix?

vscode-flutter-suggesion

@sooxt98 sooxt98 added the is bug label Dec 2, 2020
@DanTup
Copy link
Member

DanTup commented Dec 2, 2020

Can you try adding "editor.suggest.snippetsPreventQuickSuggestions": false, to your VS Code settings, and see if that stops this from happening?

I think it might be being caused by the extra tab-stop.

@DanTup DanTup added the awaiting info Requires more information from the customer to progress label Dec 2, 2020
@sooxt98
Copy link
Author

sooxt98 commented Dec 2, 2020

@DanTup that's quick reply, ya that's magic it fixed

@sooxt98
Copy link
Author

sooxt98 commented Dec 2, 2020

microsoft/vscode#102580

@sooxt98 sooxt98 closed this as completed Dec 2, 2020
@DanTup
Copy link
Member

DanTup commented Dec 2, 2020

Yeah, this is a common complaint. It is on the Dart-Code Recommended Settings page (https://dartcode.org/docs/recommended-settings/).

That said - I want to check whether we can do away with the final tabstop here, as that might prevent it from occurring. In any case, I'd recommend leaving that setting off :-)

@DanTup DanTup reopened this Dec 2, 2020
@DanTup DanTup removed the awaiting info Requires more information from the customer to progress label Dec 2, 2020
@DanTup DanTup added this to the v3.18.0 milestone Dec 2, 2020
@DanTup DanTup added the in editor Relates to code editing or language features label Dec 3, 2020
@DanTup DanTup changed the title intellisense doesnt work with comma Code completion may be inserting unnecessary tabstops Dec 3, 2020
@DanTup DanTup changed the title Code completion may be inserting unnecessary tabstops Code completion inserts unnecessary tabstops in LSP Dec 3, 2020
@DanTup
Copy link
Member

DanTup commented Dec 3, 2020

After some testing, I've decided to leave this as-is. Pre-LSP we would not include the additional tabstop, which meant this would not occur. However, you'd need to use the cursor key to move to after the comma.

In LSP, we have an additional tabstop which allows you to press <tab> after typing the argument value to jump after the tab. It feels slightly easier to hit <tab> than the cursor key to move after this, so I think it's worth keeping, given that we recommend snippetsPreventQuickSuggestions: false anyway.

@DanTup
Copy link
Member

DanTup commented Dec 3, 2020

I've changed my mind. This could affect a lot of people when moving to LSP as it never used to happen. The benefit of using tab is minor, but the annoyance for all users that haven't applied the recommended settings (likely most) is likely greater.

dart-bot pushed a commit to dart-lang/sdk that referenced this issue Dec 3, 2020
Fixes Dart-Code/Dart-Code#2975.

Change-Id: I9c4974c9f04fa10565c831672da067f5b0a2d43f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174926
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
@DanTup
Copy link
Member

DanTup commented Dec 7, 2020

Fixed by dart-lang/sdk@9a82c54, thought won't show up until you're using a new SDK that includes this fix.

@DanTup DanTup closed this as completed Dec 7, 2020
@DanTup DanTup added the in lsp/analysis server Something to be fixed in the Dart analysis server label Dec 7, 2020
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