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/php.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/php.lua')
-rw-r--r-- | lua/lang/php.lua | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/lua/lang/php.lua b/lua/lang/php.lua deleted file mode 100644 index 632c4052..00000000 --- a/lua/lang/php.lua +++ /dev/null @@ -1,88 +0,0 @@ -local M = {} - -M.config = function() - O.lang.php = { - format = { - format = { - default = "psr12", - }, - }, - environment = { - php_version = "7.4", - }, - diagnostics = { - virtual_text = { spacing = 0, prefix = "ï„‘" }, - signs = true, - underline = true, - }, - filetypes = { "php", "phtml" }, - formatter = { - exe = "phpcbf", - args = { "--standard=PSR12", vim.api.nvim_buf_get_name(0) }, - stdin = false, - }, - lsp = { - path = DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense", - }, - } -end - -M.format = function() - O.formatters.filetype["php"] = { - function() - return { - exe = O.lang.php.formatter.exe, - args = O.lang.php.formatter.args, - stdin = O.lang.php.formatter.stdin, - tempfile_prefix = ".formatter", - } - 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 require("lv-utils").check_lsp_client_active "intelephense" then - return - end - - require("lspconfig").intelephense.setup { - cmd = { O.lang.php.lsp.path, "--stdio" }, - on_attach = require("lsp").common_on_attach, - handlers = { - ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = O.lang.php.diagnostics.virtual_text, - signs = O.lang.php.diagnostics.signs, - underline = O.lang.php.diagnostics.underline, - update_in_insert = true, - }), - }, - filetypes = O.lang.php.filetypes, - settings = { - intelephense = { - format = { - braces = O.lang.php.format.braces, - }, - environment = { - phpVersion = O.lang.php.environment.php_version, - }, - }, - }, - } -end - -M.dap = function() - -- TODO: implement dap - return "No DAP configured!" -end - -return M |