Author Topic: Open tool behavior  (Read 4832 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Open tool behavior
« on: December 08, 2016, 08:04:46 PM »
I have
Sync current directory: ON
show/match workspace and project files off
show/match open files off
show/match history off
show/match current dir ON

Recursive contains matching for the 3 wildcard settings.

I have 1 file open: "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdarg.h"

Yet the file list doesn't show any recursive results.
It shows only files in the current directory, nothing recursive.
This seems to happen no matter which folder is selected.


It claims "When set to Recursive contains matching, this will match anything that contains the current wildcard in the current tree and workspace"

Also, what is the difference between "exact" and "contains" for a wildcard?

V21.0.1.0

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Re: Open tool behavior
« Reply #1 on: December 08, 2016, 08:11:01 PM »
What wildcard have you typed?  Is the directory correct (c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\)?

Exact wildcard matching is would be something like *.cpp.  Contains wildcard matching is things like *test*.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Open tool behavior
« Reply #2 on: December 08, 2016, 08:25:29 PM »
I've tried every possible wildcard I can think of.
In the attached, I happen to have stdarg.h open, so that's why it shows up, but nothing else does.

No matter if I have no wildcard, *, *.*, *.h, etc.


WRT Exact vs. contains: Still I don't get it.
If I set the wildcard to "*.cpp", what does exact vs contains do?
If I set the wildcard to "*test*", what does exact vs contains do?

I understand it for non-wildcards:
Contains, "test" would match "ThisTest.c", "TestFile.blat" and "test".
Whereas exact would only match "test", right?

Does contains simply behave as if "*" is added before and after whatever you type for the filter?

Dennis

  • Senior Community Member
  • Posts: 3960
  • Hero Points: 517
Re: Open tool behavior
« Reply #3 on: December 20, 2016, 04:30:08 PM »
You may have found a bug there.  It should match recursive against the current directory with that option.  Keep in mind that there is a subtle difference between "current directory" and "current file directory", but since you have sync current dir turned on, there is not actually much of a difference, unless you change directory in the Open File tool window explicitly.

As for exact vs. contains for file extensions, if you have files "something.h" and "something.html", the wildcard "*.h" would match only "something.h" with exact matching, and both files for contains.

There are three different settings for wildcard matching, because it makes sense to behave differently depending on the specificity of the wildcard.  That is why we have a setting for "*.ext" (matching a specific extension), other wildcard expressions, and non-wildcard matching.

Dennis

  • Senior Community Member
  • Posts: 3960
  • Hero Points: 517
Re: Open tool behavior
« Reply #4 on: December 20, 2016, 04:54:44 PM »
I'm going to file a defect report about this one, but for the time being, leave the behavior as it is.  Doing a recursive wildcard search in this context for the Open tool window could have pretty big performance considerations.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6864
  • Hero Points: 528
Re: Open tool behavior
« Reply #5 on: December 20, 2016, 09:57:29 PM »
The recursive options are limited to the workspace/project files for performance reasons.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Open tool behavior
« Reply #6 on: December 21, 2016, 12:55:54 AM »
That makes some sense, but even given that, there are still problems.
#1: The documentation (the little help box in tool->Options) says, or maybe implies strongly, that it does work recursively in the tree - not just in the workspace.
Also in the help file: Recursive contains matching - When selected, lists files from configured match groups (workspace, open files, history, current file directory) which contain the wildcard specified anywhere in the string. For example, "m*.c" will match a file called "main.cpp".


#2: When a recursive option is picked, it matches all files in the workspace, not just from the selected location in the tree and below.
So, if I select C:\src\foo\bar and enter the pattern "*.blat"
It shows all files in the workspace matching *.blat, not just those under C:\src\foo\bar.
The files in C:\src\foo\bar aren't even listed first - simply alphabetical.

"recursive" seems to mean "All files in the workspace"
"current directory" means just that.

#3: In Tools->Options The "*" in the file name patterns is screwed up by the "*" prefix that marks settings that have changed, but not yet applied.
See the attached images - notice it says "...style (File .cpp)" -- missing the *.


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6864
  • Hero Points: 528
Re: Open tool behavior
« Reply #7 on: December 21, 2016, 03:56:45 AM »
#1 this needs to be clarified. Maybe recursive can support files on disk in the future.
#2 Could also be clarified more. Current directory has no effect on recursive searches for workspace files as you've figured out. This would make smart open a pain to use if it did. The whole point is to forget about the path.
#3 good catch!

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6864
  • Hero Points: 528
Re: Open tool behavior
« Reply #8 on: January 26, 2017, 03:32:39 PM »
Joe, I'm trying to reproduce the problem with the missing * on *.ext. I thought I was able to reproduce this but now I can't. I've tried older v21 versions and modifying the field but no luck. If you can still reproduce this, please post how to reproduce this.

Thanks

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Open tool behavior
« Reply #9 on: January 26, 2017, 06:48:51 PM »
For any setting that you change, Slick adds a "*" prefix until you hit Apply.

In the "*.ext wildcard name match style" setting, change it.
Now it shows as:
" * *.ext wildcard name match style"

hit apply, and now it is:
"  .ext wildcard name match style"

Both "*"'s have been removed, even though it should only remove the prefix.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6864
  • Hero Points: 528
Re: Open tool behavior
« Reply #10 on: January 26, 2017, 07:13:47 PM »
I should have thought of that. Thanks for the help.