php.lua 812 B

123456789101112131415161718192021222324252627
  1. if require("lv-utils").check_lsp_client_active "intelephense" then
  2. return
  3. end
  4. require("lspconfig").intelephense.setup {
  5. cmd = { DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense", "--stdio" },
  6. on_attach = require("lsp").common_on_attach,
  7. handlers = {
  8. ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
  9. virtual_text = O.lang.php.diagnostics.virtual_text,
  10. signs = O.lang.php.diagnostics.signs,
  11. underline = O.lang.php.diagnostics.underline,
  12. update_in_insert = true,
  13. }),
  14. },
  15. filetypes = O.lang.php.filetypes,
  16. settings = {
  17. intelephense = {
  18. format = {
  19. braces = O.lang.php.format.braces,
  20. },
  21. environment = {
  22. phpVersion = O.lang.php.environment.php_version,
  23. },
  24. },
  25. },
  26. }