Skip to content

Completion for php.html filetype #2599

Answered by sitedyno
sitedyno asked this question in Q&A
Discussion options

You must be logged in to vote

I've learned from vim.lsp.ClientConfig there is a field get_language_id that you can set to a function to return the filetype. I guess the spec goes with Microsoft's terminology...

Something like the following gets completion working in templates:

     require('lspconfig')[phpactor].setup {
          filetypes = {
            'php',
            'php.html',
          },
          get_language_id = function(_, filetype)
            if filetype == 'php.html' then
              return 'php'
            else
              return filetype
            end
          end,
        },
      }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sitedyno
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant