Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Doesn't display complete type information #54

Open
Integralist opened this issue Jan 15, 2024 · 2 comments
Open

Doesn't display complete type information #54

Integralist opened this issue Jan 15, 2024 · 2 comments

Comments

@Integralist
Copy link

👋🏻

Just a quick comment to say I've realised this plugin (great as it is) doesn't, in Go at least, display the complete type information.

So for example...

Screenshot 2024-01-15 at 10 21 50

So unless I actually K over the method I won't know what w actually is.

In other examples, I also noticed the output type isn't presented...

Screenshot 2024-01-15 at 10 24 20

So for this ^^ the output from the method is a boolean (hence it's used inside of an if condition) but it's not shown at all, only the input for the method is hinted.

Not sure if there's a configuration issue on my side that's causing this?

https://github.com/Integralist/nvim/blob/main/lua/plugins/lsp.lua#L110-L115

Thanks for any help/guidance you can give me.

@praktiskt
Copy link

I'm having the same issue when configuring with mason / lsp-zero (v3.x).

local lsp_zero = require("lsp-zero")
local ih = require("lsp-inlayhints")
ih.setup()

require("mason-lspconfig").setup({
    ensure_installed = { <snip>, "gopls"},
    handlers = {
        lsp_zero.default_setup,
       <snip>
        gopls = function()
            local go_opts = {}
            go_opts["on_attach"] = function(client, bufnr)
                ih.on_attach(client, bufnr)
            end
            go_opts["settings"] = {
                gopls = {
                    hints = {
                        assignVariableTypes = true,
                        compositeLiteralFields = true,
                        constantValues = true,
                        functionTypeParameters = true,
                        parameterNames = true,
                        rangeVariableTypes = true
                    }
                }
            }
            require("lspconfig").gopls.setup(go_opts)
        end
    }
})

image

@praktiskt
Copy link

Might be a duplicate of #11 ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants