<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 2016-05-16 03:55 PM, Tobias Rzepka
wrote:<br>
</div>
<br>
...<br>
<blockquote
cite="mid:17c41c01-6442-d211-c449-922381d627ad@gmail.com"
type="cite">
<blockquote cite="mid:5739E182.5020402@vrplumber.com" type="cite">
</blockquote>
Hello Mike,<br>
<br>
I wasn't aware of the CTRL-ALT-F dialog. Typically I use
CTRL-SHIFT-F, but that's for finding something in files. So you
are right, that adding a line number would make no sense and the
CTRL-G isn't the right place... <br>
But that is what I had in mind:<br>
If it's a line number goto to that line (current file),<br>
if it's a method, function or class, open the file if not already
open and jump to the definition and<br>
if it's a filename just open the file (maybe with line number jump
to it ;-)<br>
<br>
So it would be a powerful goto dialog and your solution is
relative near I think.<br>
<br>
I like your solution for finding files in the project. But I think
to find files not in the project (maybe e.g. in sys.path) would be
a useful feature. Maybe a choice to os.walk a path instead of
"self.project.pdata.get" would do the trick...<br>
</blockquote>
<br>
You'll note that the original dialog did have the "search sys.path"
behaviour. I left that out of the revised dialog because my focus is
on being to able to jump around quickly in large projects. Doing a
file-system walk on the entirety of sys.path is likely to cause
issues for users with lots of very big projects.<br>
<br>
My (new) laptop (with a fast SSD) does a sys.path walk in around
.2s, because it doesn't have much software installed (but that is
still pretty slow for something you want to do between keystrokes).
For comparison, my (powerful, but older, and using a spinning disk)
workstation takes close to a minute just to walk sys.path and winds
up with 365,000+ files in the search set. That's just kind of
pointless as a search set probably 99% of the time (on Debian
systems you wind up with an enormous amount of system software on
sys.path). You could cache that, of course, but a minute of
searching/indexing is... heavy, and the index would need to be
re-scanned periodically.<br>
<br>
If you wanted to "find a class of name X" you'd have to have a
source-code-content index and use that in the goto dialog. I don't
*believe* we have a generic indexing mechanism in Eric yet to make
that work cleanly.<br>
<br>
You could easily do heuristics such as looking for imports in the
files and figuring out the most likely modules/packages in which to
search, basically "adding to the search set" for just those packages
your code actually imports.<br>
<br>
You could lean on the existing completion implementations to do some
contextualized jumping (though I think most of them will only index
code in your project), but my focus so far has been on getting the
"jump to a known file" working cleanly. If you'd like to work on
something more advanced, I'm guessing Detlev might be interested :D<br>
<br>
BTW, if you *do* want to work on it, cloning off of Detlev's machine
is rather slow (at least from Canada), feel free to use the
Bitbucket mirror I've set up.<br>
<br>
<blockquote
cite="mid:17c41c01-6442-d211-c449-922381d627ad@gmail.com"
type="cite"> Filename and path has to be exchanged in the UI and
the ESC doesn't work if you leave the input box (e.g. if you
select with the mouse but want to close the dialog with ESC). <br>
</blockquote>
<br>
Thanks. Both fixed on the version now up on bitbucket.<br>
<br>
<a class="moz-txt-link-freetext" href="https://bitbucket.org/mcfletch/eric">https://bitbucket.org/mcfletch/eric</a><br>
<br>
I also make the search box re-focus when you hit the
<ctrl-alt-f> keybinding so that you can immediately start
typing without worrying about whether you selected something else in
the dialog previously. Other than possibly adding code to
auto-populate the search with current-line-of-code content I'm
relatively happy with the dialog for jumping around my large
projects. I still wind up using the project tree here and there when
I've forgotten what the name of a module or file was, but for the
most part I now simply direct-jump with a file-search.<br>
<br>
Take care,<br>
Mike<br>
<br>
<blockquote
cite="mid:17c41c01-6442-d211-c449-922381d627ad@gmail.com"
type="cite"> <br>
<blockquote cite="mid:5739E182.5020402@vrplumber.com" type="cite">
<blockquote
cite="mid:b373348c-f99e-42ed-a3e0-64ad4fbf98cf@gmail.com"
type="cite">
<p> </p>
Mike C. Fletcher schrieb am 16.05.2016 um 04:07:<br>
<blockquote cite="mid:57392B6B.3000405@vrplumber.com"
type="cite">
<div class="moz-cite-prefix">On 2016-05-14 06:06 AM, Detlev
Offenbach wrote:<br>
</div>
<blockquote
cite="mid:3a9d242a-918d-dcf0-2340-a0fa181318a4@die-offenbachs.de"
type="cite">
<p>Hi Mike,</p>
<p> </p>
<p>thanks for letting us know. Please make sure you base
your work on the default branch because the 6_1_x brand
(aka eric 6.1) is feature frozen. It just receives bug
fixes.</p>
</blockquote>
<br>
Okay, so I've got it working to the level where I'm pretty
satisfied with the speed/utility of the find-file operation
(note: haven't done any heavy hacking with it yet, so it
could be I'll find other bits that would be useful).<br>
<br>
I've hooked it up for now to replace the FindFileNameDialog,
as I only ever use the "Find in Project" version. It may be
that it should be hooked up under a different
key-binding/menu-item if you decide to pull it into the
project. I built this dialog as a separate module/form
(though it's just based on the FindFileNameDialog), as the
functionality is somewhat different than the original
dialog.<br>
<br>
Basic functionality:<br>
<br>
* space-separated search terms<br>
* finds that subset of items which have the most matches for
the search terms<br>
* sorts the subset based on the terms matching in-order,
then on the most-recent modification time (this actually
hits the file system with a stat-per-file, but even on huge
projects this doesn't seem to cause a noticeable delay)<br>
* provides key-bindings for enter (select current), escape
(cancel navigation) and up/down (select previous/next match
in the list)<br>
<br>
I've pushed the code up on BitBucket so you can pull from
there if you're interested in the functionality.<br>
<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="https://bitbucket.org/mcfletch/eric/overview">https://bitbucket.org/mcfletch/eric/overview</a><br>
<br>
Take care, and thanks,<br>
Mike<br>
<br>
<blockquote
cite="mid:3a9d242a-918d-dcf0-2340-a0fa181318a4@die-offenbachs.de"
type="cite">Am 13.05.2016 um 22:26 schrieb Mike C.
Fletcher:<br>
<blockquote cite="mid:5736387D.5010601@vrplumber.com"
type="cite">
<div class="moz-cite-prefix">On 2016-05-06 12:26 PM,
Detlev Offenbach wrote:<br>
</div>
<blockquote cite="mid:54170821.nth6ERysSY@saturn"
type="cite">
<meta name="qrichtext" content="1">
<p>Hi Mike,</p>
<p> </p>
<p>sounds like a great idea. How about contributing
the suggested modifications?</p>
<p> </p>
<p>Maybe somebody else is interested, in case Mike
can't do it?</p>
</blockquote>
<br>
I've started into work on it... I've got a hacked-up
proof of concept dialog that does the basics but still
needs work to get key-bindings and the like worked out.<br>
<br>
Anyway, just wanted to avoid someone duplicating the
work. Take care,<br>
Mike<br>
<br>
<blockquote cite="mid:54170821.nth6ERysSY@saturn"
type="cite">
<p> </p>
<p>Detlev</p>
<p> </p>
<p>On Friday 06 May 2016, 12:07:44 Mike C. Fletcher
wrote:</p>
<p>> Hi Detlev (and everyone else),</p>
<p>> </p>
<p>> There's a feature I keep seeing in Atom and
other IDEs that is *really*</p>
<p>> helpful for jumping around in larger (10,000+
file) projects. It's a</p>
<p>> quick-file-search-and-open dialog. Basically
it's the functionality in</p>
<p>> File | Search File, but modelled as a
speed-optimized keyboard-centric</p>
<p>> searching/winnowing process.</p>
<p>> </p>
<p>> That is, you pop up the dialog with a
key-sequence and start typing</p>
<p>> (fragments from) the name of the file, so, for
instance, if I wanted to</p>
<p>> find "subproject/subproject/moo/models.py" I
would type something like this:</p>
<p>> </p>
<p>> ctrl-alt-f</p>
<p>> moo models subp</p>
<p>> <down> (to select the second match)</p>
<p>> <enter></p>
<p>> </p>
<p>> The search results would update as I typed
"moo" to have all files with</p>
<p>> the substring "moo" in their paths (with those
that have moo as a full</p>
<p>> path component sorted first, hopefully), then
when I start typing</p>
<p>> "models" would further restrict the set to
those items that contain both</p>
<p>> moo and models, and when I start typing
subp(roject) the search set gets</p>
<p>> down to 1-2 entries and I just select the
entry with the arrows and hit</p>
<p>> enter (again, without leaving the search box
or using the mouse).</p>
<p>> </p>
<p>> When results are displayed, the first item is
always selected, and</p>
<p>> hitting <enter> opens it, while up/down
arrows select other entries</p>
<p>> (again, without needing to switch focus from
the search box).</p>
<p>> </p>
<p>> The changes from current File Search suggested
are:</p>
<p>> </p>
<p>> * don't require file extension filtering</p>
<p>> o particularly when you have a *lot* of
no-file-extension files</p>
<p>> that restriction isn't all that useful</p>
<p>> o if the file-extension widget is empty,
ignore it</p>
<p>> * do simple sub-string matching on the set of
file-paths known to the</p>
<p>> project</p>
<p>> o do *not* require a full-name match on the
terms, but *rank*</p>
<p>> those result higher</p>
<p>> + allow e.g. "subproject/moo" to find
everything that has that</p>
<p>> sequence of characters in its path</p>
<p>> o this should likely be done on in-memory
structures only, *not*</p>
<p>> on the file system</p>
<p>> * treat space-delimited fragments as AND'd
search terms</p>
<p>> o again, ease of typing being the rationale
here, not something</p>
<p>> involved</p>
<p>> * allow hitting <up> and <down> to
change the selected item from the</p>
<p>> search box</p>
<p>> * allow hitting <enter> in the search
box to open the</p>
<p>> currently-selected file</p>
<p>> </p>
<p>> Nice enhancements:</p>
<p>> </p>
<p>> * sort results based on relevance ranking
(optional) so e.g. having a</p>
<p>> full path-unit == to a search term sorts
before having it as a</p>
<p>> sub-string of a path unit</p>
<p>> * if there are no matches (or less than a
threshold, such as a full</p>
<p>> screen of results), use fuzzy-matching
(soundex, ledit distance,</p>
<p>> etc) to try to find other possible matches
(always sorted below</p>
<p>> absolute matches)</p>
<p>> * as you type, do autocomplete on the path
fragments we know, so "sub"</p>
<p>> would autocomplete to the longest common
fragment that starts with</p>
<p>> "sub" (a-la bash or similar shell)</p>
<p>> </p>
<p>> With that done, we could also do the
following:</p>
<p>> </p>
<p>> * on an import statement, launching
file-search could pre-populate</p>
<p>> with the import name (and with "from" imports,
the upper level</p>
<p>> module, with . translated to /)</p>
<p>> * on other fragments of code, launching
file-search could pre-populate</p>
<p>> with the current token</p>
<p>> </p>
<p>> Anyway, this is just a suggestion, and feel
free to say no.</p>
<p>> </p>
<p>> Thanks for all the great work on Eric,</p>
<p>> Mike -- </p>
<p><span>Detlev Offenbach</span></p>
<p><a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:detlev@die-offenbachs.de">detlev@die-offenbachs.de</a></p>
</blockquote>
<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
--
Detlev Offenbach
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:detlev@die-offenbachs.de">detlev@die-offenbachs.de</a></pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Eric mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Eric@riverbankcomputing.com">Eric@riverbankcomputing.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://www.riverbankcomputing.com/mailman/listinfo/eric">https://www.riverbankcomputing.com/mailman/listinfo/eric</a>
</pre>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>