Skip to content

Add example configuration for gopls #36

@RonanMacF

Description

@RonanMacF

It's not clear how the JSON is supposed to be setup here, for example I have tried

{
  "analyses": {
    "fieldalignment": true,
    "nilness": true,
    "unusedparams": true,
    "unusedwrite": true,
    "unusedvariables": true
  }
}

Also tried the above with an outer gopls and against with an outer settings but it does not get applied to the gopls server, when I manually do the settings, for example as below, I see the linting appear.

require("lvim.lsp.manager").setup("gopls", {
    cmd = { "gopls", "serve" },
    filetypes = { "go", "gomod" },
    -- root_dir = util.root_pattern("go.work", "go.mod", ".git"),
    settings = {
        gopls = {
            analyses = {
                nilness = true,
                unusedparams = true,
                unusedwrite = true,
                useany = true,
            },
            experimentalPostfixCompletions = true,
            gofumpt = true,
            staticcheck = true,
            usePlaceholders = true,
        },
    },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions