Skip to content

File randomly full of unused pattern variable errors for substrings of the code #1341

@Mehgugs

Description

@Mehgugs

As described in title, this happens on 2.8.0 via neovim.

Using a config recommended via slack for combatting this issue, to no avail. I additionally swapped out elm-test for elm-test-rs.

local function custom_attach(client)
  if client.config.flags then
    client.config.flags.allow_incremental_sync = true
  end
end

return {
  "neovim/nvim-lspconfig",
  opts = {
    servers = {
      elmls = {
        mason = false,
        rootPatterns = { "elm.json" },
        init_options = {
          disableElmLSDiagnostics = false,
          elmReviewDiagnostics = "warning",
          elmPath = vim.fn.exepath("elm"),
          elmTestPath = vim.fn.exepath("elm-test-rs"),
          onlyUpdateDiagnosticsOnSave = true,
          rootPatterns = { "elm.json" },
          skipInstallPackageConfirmation = false,
          trace = {
            server = "messages",
          },
        },
      },
    },
    setup = {
      elmls = function(_, opts)
        local default_config = require("lspconfig.configs.elmls").default_config
        local final_config = vim.tbl_deep_extend("force", default_config, opts, { on_attach = custom_attach })

        require("lspconfig").elmls.setup(final_config)
        return true
      end,
    },
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions