hook global WinSetOption filetype=go %{
    set-option buffer lsp_servers %{
        [gopls]
        root_globs = ["go.mod", ".git", ".hg"]
        command = "gopls"
        [gopls.settings.gopls]
        # See https://github.com/golang/tools/blob/master/gopls/doc/settings.md
        # "build.buildFlags" = []
        gofumpt = true
        hints.assignVariableTypes = true
        hints.compositeLiteralFields = true
        hints.compositeLiteralTypes = true
        hints.constantValues = true
        hints.functionTypeParameters = true
        hints.parameterNames = true
        hints.rangeVariableTypes = true
        usePlaceholders = true
        semanticTokens = true
    }
    lsp-enable-buffer
    lsp-semantic-tokens-enable

    set-option buffer indentwidth 0 # Use tabs
}
