Bug 560977 - eclipse quick search skips searching the rest of every file at the first line with more than 1000 symbols
Summary: eclipse quick search skips searching the rest of every file at the first line...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.14   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 567925 (view as bug list)
Depends on:
Blocks: 567925
  Show dependency tree
 
Reported: 2020-03-10 09:24 EDT by Tsvetan Tihanov CLA
Modified: 2021-04-26 09:47 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tsvetan Tihanov CLA 2020-03-10 09:24:47 EDT
The Quick Search (Ctrl+Alt+Shift+L) skips searching the rest of a particular file contents at the first line with more than 1000 symbols. This causes incorrect/inconsistent search results, while at the same time the search completes normally.


-- Configuration Details --
Product: Eclipse IDE 4.14.0.20191212-1200 (org.eclipse.epp.package.jee.product)Installed Features:
 org.eclipse.platform 4.14.0.v20191210-0610
Comment 1 Paul Pazderski CLA 2020-09-16 16:26:38 EDT
Hello Tsvetan,

sorry that no one had reacted to your bug earlier. What you see works (mostly) as intended. Quick search is not a replacement for the regular search. While I can imagine cases where it is useful to see 1000 and more results, in general the simple quick search dialog is not the optimal place to check such large result sets.

One part which can be counted as bug is that you even see 1000 results. It is normally limited to 200 results but does not suspend search in the middle of a file at the moment.

What the quick search dialog is missing is a way to distinct if the search was stopped because all files are searched or the limit of search results is reached.
Comment 2 Tsvetan Tihanov CLA 2020-09-17 04:37:24 EDT
Hi Paul,

I think that the current title of the ticket does not correspond to what I observed and reported back in March 2020. It's not about the number of results, but the number of characters at a single line within a file. I observed this with a text file that had a very long line (1024 characters) and the lines after contained some regular looking code (less than 100 characters per line). What I reported is that when the quick search parses the file and it meets a long line (1000+ characters), it simply ignores the rest of the file, where the code that matches my search pattern actually was.

Looking at the code without line wrapping, the file looked just like any other code file and at first I just couldn't understand why the quick search was not showing it to me in the results. The whole file was like 80 lines. So I noticed that one of the lines was very long and experimentally found that if I reduce its length below 1000 characters, then the Quick search finds the matches in the lines below, otherwise it just ignored all the code below that long line.
Comment 3 Paul Pazderski CLA 2020-09-17 05:57:02 EDT
You are absolute right. I misinterpreted your request. I opened bug 567062 instead for my "to much results" complain.

But what I said before still applies: "What you see works as intended". The original author added this length limitation in order to automatically guess what is an automatic generated file (i.e. minified Javascript) and could be excluded from search.
The limit can be changed in Preference -> General -> Quick Search.

As said, quick search is not a full replacement for the regular search but if you got an idea to improve this situation without fully removing this feature feel free to share.
Comment 4 Tsvetan Tihanov CLA 2020-09-17 10:41:54 EDT
Thank you for the good explanation, Paul!

If I remember correctly, in my case the 1000+ characters line was a very long string value or comment that caused me some pain. I guess this feature could be a good prank for Eclipse newbies.
Comment 5 Julian Ruppel CLA 2021-04-15 18:10:41 EDT
To make the semantic of the Max Line Lenght field in preference at least a bit more comprehensible, a FieldDecorationRegistry.DEC_INFORMATION could give more information about the behavior (which is stoping the search process for this file). 

What do you think?
Comment 6 Julian Ruppel CLA 2021-04-23 05:34:27 EDT
Another idea to work around this intended behavior would be to extend the preferences in a way that a list of files/filetypes can be configured as exceptions from the max line length limit.

So if I know that I have certain files that have long lines but I want them to be included in the search, I could add them there in this allow-list.
Comment 7 Julian Ruppel CLA 2021-04-26 09:47:22 EDT
*** Bug 567925 has been marked as a duplicate of this bug. ***