Skip to content
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

Refactor searchresult insert #2335

Merged

Conversation

MikeFH
Copy link
Contributor

@MikeFH MikeFH commented Mar 13, 2021

Refactoring of the InsertResult method of the SearchPane to use BinarySearch in all cases for sorted insertion, as discussed in #2333
Also contains a small typo fix.

MikeFH added 2 commits March 13, 2021 19:43
We now use BinarySearch in all cases to perform sorted insertion
@MikeFH MikeFH marked this pull request as ready for review March 14, 2021 10:26
@MikeFH
Copy link
Contributor Author

MikeFH commented Mar 14, 2021

I noticed a small problem in the fitness calculation when the search result is a destructor since the method name is always Finalize.
This can lead to a weird sorting of results, for example in a search for "memorystream".

I propose to replace

if (text == ".cctor" || text == ".ctor")

by
if (member.SymbolKind == SymbolKind.Constructor || member.SymbolKind == SymbolKind.Destructor)

Do you think this should be the subject of another issue or another PR or should I include the modification in this PR ?

@siegfriedpammer siegfriedpammer added this to the v7.0-rc milestone Mar 15, 2021
@siegfriedpammer siegfriedpammer merged commit 721baa7 into icsharpcode:master Mar 19, 2021
@siegfriedpammer
Copy link
Member

I noticed a small problem in the fitness calculation when the search result is a destructor since the method name is always Finalize.
This can lead to a weird sorting of results, for example in a search for "memorystream".

I propose to replace

if (text == ".cctor" || text == ".ctor")

by
if (member.SymbolKind == SymbolKind.Constructor || member.SymbolKind == SymbolKind.Destructor)
Do you think this should be the subject of another issue or another PR or should I include the modification in this PR ?

Ah, yes, sorry, I just realized you had this question posted... I think, using symbol kind instead of the name is a good idea. If you want, you can provide another PR.

Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants