OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.72k stars 168 forks source link

Completion without overloads #663

Closed datamadsen closed 3 years ago

datamadsen commented 3 years ago

It can be nice to have fewer options to scroll through in a completion list. With these changes it is possible to indicate a preference for completion results without overloads. The way this is achieved is by ignoring the method signature in the completion results and only showing the method name. That, together with a dup: 0 setting on the completion result filters down the completion list significantly.

datamadsen commented 3 years ago

Made a recording to demo what this looks like, here: https://asciinema.org/a/376373

Usually there would be many completion entries for both Write and WriteLine (one for each overload signature), here we only have 1 per method name.

nickspoons commented 3 years ago

I think this is a good option. I would love some way of reconciling it with documentation popups, so we can display just a single Console.Write and Console.WriteLine but some some way of seeing the signatures too. Not quite sure how to do that though.

asciinema comparing completion popups, with and then without the new setting: https://asciinema.org/a/lPb41aOYEyfVldhGMHi47h9i4

Perhaps it's good like this though, with the new option providing a simplified menu without duplicates or parameters listed. I do think that it would be good to at least differentiate between properties and methods, perhaps just adding () or (…) to method names?


The new option needs a default set, either in plugin/OmniSharp.vim like this, or always reference the option as get(g:, 'OmniSharp_completion_without_overloads', 0) instead of directly as g:OmniSharp_completion_without_overloads.

datamadsen commented 3 years ago

Of course it should have a default value - thanks for catching that!

nickspoons commented 3 years ago

Great option, thanks!