From 7cd58b1228749f72a81ba84c265cafafe47fa5a6 Mon Sep 17 00:00:00 2001 From: PZ31k0nauT <86895284+PZ31k0nauT@users.noreply.github.com> Date: Sun, 4 Jul 2021 18:50:38 +0200 Subject: Basics for php lsp (#664) * Update php.lua * Update default-config.lua * Update lv-config.example.lua --- ftplugin/php.lua | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'ftplugin/php.lua') diff --git a/ftplugin/php.lua b/ftplugin/php.lua index abc90092..b571a213 100644 --- a/ftplugin/php.lua +++ b/ftplugin/php.lua @@ -1,4 +1,25 @@ require'lspconfig'.intelephense.setup { cmd = { DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense", "--stdio" }, - on_attach = require'lsp'.common_on_attach -} \ No newline at end of file + 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 + }, + } + }; +} -- cgit v1.2.3 From 9f511bcb594b7e2461c97cb8182603928c773c2f Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 4 Jul 2021 22:14:01 -0300 Subject: start formatting rules --- ftplugin/php.lua | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) (limited to 'ftplugin/php.lua') diff --git a/ftplugin/php.lua b/ftplugin/php.lua index b571a213..4dc8e9e0 100644 --- a/ftplugin/php.lua +++ b/ftplugin/php.lua @@ -1,25 +1,23 @@ -require'lspconfig'.intelephense.setup { - cmd = { DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense", "--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 - - }) +require("lspconfig").intelephense.setup { + cmd = { DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense", "--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, + }, }, - filetypes = O.lang.php.filetypes, - settings = { - intelephense = { - format = { - braces = O.lang.php.format.braces - }, - environment = { - phpVersion = O.lang.php.environment.php_version - }, - } - }; + }, } -- cgit v1.2.3