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

"Conceptual" Search is required as C# syntax evolves #72955

Open
vsfeedback opened this issue Apr 9, 2024 · 2 comments
Open

"Conceptual" Search is required as C# syntax evolves #72955

vsfeedback opened this issue Apr 9, 2024 · 2 comments
Labels
untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


With all the modern features of C# including expression simplification, searching for terms and pattern matching becomes naive and prevents you from being able to find code by intent easily.

For instance, consider searching for all the locations where "MyObject" is constructed such as "new MyObject". The problem here is that with expression simplification, often times the expression is written, and by default always suggested, as

MyObject instance = new()

While there are other ways of finding object instantiation using references or implementation, often it is much quicker to search on a "pattern". However in this case, instances of MyObject construction are missing in the search results due to not being a direct match of the exact terms as naively written.

In cases such as this, searching symantically or conceptually based on the intent of the search expression rather then on the exact terms would be prefered. In the case above, look for all instances of what appears to be instantiation of MyObject and match on all patterns possibly in C# to instantiate that type, including simplified expression forms.

Mabye this doesn't fit directly in the text search feature , but as C# evolves to become more functional and less verbose, and offering numerous ways of writing expressions differently with the same intent, searching by conceptual patterns rather then by directly comparing terms or characters will be needed.


Original Comments

Feedback Bot on 4/8/2024, 09:21 PM:

(private comment, text removed)

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Apr 9, 2024
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@CyrusNajmabadi
Copy link
Member

@tmat sounds like something possibly covered by SemanticSearch. Having a snippet to show how to do this would be good :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

2 participants