-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[request] Ability to sort CompletionItem by type inheritance #16685
Comments
We have so far resisted allowing sorting by anything other than alphabetical, but I definitely understand wanting to see things from a particular layer in the hierarchy. Tagging @kuhlenh @rchande @CyrusNajmabadi for thoughts here. |
@Pilchie I was investigate myself and it seem it should be done on roslyn derivative for IDE, such as omnisharp. roslyn could be as is But the problem I found is, It seem like CompletionItem return from roslyn does not contains type that item came from. So I can't sort it in omnisharp (I try to mod omnisharp) So, is there a type, or at least typename that I could do reflection easier that came along with CompletionItem? If it not exist could it possible to add it into roslyn? |
@DustinCampbell I mean the ability to sort completion should not be implemented in roslyn directly. Instead we should get completion list unsorted and sort it or manipulate it in the host process Ability to manipulate collection should be independent to collection in my opinion Or at least, sorting should be implemented as comparison callback function |
@Thaina: I don't think that's feasible. The data that comes back for the In general, we try to avoid forcing hosts to do that level of sorting because it is error prone. If we want to unify the core C# editing experience across many hosts, we need to take burden off the hosts, not add it. |
@DustinCampbell If so then, that why I was request that CompletionItem return from roslyn should add more information, but let omnisharp manipulate that collection Also the I think CompletionService should return CompletionItem with TypeInfo. Then omnisharp has config to sort it, then return to omnisharp-vscode or other host request it |
ps. Also this feature is what I talk about there >>> #15974 (comment) |
When we say "host", we mean anything hosting a Roslyn workspace. That includes OmniSharp, Visual Studio, Visual Studio for Mac, and many others. That "host" could do many things, such as populate editor presentation APIs (such as in Visual Studio), or service up language service information over a protocol like OmniSharp. Note: I think you're getting a little bogged down by implementation. Why would CompleitionSerivce return a CompletionItem with TypeInfo? There's no need to use reflection here. Remember that this is Roslyn, which already has a rich symbol API for representing types, methods and any other symbols handled by the C# language. |
@DustinCampbell I wish roslyn would return typeinfo with CompletionItem so omnisharp (and other host) would be able to group/sort/hidden or make any decision on its own. In this case is sorting and grouping by its declaration type As I said, I think list in general should be able to sort by custom logic anytimes. Should not implement fixed sorting logic on its own. But should provide information for outside logic instead |
I hope someone is on this |
Just like monodevelop feature. I think it useful when we have large class with many inheritance like unity3D's MonoBehaviour. We should have a way to switch between sorting mode
And, if possible, should be like monodevelop that could always switch anytimes
The text was updated successfully, but these errors were encountered: