Open
Description
We should have a command called something like :CodefmtInfo
that can dump a report on how it's configured wrt the current context and maybe the last known invocation.
For example:
:CodefmtInfo
Current buffer: foo.py
Autoformat [enabled|disabled] [using formatter yapf]
Selected formatter: [yapf]
All available formatters: yapf, black, isort, autopep8
Last invocation at [TIMESTAMP]:
Executed command: yapf -blah ...
Exit code: [0|...]
[Stderr: ...]
Activity
dbarnett commentedon Jan 8, 2024
As a workaround in the meantime, here's a dump of some commands to manually look up some of this info:
:let b:codefmt_<TAB>
to check for any buffer-local settings:autocmd codefmt
:let b:codefmt_formatter
:echo codefmt#GetSupportedFormatters(0, 0, 0)
-V9vim.log
before running formatter, then after triggering the formatter search vim.log for "Executing command".Note: Signature of
codefmt#GetSupportedFormatters
is weird and will probably change eventually, try:echo codefmt#GetSupportedFormatters()
or variations on that if you get "Too many arguments".dbarnett commentedon Jan 8, 2024
Also for general troubleshooting, check
:messages
for any errors you might've missed, especially things likeNot an editor command
that might've tripped up autocmds etc.