Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lsp/tailwindcss.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ return {
'app/assets/tailwind/application.css',
}
local fname = vim.api.nvim_buf_get_name(bufnr)
root_files = util.insert_package_json(root_files, 'tailwindcss', fname)
root_files = util.root_markers_with_field(root_files, { 'mix.lock' }, 'tailwind', fname)
on_dir(vim.fs.dirname(vim.fs.find(root_files, { path = fname, upward = true })[1]))
if vim.uv.fs_stat(fname) ~= nil then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a 1-line comment giving a hint

Suggested change
if vim.uv.fs_stat(fname) ~= nil then
-- tailwind lsp behaves poorly if the buffer is not backed by a file. https://github.com/neovim/nvim-lspconfig/pull/3875
if vim.uv.fs_stat(fname) ~= nil then

root_files = util.insert_package_json(root_files, 'tailwindcss', fname)
root_files = util.root_markers_with_field(root_files, { 'mix.lock' }, 'tailwind', fname)
on_dir(vim.fs.dirname(vim.fs.find(root_files, { path = fname, upward = true })[1]))
end
end,
}
Loading