SmiteshP / nvim-navic

Simple winbar/statusline plugin that shows your current code context

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request for C++

Fildo7525 opened this issue · comments

When writing code in multiple files, there are different definitions and declarations in different places.
The winbar is different for both versions:
Header file
Screenshot from 2023-04-15 22-58-02
source file:
Screenshot from 2023-04-15 22-59-43

If both of them looked the same it would be great. My preference is the first one. One thing That would be great is if the parameters were shown for functions and methods. This could be controlled by a flag because not all people would like that.

If both of them looked the same it would be great.

This looks different because thats how the LSP is providing the data. You could write custom function for you winbar in C++ files that would find and replace the :: with separators.

One thing That would be great is if the parameters were shown for functions and methods.

Again this is not possible as LSP doesn't provide this data. However you could use the get_data function instead of the get_location function, and access the node's position and have some regex logic to parse the line and extract whatever information you want. And then combine it together into a string that can be displayed.