aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Fraser <stuart@studiousonline.com>2025-07-04 02:51:41 +1000
committerGitHub <noreply@github.com>2025-07-03 09:51:41 -0700
commit1ddc1a2e692b120cda6d33c890461e49cb85d6bf (patch)
tree31c7a7b8dd97029f163f6aa55fb250c51c5cb1b1
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-1ddc1a2e692b120cda6d33c890461e49cb85d6bf.tar
nvim-lspconfig-1ddc1a2e692b120cda6d33c890461e49cb85d6bf.tar.gz
nvim-lspconfig-1ddc1a2e692b120cda6d33c890461e49cb85d6bf.tar.bz2
nvim-lspconfig-1ddc1a2e692b120cda6d33c890461e49cb85d6bf.tar.lz
nvim-lspconfig-1ddc1a2e692b120cda6d33c890461e49cb85d6bf.tar.xz
nvim-lspconfig-1ddc1a2e692b120cda6d33c890461e49cb85d6bf.tar.zst
nvim-lspconfig-1ddc1a2e692b120cda6d33c890461e49cb85d6bf.zip
feat(tailwindcss): root_dir for rails/phoenix #3935
The location of the config in Rails and Phoenix does not represent the root of the project. We can look inside mix.lock and Gemfile.lock for the existence of tailwind, which guarantees that it's the root.
-rw-r--r--lsp/tailwindcss.lua10
1 files changed, 1 insertions, 9 deletions
diff --git a/lsp/tailwindcss.lua b/lsp/tailwindcss.lua
index 7aa99ade..cba3b642 100644
--- a/lsp/tailwindcss.lua
+++ b/lsp/tailwindcss.lua
@@ -117,24 +117,16 @@ return {
'postcss.config.cjs',
'postcss.config.mjs',
'postcss.config.ts',
- -- Phoenix
- 'assets/tailwind.config.js',
- 'assets/tailwind.config.cjs',
- 'assets/tailwind.config.mjs',
- 'assets/tailwind.config.ts',
-- Django
'theme/static_src/tailwind.config.js',
'theme/static_src/tailwind.config.cjs',
'theme/static_src/tailwind.config.mjs',
'theme/static_src/tailwind.config.ts',
'theme/static_src/postcss.config.js',
- -- Rails
- 'app/assets/stylesheets/application.tailwind.css',
- '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)
+ root_files = util.root_markers_with_field(root_files, { 'mix.lock', 'Gemfile.lock' }, 'tailwind', fname)
on_dir(vim.fs.dirname(vim.fs.find(root_files, { path = fname, upward = true })[1]))
end,
}