hedyhli / outline.nvim

Code outline sidebar powered by LSP. Significantly enhanced & refactored fork of symbols-outline.nvim.
https://sr.ht/~hedy/outline.nvim
MIT License
543 stars 15 forks source link

question: make go project show the same outline as c++ project. #79

Closed ericwq closed 1 month ago

ericwq commented 1 month ago

The following is the outline of my go project. You will immediately notice that most method name cant' be showed easily, because struct name take most space.

Screenshot 2024-07-02 at 19 38 44

The following is the outline of some c++ project (using the same outline plugin). It's obvious that all the methods name can be showed easily. My question is how to config my go project to show outline like c++ project?

After search full doc and issue list, I got nothing but go for help.

Screenshot 2024-07-02 at 19 38 28
hedyhli commented 1 month ago

Unfortunately, this is what the LSP provides and there's not much we can do on our side to help with it.

The methods I have in my Go projects, where I use gopls also show up as function with the pointer receivers prefixed. In Go, methods are defined at the same level as the structs, whereas in C++ it's defined "inside" a class.

Again, I understand that it's more readable if Go methods also show up nested, with the pointer receiver prefixes removed and I experience pain too, but that's what the LSP provides outline.nvim simply displays what the LSP gives it.

ericwq commented 1 month ago

thanks to let me know that.