mrmlnc / vscode-csscomb

:electric_plug: VS Code plugin for CSScomb — CSS coding style formatter.
https://goo.gl/lKARa5
MIT License
65 stars 11 forks source link

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

Open cnshenj opened 6 years ago

cnshenj commented 6 years ago

Environment

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.

peabnuts123 commented 6 years ago

This is pretty much essential for a formatting extension

chipco commented 6 years ago

@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

akelsch commented 5 years ago

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 🙏