How do you determine which formatter is being used for VS Code?

CTS_AE
:

If you have multiple extensions installed how do you determine which formatter is running on your document?

For instance I have a couple of HTML extensions that may format HTML but I'm not sure which one is actually formatting, or if multiple are. I'm not even sure which extensions may be contributing to the formatting honestly. Recently auto formatting in HTML and CSS have changed how they're formatting in ways that I do not care for, and I would like to know which extension is doing this so I may be able to change configuration or disable the extension. Currently I have something like 80-90 extensions so going through one by one is a ridiculously timely process that I would like to stay away from if there is a programmatic way of determining this. It seems that extensions have to register with the formatting service so that they can do their auto formatting, but I'm not sure if there's a way to debug, hook, or view those.

Gama11
:

Starting with the 1.33 release (March 2019), attempting to format a file for which there are multiple formatters registered results in a popup like this:

Note that the notification is "silent" if formatting happened implicitly via "format on save" or "format on paste", meaning that you need to click the bell in the lower right for it to show up:

The Configure... menu then lists all the formatters available for the current language. One of them can be selected as a default formatter for Format Document and Format Selection:

Picking for instance "Prettier" here results in this being added to the global settings.json:

"[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
}

There are also two new commands for formatting a file with a specific formatter, Format Document With... and Format Selection With.... This can be useful for formatting a specific file with a formatter that's not set as the default formatter. The former is also available from the context menu:

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

VBA how to determine which application is being used

From Dev

VBA how to determine which application is being used

From Dev

How do you determine which layout was last used by an activity that switches between multiple layouts?

From Dev

How do you determine which SKSpriteNode was clicked?

From Dev

How do I determine which code coverage tool was used in Sonarqube analyses?

From Dev

Determine which arraylist is currently being used?

From Dev

How do you determine the exception being thrown by MkDir?

From Dev

How to determine which xcode was used to develop from code

From Dev

How to determine which xcode was used to develop from code

From Dev

How do I check which variable in a collection is being used?

From Dev

How do I make it obvious which Firefox Profile is being used?

From Dev

How do I find out which touchpad driver is being used?

From Dev

How do you use a custom font on Strings that are being used in a RecyclerView?

From Dev

Ubuntu vs Debian: how do I determine which OS to use?

From Dev

How can I determine which Windows DLL is being used for a function call?

From Dev

How do you manually remove VS Code?

From Dev

How to debug VSIX extension in VS which is of other version then version of VS SDK being used

From Dev

How to determine which script is being executed by bash?

From Dev

How do you determine which theme you are on when ZSH_THEME="random"

From Dev

How do you determine which theme you are on when ZSH_THEME="random"

From Dev

How do I determine the outgoing port being used by SSH after connecting?

From Dev

How to determine which grid option is currently used

From Dev

How to determine which authentication method is used?

From Dev

How to determine which version of HTML is used?

From Java

How do you format code on save in VS Code

From Dev

Qt Creator in Windows - How do I know which compiler is being used?

From Dev

How do I know connected socket.io client which transport is being used websocket or polling?

From Dev

When installing packages (particularly those with graphical UIs) how do you determine which is fitting for your distribution?

From Dev

determine which packages are used

Related Related

  1. 1

    VBA how to determine which application is being used

  2. 2

    VBA how to determine which application is being used

  3. 3

    How do you determine which layout was last used by an activity that switches between multiple layouts?

  4. 4

    How do you determine which SKSpriteNode was clicked?

  5. 5

    How do I determine which code coverage tool was used in Sonarqube analyses?

  6. 6

    Determine which arraylist is currently being used?

  7. 7

    How do you determine the exception being thrown by MkDir?

  8. 8

    How to determine which xcode was used to develop from code

  9. 9

    How to determine which xcode was used to develop from code

  10. 10

    How do I check which variable in a collection is being used?

  11. 11

    How do I make it obvious which Firefox Profile is being used?

  12. 12

    How do I find out which touchpad driver is being used?

  13. 13

    How do you use a custom font on Strings that are being used in a RecyclerView?

  14. 14

    Ubuntu vs Debian: how do I determine which OS to use?

  15. 15

    How can I determine which Windows DLL is being used for a function call?

  16. 16

    How do you manually remove VS Code?

  17. 17

    How to debug VSIX extension in VS which is of other version then version of VS SDK being used

  18. 18

    How to determine which script is being executed by bash?

  19. 19

    How do you determine which theme you are on when ZSH_THEME="random"

  20. 20

    How do you determine which theme you are on when ZSH_THEME="random"

  21. 21

    How do I determine the outgoing port being used by SSH after connecting?

  22. 22

    How to determine which grid option is currently used

  23. 23

    How to determine which authentication method is used?

  24. 24

    How to determine which version of HTML is used?

  25. 25

    How do you format code on save in VS Code

  26. 26

    Qt Creator in Windows - How do I know which compiler is being used?

  27. 27

    How do I know connected socket.io client which transport is being used websocket or polling?

  28. 28

    When installing packages (particularly those with graphical UIs) how do you determine which is fitting for your distribution?

  29. 29

    determine which packages are used

HotTag

Archive