mdformat icon indicating copy to clipboard operation
mdformat copied to clipboard

Suggestion: VS Code Extension

Open bittorala opened this issue 7 months ago • 0 comments

Hello,

First of all, thank you for developing this magnificent tool. It has proven very useful for me, and I am in the process of encouraging my colleagues to use it. To do so, it would be incredibly helpful to have this formatter available as a VS Code Extension.

Since I have not found it in the VS Code Extensions Marketplace, I have set out to create a very simple extension that lets users use mdformat. It is not a full-fledged LSP implementation like vscode-black-formatter, but rather it simply registers a formatter with user settings for the mdformat options, and runs python -m mdformat with the args to format the documents, selecting the Python binary from (in descending priority):

  1. User-defined mdformat.pythonPath setting.
  2. Python interpreter selected via ms-python.python extension.
  3. Common global executables found in the system PATH.

It really is a tiny extension but it can help a lot by making this super nice tool more accessible to a very wide pool of developers. And if need be, the full-fledged LSP version might be implementable in the future.

The topics I wanted to address in this issue were:

  • Do you mind if I go ahead and publish this extension? I would mark it as Unofficial in its description and refrain from using the logo, if you prefer so.
  • Do you have any comments or concerns that I should take into account before going ahead and releasing this?

bittorala avatar Jun 09 '25 08:06 bittorala