Skip to content

Enabling formatOnSave doesn't cause formatting provider to be invoked during save #13690

@DanTup

Description

@DanTup
  • VSCode Version: 1.6.0
  • OS Version: Windows 10

Steps to Reproduce:

  1. Install Dart-Code
  2. Add "editor.formatOnSave": true to user options
  3. Type some Dart into a dart file
  4. Press Alt+Shift+F and observe formatting work
  5. Insert some whitespace
  6. Press Ctrl+S

Formatting works fine when I invoke it directly, but provideDocumentFormattingEdits never gets called when I press Save.

It works fine for JSON files, so I presume there's something specific about my extension, but I can't find anything in the docs suggesting I need to do anything specific to enable this?

I'm registering my formatter on activation like this:

context.subscriptions.push(vs.languages.registerDocumentFormattingEditProvider(DART_MODE, new DartFormattingEditProvider(analyzer)));

I've got a breakpoint in the first line of provideDocumentFormattingEdits but it never seems to trigger (full code for this file is here).

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugformattingSource formatter issuesverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions