SmiteshP / nvim-navic

Simple winbar/statusline plugin that shows your current code context
Apache License 2.0
1.41k stars 50 forks source link

No good working in golang #97

Open RAprogramm opened 1 year ago

RAprogramm commented 1 year ago

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

SmiteshP commented 1 year ago

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

RAprogramm commented 1 year ago

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
MaiLunJiye commented 1 year ago

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

SmiteshP commented 1 year ago

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
marcelbeumer commented 1 year ago

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.

SmiteshP commented 1 year ago

@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