efm-langserver icon indicating copy to clipboard operation
efm-langserver copied to clipboard

PHP issue

Open kylix31 opened this issue 1 year ago • 1 comments
trafficstars

When i try to format a PHP file, I always get this error:

[ERROR][2023-11-27 17:59:45] ...-format/init.lua:205	"efm: 0: format for LanguageID not supported: php"

My current config:

    lsp_setup = {
      on_attach = on_attach,
      init_options = { documentFormatting = true, documentRangeFormatting = true },
      filetypes = { "php" },
      settings = {
        rootMarkers = { ".git/" },
        languages = {
          php = {
            formatCommand = "phpcbf",
            formatStdin = true,
          },
        },
      },
    }
❯ whereis phpcbf
phpcbf: /usr/bin/phpcbf

NVIM v0.9.4 efm-langserver 0.0.49

kylix31 avatar Nov 27 '23 21:11 kylix31

phpcbf has the issue mentioned here:

https://github.com/mattn/efm-langserver/issues/183

There's an issue to revise the exit codes: https://github.com/squizlabs/PHP_CodeSniffer/issues/2898

That results in the formatting output being ignored.

I also believe there are some problems in your configuration, php should be a list:

-- …
php = {
  { formatCommand = "phpcbf", formatStdin = true },
},

sirreal avatar Nov 05 '24 15:11 sirreal