vscode-csscomb icon indicating copy to clipboard operation
vscode-csscomb copied to clipboard

Register csscomb as a formatter so the default "Format Document" command will work

Open cnshenj opened this issue 7 years ago • 3 comments

Environment

  • VSCode Version: 1.22.2
  • vscode-csscomb version: 5.2.2

Steps to reproduce

In a LESS file, either use command palette to invoke "Format Document" command or press the default shortcut key Shift+Alt+F.

Actual behavior

There is no formatter for 'less`-files installed.

Expected behavior

Format LESS using CSScomb

Note

Users can register a different keybinding for CSScomb. But then it is not consistent with other formatters, and users have to remember to use a different keybinding when in CSS/LESS files.

cnshenj avatar Apr 16 '18 18:04 cnshenj

This is pretty much essential for a formatting extension

peabnuts123 avatar Jul 02 '18 21:07 peabnuts123

@mrmlnc check out Language Server Protocol to register for document formatting https://code.visualstudio.com/docs/extensionAPI/language-support#_format-source-code-in-an-editor

chipco avatar Aug 17 '18 09:08 chipco

According to the documentation, the extension has to be registered using vscode.languages.registerDocumentFormattingEditProvider('css', {...}); in extension.ts.

Unfortunately I have no experience in VS Code extension development but it looks like it should be fairly manageable. It's a shame that the plugin is listed in the "Formatters" category but doesn't actually provide one.

Please look into it @mrmlnc 🙏

akelsch avatar May 05 '19 16:05 akelsch