From kwrite-devel Tue Feb 13 09:47:38 2024 From: =?ISO-8859-1?Q?K=E5re_S=E4rs?= Date: Tue, 13 Feb 2024 09:47:38 +0000 To: kwrite-devel Subject: Re: PHP code validation Message-Id: <2205326.irdbgypaU6 () insta-precision3580> X-MARC-Message: https://marc.info/?l=kwrite-devel&m=170781758615693 On tisdag 13 februari 2024 11:02:54 EET Marc Serra wrote: > I have sung victory too soon :( >=20 > phpactor works for local files but no for sftp development [1] >=20 > I also tried the other Language Servers listed in > https://langserver.org/, but not with optimal results... >=20 > php language server [2] -> requires php7.1 and my workstation and > development must use php8.1 > serenata [3] -> requires php7.1 and my workstation and development > must use php8.1 > crane [4] -> seems discountinued (latest version is more than 7 years old) > psalm [5] -> I cannot get it working to test it :( >=20 > Any ideas? >=20 > My requirements are not too complicated. I want to develop little PHP > projects with kate with SSH (SFTP), code linting and code auto > indentation. > The problem is probably that Language Server cannot access the files and=20 environment where the files are on the remote server. I think the easiest way to get that remote project running might be to moun= t=20 the folder somehow. Like for example with "sshfs remote.server/path local/ path". That gives the local LS a chance to read the files. /K=C3=A5re =20 > Thank's! >=20 > [1] https://github.com/phpactor/phpactor/discussions/2544 > [2] https://github.com/felixfbecker/php-language-server > [3] https://gitlab.com/Serenata/Serenata > [4] https://github.com/HvyIndustries/crane/tree/master/server > [5] https://github.com/vimeo/psalm >=20 > Missatge de Marc Serra del dia dt., 13 de febr. >=20 > 2024 a les 8:47: > > Finally I got linting for PHP code on Kate working! > >=20 > > I installed phpactor [1] on my workstation and added this lines to > > ~/.config/kate/Ispclient/settings.json > >=20 > > { > >=20 > > "servers": { > > =20 > > "php": { > > =20 > > "command": ["phpactor", "language-server"], > > "rootIndicationFileNames": ["composer.json", "composer.lock= "], > > "url": "https://github.com/phpactor/phpactor", > > "highlightingModeRegex": "^PHP.*$" > > =20 > > } > > =20 > > } > >=20 > > } > >=20 > > Thank's for your guidance and thank's to all Kate developers! > >=20 > >=20 > > [1] https://github.com/phpactor/phpactor > >=20 > >=20 > > Missatge de Marc Serra del dia dl., 12 de febr. > >=20 > > 2024 a les 12:29: > > > Thank's for your quick answer, > > >=20 > > > I'm new to LSP. > > >=20 > > > I can see some LSP servers on kate options, but not a default PHP > > > server. > > >=20 > > > Is there some PHP LSP server online? line for bash ... > > >=20 > > > "bash": { > > >=20 > > > "command": ["bash-language-server", "start"], > > >=20 > > > "root": "", > > >=20 > > > "url": "https://github.com/bash-lsp/bash-language-server", > > >=20 > > > "highlightingModeRegex": "^Bash$" > > >=20 > > > } > > >=20 > > >=20 > > > Or I must install a LSP PHP server on my own server? > > >=20 > > >=20 > > > Thank's > > >=20 > > > Missatge de Waqar Ahmed del dia dl., 12 de febr= =2E=20 2024 a les 12:11: > > >> If you use a php language server that supports linting php code, then > > >> yes. We have a language server plugin that can be used for > > >> intellisense and other helpful features. See: - > > >> https://langserver.org/ > > >> - > > >> https://docs.kde.org/stable5/en/kate/kate/kate-application-plugin-ls= pc > > >> lient.html> >>=20 > > >> On Mon, Feb 12, 2024 at 3:59=E2=80=AFPM Marc Serra wrote: > > >>> Hi, > > >>>=20 > > >>> Kate supports code validation for PHP language? > > >>>=20 > > >>> For example, if I write: > > >>> > >>> echo "hello world; > > >>> ?> > > >>>=20 > > >>> I want to kate show a message or mark the line with the error becau= se > > >>> there is a missing double quote. > > >>>=20 > > >>> Thank's