SmiteshP / nvim-navic

Simple winbar/statusline plugin that shows your current code context

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Where is `->` coming from and how do I remove it?

miversen33 opened this issue · comments

I am setting up nvim-navic (super nice plugin by the way!) and I can't seem to figure out why some of the data being kicked back has a -> in it. Below is an image to helps how what I am seeing

image

The string for this is

 import -> >  import -> 

I am not doing anything crazy with the formatting of the string, below is the function I am using

    local create_symbol_bar = function()
        if not nvim_navic.is_available() then
            return ''
        end
        local details = {}
        for _, item in ipairs(nvim_navic.get_data()) do
            table.insert(details, item.icon .. item.name)
        end
        return table.concat(details, ' > ')
    end

It seems to only be present in an anon function, though not always present in the anon function. Additionally, it seems to be related to lua.

When I dump the return contents of get_data, I am seeing the following table

{
  icon = " ",
  kind = 12,
  name = "import ->",
  scope = {
    ["end"] = {
      character = 3,
      line = 326
    },
    start = {
      character = 45,
      line = 224
    }
  },
  type = "Function"
}

Notice that the name itself is including ->. Any idea what could be causing this?
I am editing this file if you want to pull it down, open it and see if navic is returning the same odd character artifacts in the name for you.

I will see if I can get a minimal config put together to reflect this, though as navic is just using the LSP and the currently open file, I don't imagine my neovim config is doing much to affect this.

Some quick info about my setup

$ nvim --version
NVIM v0.8.0-dev-1008-g12fe197cf
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/miversen/git/neovim/build/cmake.config -I/home/miversen/git/neovim/src -I/home/miversen/git/neovim/.deps/usr/include -I/usr/include -I/home/miversen/git/neovim/build/src/nvim/auto -I/home/miversen/git/neovim/build/include
Compiled by miversen

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/neovim/share/nvim"

Run :checkhealth for more info
$ lsb_release -a
LSB Version:    n/a
Distributor ID: Arch
Description:    Arch Linux
Release:        rolling
Codename:       n/a

Search closed issues, that has been discussed before. I think this is sumneko's lsp behaviour.

Search closed issues, that has been discussed before. I think this is sumneko's lsp behaviour.

I did a quick search but didn't see anything.

It looks like it was discussed here. Knowing this is an LSP issue, I'll accept that I need to do some string manipulation. I wonder if it makes sense to call this out as a known "issue" so people don't keep submitting issues for it

Duplicate #63