I am probably not the only one using biome in neovim (with neovim’s lsp), so I figure i’m probably not the only person that has run into this issue. So I thought i might as well share this in case someone else embarks on their own journey trying to get biome to not run into race conditions running both fixing and formatting at the same time as an on-save hook, in the hopes that they find this before banging their heads into their mechanical keyboards.

The problem:

Say you have this piece of code in your neovim lsp stuff (for biome)

function format_and_fix(event)
local bufnr = event.buf
local clients = vim.lsp.get_active_clients({ bufnr = bufnr })
for _, client in ipairs(clients) do
local name = client.name

-- format client filter, to only format items for one single client, ...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help