Code search : just give one result per occurrence + occurrence count (instead of line numbers)

Related products: Software Factory

Code search returns each occurrence of the search term as a result, showing 23 results for two templates that only differ in the line numbers. Clicking one of the results does often show the template, but does not jump to the line number that is mentioned.

Often I only need to know the templates (or other objects) that contain the search term; as ‘code search’ does not allow editing or generating code without opening it in an editor, I have to open the underlying object anyway.

For me it would be handy to have a single line per object result, and instead of a line number, a count of the number of occurrences.

I imagine the change would be minimal, only involving a group by and a count.

Hi @Boudewijn@Maurice Liebregt@Marc Ferket,

Since you voted on this idea, I would at least like to have your opinion. But anyone else's opinion is also welcome.

Would something like this make the code search easier to use?

The results would get an extra layer containing the object, which is being used to group on. I kept the line numbers intact. so you can easily see which lines contain a hit.

If you get any false positives, or you are just not interested in some of the results, you can collapse the object, which instantly hides all line numbers.

Would love to hear your feedback on this.


OpenNeeds feedback

@Jeroen van den Belt I like your proposal, since I do use the line numbers, even when I’m opening the code in another editor like SSMS. Which coincidentally also supports line numbers.


This would give the best of both worlds!