diff options
| author | Nawfal bin Mohmad Rouyan <[email protected]> | 2021-04-01 15:29:52 +0800 | 
|---|---|---|
| committer | GitHub <[email protected]> | 2021-04-01 03:29:52 -0400 | 
| commit | c2a937b622e61309f7b40361d6b85494c578a452 (patch) | |
| tree | 2f844a6c28b18889ed07696dd8c54ca7fdf8f1bc /lua/lsp | |
| parent | 225266e1b3da7c888287ad0da05cf28782a17833 (diff) | |
Add tailwindcss lsp support (#205)
Diffstat (limited to 'lua/lsp')
| -rw-r--r-- | lua/lsp/tailwindcss-ls.lua | 21 | 
1 files changed, 21 insertions, 0 deletions
| diff --git a/lua/lsp/tailwindcss-ls.lua b/lua/lsp/tailwindcss-ls.lua new file mode 100644 index 00000000..0bc5d80a --- /dev/null +++ b/lua/lsp/tailwindcss-ls.lua @@ -0,0 +1,21 @@ +local lspconfig = require 'lspconfig' +local configs = require 'lspconfig/configs' + +-- Check if tailwindls server already defined. +if not lspconfig.tailwindls then configs['tailwindls'] = {default_config = {}} end + +lspconfig.tailwindls.setup { +    cmd = { +        "node", DATA_PATH .. "/lspinstall/tailwindcss/tailwindcss-intellisense/extension/dist/server/index.js", +        "--stdio" +    }, +    filetypes = O.tailwindls.filetypes, +    root_dir = require('lspconfig/util').root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"), +    handlers = { +        ["tailwindcss/getConfiguration"] = function(_, _, params, _, bufnr, _) +            -- tailwindcss lang server waits for this repsonse before providing hover +            vim.lsp.buf_notify(bufnr, "tailwindcss/getConfigurationResponse", {_id = params._id}) +        end +    }, +    on_attach = require'lsp'.common_on_attach +} | 
