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

Add assembly search strategy #1708

Merged
merged 3 commits into from
Sep 28, 2019

Conversation

miloush
Copy link
Contributor

@miloush miloush commented Sep 22, 2019

Searching assemblies by full name. Shows file path in Location column.

image

@siegfriedpammer
Copy link
Member

Would it be useful to add the file name as an additional criterion? That is asm.FullName.Contains OR asm.FileName.Contains. Of course each assembly would only be displayed once in the result list.

@miloush
Copy link
Contributor Author

miloush commented Sep 23, 2019

I flavoured the assembly search, you can now match name (a:), full name (afn:), file name (af:), culture (ac:), version (av:), and others (apk:, aha:, afl:). Does that address your concern, or were you looking for an actual OR? We could make a: to be assembly name or file name and an: name only.

Speaking of which, the tree view seems to show file names without extension rather than assembly names. In most cases they are the same but I got a few assemblies where the file name does not match the assembly name, the result being that the "Name" column in search results does not show the same label as the tree view for the same assembly. Was that a deliberate choice, or is that something worth aligning?

@siegfriedpammer
Copy link
Member

I flavoured the assembly search, you can now match name (a:), full name (afn:), file name (af:), culture (ac:), version (av:), and others (apk:, aha:, afl:). Does that address your concern, or were you looking for an actual OR? We could make a: to be assembly name or file name and an: name only.

Wow... that are a lot of options... I thought that maybe a: should be equal to assemblies.Where(a => a.FullName.Contains("<search-term>") || a.FileName.Contains("<search-term>"). All the options might be overkill.

Speaking of which, the tree view seems to show file names without extension rather than assembly names. In most cases they are the same but I got a few assemblies where the file name does not match the assembly name, the result being that the "Name" column in search results does not show the same label as the tree view for the same assembly. Was that a deliberate choice, or is that something worth aligning?

Yes, I think we should use the assembly name in both cases... The filename will be displayed in the tooltip anyway.

cc @christophwille @dgrunwald what do you think?

@christophwille
Copy link
Member

christophwille commented Sep 23, 2019

I am content with simply using "a:" to mean "wildcard-search in full asm name". It should be rather unusual that version string collides with culture or file name.

@dgrunwald
Copy link
Member

Yes, I think we should use the assembly name in both cases... The filename will be displayed in the tooltip anyway.

For our own usage I'd prefer the file name, so that we can easily distinguish the variants of our test cases (AssemblyName.dll, AssemblyName.opt.dll, etc.).

@siegfriedpammer
Copy link
Member

siegfriedpammer commented Sep 23, 2019

Yes, I think we should use the assembly name in both cases... The filename will be displayed in the tooltip anyway.

For our own usage I'd prefer the file name, so that we can easily distinguish the variants of our test cases (AssemblyName.dll, AssemblyName.opt.dll, etc.).

Yes, you are right. I'd forgotten about that...

@miloush
Copy link
Contributor Author

miloush commented Sep 23, 2019

Okay so we are concluding that we want two options, full assembly name and file path?

@siegfriedpammer
Copy link
Member

Okay so we are concluding that we want two options, full assembly name and file path?

Are you talking about two different search "prefixes"/options or display options in the tree view?

From what I gather from the other responses, the best route to take would be:

  • keep the tree view as is,
  • use only one search "prefix"/option: a: to search the full assembly name OR file name, as in: assemblies.Where(a => a.FullName.Contains(searchTerm) || a.FileName.Contains(searchTerm)),
  • the other separate options for version, culture and pk-token are overkill.

Do you agree?

@miloush
Copy link
Contributor Author

miloush commented Sep 25, 2019

Tree view is a separate issue.
I agree all the options are overkill, as they can be matched using regex on the full name.

I am a bit worried about the full path to be included by default. Many assemblies are typically under the same directory and we might get lots of false positives when searching e.g. for Microsoft.

I suggest a compromise:
a: matching assembly local name OR file name without path (the only one in dropdown)
an: matching assembly full name
af: matching assembly full path

@siegfriedpammer
Copy link
Member

Yes, I think this is a good compromise...

@dgrunwald are you OK with these changes?

@siegfriedpammer siegfriedpammer added this to the v6.0 milestone Sep 26, 2019
@siegfriedpammer siegfriedpammer merged commit 5592c9c into icsharpcode:master Sep 28, 2019
@siegfriedpammer
Copy link
Member

@miloush Thank you for contributing this feature!

@miloush miloush deleted the assembly-search branch October 1, 2019 13:52
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.

4 participants