-
Notifications
You must be signed in to change notification settings - Fork 248
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Neovim version (nvim -v)
v0.10.0-dev-2048+g367e52cc7
Operating system/version
Linux
Add the debug logs
- I have set
log_level = vim.log.levels.DEBUGand pasted the log contents below.
Log file
[DEBUG] Running formatters on /.../Foo.sol: {}
[DEBUG] No formatters found for /.../Foo.sol
Describe the bug
Being it so that no conform formatters are present its formatexpr should be returning 1 so that it may fallback to the next available formatter.
What is the severity of this bug?
breaking (some functionality is broken)
Steps To Reproduce
Open file without formatters. E.g. a Solidity file (*.sol).
Additional context
It used to work, so not sure when it exactly broke. This is the custom formatexpr that I've been using so far:
Formatexpr = function()
local timeout_ms = 10000
local n = require('conform').formatexpr({ timeout_ms = timeout_ms })
if n == 0 then
return 0
end
local whole_buffer_selected = vim.v.count == vim.fn.line('$')
if whole_buffer_selected and supports_buffer_formatting() then
-- Execute LSP buffer format (useful for those LSPs which don't support range formatting)
vim.lsp.buf.format({ timeout_ms = timeout_ms })
return 0
end
-- Fallback
return 1
endMetadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working