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

PR: Several Find in Files improvements #4056

Merged
merged 29 commits into from
May 14, 2017

Conversation

andfoy
Copy link
Member

@andfoy andfoy commented Jan 27, 2017

Fixes #4197
Fixes #4134
Fixes #2963
Fixes #2850
Fixes #2730
Fixes #1555


After checking issue #4005, I've identified that the widget in it's current incarnation doesn't allow to track the status of the search, that implies that the User doesn't know if the search is taking place or not, especially when the search is launched in a big directory. Taking in account this requirement, a progress bar and a text field that indicates the current file scanned is added. Also, some efficiency issues and codification mismatches are being tackled in the present PR.

  • Add spinner and indicator of search progress
  • Inform user if the search/exclude/include regexp patterns are incorrect
  • Improve search and scanning of files (Do not recover all files before searching a term)
  • Improve file and string encoding to bypass and correct errors associated to codification
  • Fix Spyder crash after a long line is matched and tried to display on the results window
  • Simplify visualization of results (The current tree directory visualization is useless if a file resides inside a deep folder)
  • Break results if the pattern was found in a single line
  • Display results as search takes place
  • Replace default regex suggestions
  • Remove previous search results when a new search takes place
  • Remove unused search options
  • Search path now refers to global explorer path
  • Omit binary files
  • Add options to search on the current file, project or current path
  • Add test
  • Allow to order results alphabetically from top header

Now the Widget should look like this while a search task is taking place
peek 25-02-2017 16-25

@ccordoba12
Copy link
Member

@andfoy, the progress bar looks great!

However, you need to break this PR in two parts: one that goes against 3.1.x and fixes only issue #4005 and another one against 3.x with the new additions.

@ccordoba12
Copy link
Member

You can leave this one as it is, then rebase against 3.x once we merge the fix for #4005.

@andfoy andfoy self-assigned this Jan 27, 2017
@andfoy andfoy added this to the v3.x milestone Feb 1, 2017
@ccordoba12 ccordoba12 modified the milestones: v3.2, v3.x, v3.3 Feb 14, 2017
@andfoy andfoy changed the base branch from 3.x to 3.1.x February 21, 2017 04:33
@andfoy andfoy changed the base branch from 3.1.x to 3.x February 21, 2017 04:35
@@ -112,7 +124,8 @@ def include_patterns():
r'\.ipy$|\.pyw?$|\.rst$|\.txt$',
'.',
]
return patterns
# return patterns
return []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this returns an empty list? Isn't it better to simply remove this method?

@@ -13,102 +13,43 @@

# Standard library imports
from __future__ import with_statement
from __future__ import unicode_literals
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unicode_literals introduces a lot of problems. Please remove it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you can simplify importing from __future__ like this

from __future__ import with_statement, print_function

def initialize(self, path, python_path, hg_manifest,
include, exclude, texts, text_re):
self.results = {}
self.nb = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a more descriptive name instead of nb.

text += ' (' + _('interrupted') + ')'
self.set_title(title+text)

def init(self, search_text):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bad name, please use a better one (I mean, there's already __init__ and initialize)

@ccordoba12
Copy link
Member

@andfoy, I left some minor comments. After you solve them, I think this is ready to merge!

But before doing any changes, please remove your last 3 commits (the ones that merge with 3.x) and merge again with the latest 3.x (but just one time).

@ccordoba12
Copy link
Member

@andfoy, the last two commits you added are a mess! I'm going to remove them, and do a proper merge with 3.x.

After that you could fix my comments from yesterday.

@ccordoba12 ccordoba12 force-pushed the find_in_files_bar branch from 4ae7238 to 8765940 Compare May 13, 2017 14:49
@ccordoba12 ccordoba12 force-pushed the find_in_files_bar branch from 76fbcca to bec5c0d Compare May 13, 2017 15:32
@andfoy
Copy link
Member Author

andfoy commented May 13, 2017

@ccordoba12 I have some CI errors

@ccordoba12
Copy link
Member

You're trying to merge your changes from yesterday with my changes from today, which is again introducing the mess I mentioned before.

Please revert what you did (i.e. your last merge) and redo again your changes on top of my last commit on this branch (i.e. Testing: Fix tests). Don't do rebases or merges, just make your changes again (by hand, sorry for making you waste time, but that's what's needed here).

@andfoy andfoy force-pushed the find_in_files_bar branch from 0840e74 to ff415e3 Compare May 13, 2017 22:15
@andfoy
Copy link
Member Author

andfoy commented May 13, 2017

The error persists, even if the conflicting merge was removed

@ccordoba12
Copy link
Member

Ok, don't worry. I'm seeing the same error locally.

I'll find a fix, push it and merge your PR. Thanks a lot for your patience :-)

@ccordoba12 ccordoba12 changed the title Find in Files improvements PR: Several Find in Files improvements May 13, 2017
@ccordoba12
Copy link
Member

This long PR is (finally!) ready. Thanks @andfoy for your work!

@ccordoba12 ccordoba12 merged commit a22b4ff into spyder-ide:3.x May 14, 2017
ccordoba12 added a commit that referenced this pull request May 14, 2017
Fixes #4197
Fixes #4134
Fixes #2963
Fixes #2850
Fixes #2730
Fixes #1555

Conflicts:
- spyder/app/mainwindow.py
- spyder/config/main.py
- spyder/widgets/findinfiles.py
@andfoy andfoy mentioned this pull request Jun 21, 2017
2 tasks
@andfoy andfoy deleted the find_in_files_bar branch June 14, 2019 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants