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

Find widget only highlights the first 19999/20000 matches #496

Closed
zwb1988 opened this issue Nov 23, 2015 · 13 comments
Closed

Find widget only highlights the first 19999/20000 matches #496

zwb1988 opened this issue Nov 23, 2015 · 13 comments
Labels
editor-find Editor find operations feature-request Request for new features or functionality
Milestone

Comments

@zwb1988
Copy link

zwb1988 commented Nov 23, 2015

Using the search with regular expression in the VS Code 0.10.1, it only highlights the matched items with couple hundreds of lines from the top and skips the rest of the document.

This can be done by creating an empty document and fill it up with thousands lines of text and perform a regex search.

@aasierra
Copy link

@zwb1988 I have proposed a fix here #501

@zwb1988
Copy link
Author

zwb1988 commented Nov 23, 2015

@aasierra Cool. I have found out that normal search has exactly the same issue. I see you changed the constant LIMIT_FIND_COUNT, the method findMatches will apply the same rule to the normal search (if I am not mistaken).
Don't know how will this change affect the searching performance in a huge file thought (like a file size in MB or GB).

@aasierra
Copy link

@zwb1988 Yep regarding huge files at the very least I changed it to this to hopefully get things talked about. Also increasing for all search types was done intentionally to increase search limit for everything not just Regex as I am sure other users will be confused why normal searches do not match everything as well.

@aasierra
Copy link

@zwb1988 Although, regarding large files, the way lines are stored I believe will allow for a large amount to not have issues but when it gets large it should act the same as other text editors might.

@alexdima
Copy link
Member

I can't accept the PR for the time being. The find results (from findMatches) are converted to decorations. Decorations are copied and transformed in the view model (to take line wrapping into account).

The code around decorations is not prepared to deal with decorations count in the 1M range for sure, which is something that can happen when opening a ~20MB file and searching for "a" or something...

@egamma egamma modified the milestone: Backlog Dec 10, 2015
@alexdima alexdima added feature-request Request for new features or functionality editor labels Dec 10, 2015
@alexdima
Copy link
Member

alexdima commented Jan 9, 2016

Starting with 587854a, all find widget operations (find next, find prev, replace, replace all) now function outside the 1k decorations limit.

@alexdima alexdima added the editor-find Editor find operations label Jun 26, 2016
@alexdima alexdima changed the title Regex search does not highlight all the items in a document Find widget only highlights the first 1000 matches Aug 30, 2016
@alexdima alexdima removed their assignment Aug 30, 2016
@alexdima alexdima self-assigned this Sep 28, 2017
@alexdima alexdima added the debt Code quality issues label Sep 28, 2017
@alexdima
Copy link
Member

PR #36410 reimplements decorations as an interval tree and brings in a number of key optimizations around decorations. It raises the find limit from 1k to 20k.

@dijonkitchen
Copy link

Sounds like the issue can close!

@alexdima alexdima changed the title Find widget only highlights the first 1000 matches Find widget only highlights the first 19999/20000 matches Nov 23, 2017
@alexdima alexdima removed their assignment Apr 27, 2018
@osapishchuk
Copy link

osapishchuk commented Feb 4, 2019

I have near 101237 items in the XML file and I can't count them because of this 19999+ limit. Is there a way to provide default limit that we can change in workspace preferences?

image

image

@SergeiNarozhnyi
Copy link

Upvote. Limits should be defined as per the workspace, if required

@najibla
Copy link

najibla commented Mar 1, 2021

Please fix this

@ToMakeSense
Copy link

This issue should be closed, after PR #126762 merged.

@rebornix rebornix removed their assignment Oct 22, 2021
@amunger
Copy link
Contributor

amunger commented Dec 13, 2022

it looks like this was implemented but the setting is not working for me #169017

@amunger amunger closed this as completed Dec 13, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-find Editor find operations feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests