问题
Any clues on why my VS Code "Format Code" command doesn't work? I used Shift+Ctrl+P and entered Format Code or used the shortcut Shift + Alt + F. None seem to be working. Any clue?
回答1:
i'm having the same issue - it's looks like a bug.
See:
- https://github.com/Microsoft/vscode/issues/12359
- https://github.com/Microsoft/vscode/issues/12705
- https://github.com/Microsoft/TypeScript/issues/11101
回答2:
Make sure you changed your language to the type of file. (Ctrl+K,M or Ctrl+Shift+P -> Change Language Mode)
回答3:
If you have an error in your code, the formatting will not allow you to change the layout. Fix any bugs you have (if you have any of course) then try shift + alt + f.
来源:https://stackoverflow.com/questions/39776691/vs-code-format-code-command-and-shortcut-shiftaltf-doesnt-work