diff options
author | Christian Chiarulli <[email protected]> | 2021-07-24 21:17:11 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-24 21:17:11 -0400 |
commit | 98f8a77819670ce6012216e01885c135a6d3a289 (patch) | |
tree | b655da889c33e0eb89251878783700a8cd014a27 /lua/lang/css.lua | |
parent | 0884dcd84670bc097c34253e983d2cde9c209dfa (diff) |
New contract (#1080)
Changes to the global config object
O is now lvim
user_plugins is now plugins
user_autocommands is now autocommands
No more lang specific plugins
Null-ls has replaced both formatter.nvim and nvim-lint
Diffstat (limited to 'lua/lang/css.lua')
-rw-r--r-- | lua/lang/css.lua | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/lua/lang/css.lua b/lua/lang/css.lua deleted file mode 100644 index 257896f2..00000000 --- a/lua/lang/css.lua +++ /dev/null @@ -1,77 +0,0 @@ -local M = {} - -M.config = function() - O.lang.css = { - virtual_text = true, - formatter = { - exe = "prettier", - args = {}, - }, - lsp = { - path = DATA_PATH .. "/lspinstall/css/vscode-css/css-language-features/server/dist/node/cssServerMain.js", - }, - } -end - -M.format = function() - vim.cmd "let proj = FindRootDirectory()" - local root_dir = vim.api.nvim_get_var "proj" - - -- use the global prettier if you didn't find the local one - local prettier_instance = root_dir .. "/node_modules/.bin/prettier" - if vim.fn.executable(prettier_instance) ~= 1 then - prettier_instance = O.lang.tsserver.formatter.exe - end - - local ft = vim.bo.filetype - O.formatters.filetype[ft] = { - function() - local args = { "--stdin-filepath", vim.fn.fnameescape(vim.api.nvim_buf_get_name(0)) } - -- TODO: O.lang.[ft].formatter.args - local extend_args = O.lang.css.formatter.args - - for i = 1, #extend_args do - table.insert(args, extend_args[i]) - end - - return { - exe = prettier_instance, - args = args, - stdin = true, - } - end, - } - require("formatter.config").set_defaults { - logging = false, - filetype = O.formatters.filetype, - } -end - -M.lint = function() - -- TODO: implement linters (if applicable) - return "No linters configured!" -end - -M.lsp = function() - if not require("lv-utils").check_lsp_client_active "cssls" then - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities.textDocument.completion.completionItem.snippetSupport = true - -- npm install -g vscode-css-languageserver-bin - require("lspconfig").cssls.setup { - cmd = { - "node", - O.lang.css.lsp.path, - "--stdio", - }, - on_attach = require("lsp").common_on_attach, - capabilities = capabilities, - } - end -end - -M.dap = function() - -- TODO: implement dap - return "No DAP configured!" -end - -return M |