nvim-navic icon indicating copy to clipboard operation
nvim-navic copied to clipboard

No good working in golang

Open RAprogramm opened this issue 1 year ago • 6 comments

In .go files it shows only functions, so variables in functions not available (I am talking about winbar)

RAprogramm avatar Mar 20 '23 07:03 RAprogramm

Can you share the output by get_location and get_data and what is missing in them?

SmiteshP avatar Mar 20 '23 11:03 SmiteshP

Screencast_00004.webm

get_location

%#NavicIconsMethod# %*%#NavicText#(*APIserver).configureStore%*

get_data (for e in pairs(navic.get_data()) and one more for-loop)

scope table: 0x419abc80
icon  
kind 6
type Method
name (*APIserver).configureStore

RAprogramm avatar Mar 21 '23 23:03 RAprogramm

Maybe the cause of this problem is the same as the https://github.com/SmiteshP/nvim-navic/issues/98.

MaiLunJiye avatar Mar 25 '23 03:03 MaiLunJiye

Yep, it might be issue with is_available function. @RAprogramm Can you try calling is_available explicitly in your winbar config for which ever plugin you are using.

function() return require("nvim-navic").is_available() end

SmiteshP avatar Mar 25 '23 16:03 SmiteshP

The issue is that the Go LSP (gopls) is providing less context that for example a Lua LSP (which gives too much structure imo). So with Go you only see the function, method or struct but not deeper than one level in nvim-navic.

I think treesitter might be a better fit for this plugin that LSP. Optionally having which types to put in the breadcrumb configurable.

marcelbeumer avatar May 11 '23 22:05 marcelbeumer

@marcelbeumer Can you give example of code snippet and the information shown vs what information you want to see instead? I am not well versed in golang

SmiteshP avatar May 14 '23 05:05 SmiteshP