Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

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

Open
cnshenj opened this issue Apr 16, 2018 · 3 comments

Comments

@cnshenj
Copy link

cnshenj commented Apr 16, 2018

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.

@peabnuts123
Copy link

This is pretty much essential for a formatting extension

@chipco
Copy link

chipco commented Aug 17, 2018

@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
Copy link

akelsch commented May 5, 2019

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 🙏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants