Dart-code: Support "format selection" [LSP]

Created on 17 Apr 2018  ·  4Comments  ·  Source: Dart-Code/Dart-Code

When I use the vim command =, it throws the error There is no formatter for 'dart'-files installed.

VSCode Version 1.22.2 (1.22.2)
Dart Code Version 2.11.2

in editor in lsanalysis server is enhancement

Most helpful comment

Seems like we actually don't have an open issue about this as a reminder, so I'm re-opening this and re-purposing it. If/when the above case is done, we will implement this (and in the meantime, this case can serve as a reminder of something we want to do but are blocked on).

All 4 comments

I can't find any information on what the vim command = is supposed to do - can you provide more info about this? (I think a VsCodeVim extension, but I can't find any docs suggesting that = is related to formatting).

If you click Format Document in the context menu, does that work? If so, my guesses are:

  1. Something is buggy with the vim extension
  2. It's trying to format a selection, which isn't supported by Dart (requires https://github.com/dart-lang/dart_style/issues/92)

= if used in vim for formatting though it is required to choose a selection (the selection can be the entire file with gg=G [go to top of file, format until bottom]). Format document does work, so it is safe to assume this is related to dart-lang/dart_style#92 . Safe to assume we can close this then as it's basically a duplicate.

Seems like we actually don't have an open issue about this as a reminder, so I'm re-opening this and re-purposing it. If/when the above case is done, we will implement this (and in the meantime, this case can serve as a reminder of something we want to do but are blocked on).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FeimiSzy picture FeimiSzy  ·  4Comments

kinex picture kinex  ·  3Comments

DanTup picture DanTup  ·  4Comments

rgb1380 picture rgb1380  ·  3Comments

ifredom picture ifredom  ·  3Comments