diff options
| author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-12-19 16:06:10 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-19 16:06:10 -0800 |
| commit | 49280932586ef86d3fa094dd7cfb1b5003cf48aa (patch) | |
| tree | d22610173d4c342f85163b9e658ccd6125882a64 /lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-49280932586ef86d3fa094dd7cfb1b5003cf48aa.tar nvim-lspconfig-49280932586ef86d3fa094dd7cfb1b5003cf48aa.tar.gz nvim-lspconfig-49280932586ef86d3fa094dd7cfb1b5003cf48aa.tar.bz2 nvim-lspconfig-49280932586ef86d3fa094dd7cfb1b5003cf48aa.tar.lz nvim-lspconfig-49280932586ef86d3fa094dd7cfb1b5003cf48aa.tar.xz nvim-lspconfig-49280932586ef86d3fa094dd7cfb1b5003cf48aa.tar.zst nvim-lspconfig-49280932586ef86d3fa094dd7cfb1b5003cf48aa.zip | |
feat(efm): re-enable single file support
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/efm.lua | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lua/lspconfig/server_configurations/efm.lua b/lua/lspconfig/server_configurations/efm.lua index 2944079b..ad4372ca 100644 --- a/lua/lspconfig/server_configurations/efm.lua +++ b/lua/lspconfig/server_configurations/efm.lua @@ -4,9 +4,7 @@ return { default_config = { cmd = { 'efm-langserver' }, root_dir = util.find_git_ancestor, - -- EFM does not support NULL root directories - -- https://github.com/neovim/nvim-lspconfig/issues/1412 - single_file_support = false, + single_file_support = true, }, docs = { @@ -15,6 +13,17 @@ https://github.com/mattn/efm-langserver General purpose Language Server that can use specified error message format generated from specified command. +Requires at minimum EFM version [v0.0.38](https://github.com/mattn/efm-langserver/releases/tag/v0.0.38) to support +launching the language server on single files. If on an older version of EFM, disable single file support: + +```lua +require('lspconfig')['efm'].setup{ + settings = ..., -- You must populate this according to the EFM readme + filetypes = ..., -- Populate this according to the note below + single_file_support = false, -- This is the important line for supporting older version of EFM +} +``` + Note: In order for neovim's built-in language server client to send the appropriate `languageId` to EFM, **you must specify `filetypes` in your call to `setup{}`**. Otherwise `lspconfig` will launch EFM on the `BufEnter` instead of the `FileType` autocommand, and the `filetype` variable used to populate the `languageId` will not yet be set. |
