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

Can't get to use this language server for eslint

Open lucastrvsn opened this issue 4 years ago • 1 comments

Hello! I'm trying to switch from diagnostic-languageserver to efm-langserver but I can't get it to work properly. I'm trying to make eslint work, but with no success. With diagnostic-languageserver it works and error messages is displayed, but with efm-langserver no. I have eslint and eslint_d installed globally and both is working ok. Also using neovim with lspconfig on the latest commit on master. I'm using this dotfiles for base config: https://github.com/lukas-reineke/dotfiles. efm-langserver is installed using go get and I can spawn it from terminal.

This is my config so far:

local root_markers = { ".git/" }

local eslint = {
  -- lintCommand = "eslint_d -f unix --stdin",
  lintCommand = "eslint -f unix --stdin",
  lintStdin = true,
  lintIgnoreExitCode = true
}

local languages = {
  javascript = { eslint },
  javascriptreact = { eslint },
  typescript = { eslint },
  typescriptreact = { eslint }
}

require("lspconfig").efm.setup({
  on_attach = on_attach,
  cmd = { "efm-langserver" },
  root_dir = require("lspconfig").util.root_pattern(unpack(root_markers)),
  settings = {
    rootMarkers = root_markers,
    languages = languages
  },
  filetypes = vim.tbl_keys(languages)
})

Tried everything and nothing works. I don't know if I'm missing something. Thanks a lot!

lucastrvsn avatar Jan 04 '21 18:01 lucastrvsn

I was able to get eslint working with following config:

{
  lintCommand = "eslint_d -f unix --stdin --stdin-filename ${INPUT}",
  lintIgnoreExitCode = true,
  lintStdin = true,
  lintFormats = {"%f:%l:%c: %m"},
}

However I can't figure out a way to get codeactions working.

tomaskallup avatar Jan 25 '21 10:01 tomaskallup