In visual studio, I can search (Ctrl+Shift+F) through all the classes/files for anything with given keywords, like variables, methods, method invocation, ect. I want to find where a sk method get called in the demo sk scripts,but it seems I can’t do that in the SK IDE. Could you tell me how to do that in the IDE? Thanks!
The current SkookumIDE does not have a “find all in files” though it eventually will.
We didn’t want to spend a lot of time reinventing the wheel with such common features so we tried to make it easy to integrate existing tools with the SkookumIDE.
The quickest way to get “find all in files” working with the current SkookumIDE is to associate another text editor with
.sk files. (I use Notepad++ it is pretty good and free.) Then when you are in the SkookumIDE and on some
.sk file in the Console workspace or some other file in the Browser editor you can press the
E hotkey and it will open it with that
.sk associated editor.
Then you can use all the many features of your other editor including “find all in files”.
You can add all sorts of SkookumScript superpowers to other editors including toggling back to the SkookumIDE.
Also check out this post which discusses the related topic of enabling another text editor to run SkookumScript commands just like the SkookumIDE Console.
Symbolic Searching (Goto)
[Note this is in the old SkookumIDE that uses the WinAPI for its UI. The new SkookumIDE that uses the Slate API for its UI does its searching by looking for substrings typed into the search field at the top of the “Classes” and “Members” tabs.]
The SkookumIDE (old WinAPI UI) does have a symbolic search mechanism to find the source for a particular class, data member or routine. This is probably the reverse that you are looking for though it is very useful. There are several variations and you can see all of them by looking at the SkookumIDE “Goto” menu.
The simplest way to use it is to press
G on some text in the SkookumIDE workspace or editor. (If you are familiar with it, this is similar to Visual Assist.) It will pop you right to where that class, data member or routine is defined. You can also use the “Goto” menu or its various hotkeys to bring up a dialog to specify what you want to search for. For example
G searches for routine matches and
C searches for class matches. Once the “Go To” dialog is up you can press other hot keys to change its mode.
Here are the rules used by the symbolic search:
abcplain text will try to match anything that has it as a sub-string
abc*ending with an asterisk
*indicates that matches should start with the sub-string
*abcstarting with an asterisk
*indicates that matches should end with the sub-string
"abc"quoted text looks for an exact symbol match and not a sub-string.
MyClass.abcan initial class will only look for matches in classes that match the initial text - which may also follow the same rules
If a single match is found it will immediately jump to the match. If multiple matches are found then a list of matches will be displayed. If you right mouse click on a match in the list you can see a number of choices that you can make including a double click to jump to that particular match.
Use class names as a filter when searching for members
Understanding the basics, but now how do I apply it?
Great curated posts to learn about SkookumScript
Thanks a lot~ great answer, it’s very thorough~looking forward to the new version
I heartily recommend a program called “Windows Grep” (for windows users at least, If you can still find it).
It will search for a string in (all or customizable) files in a set of folders. It integrates into the windows shell, so you just right click the desired folder and choose Windows Grep.
This opens a window where you can choose the search string.
So for example you can search for Myclass.abc in *.SK which would find all Files (and all locations in those files) where Myclass.abc exists but only in files that end in .SK
I am uncertain what happened to the caretakers of Windows Grep, but I use an older version without issues.
Yes, a mechanism such as this is the best way to go until we have a find in files mechanism native to the SkookumIDE.
AstroGrep also works well.
The ability to search for all places that a search term is located in, is a critical feature that is still needed.
For example, let’s say If I Right Click on _boom and choose “goto definition” that works to find the definition but does not help to locate scripts that are using _boom.
There should be a way to find all occurrences of _boom and place them in a list, which I can parse 1 by 1.
Has this been implemented yet? If so, how do I access it?
Not yet. But there are some good alternatives that you can integrate well thanks to the SkookumIDE’s command line parameters.
I use AstroGrep for this and it’s as simple as right-clicking my Scripts/Project folder and selecting search here.
Searching for what I want
I have AstroGrep configured to recognize sk file types and execute
SkookumIDE.exe with the parameters
-b %1. So double-clicking a file will navigate to it in SkookumIDE.
Having this built into SkookumIDE at some point will be great, but until then, leveraging your favorite editor (Atom, Notepad++, Visual Studio) or grep utility is the best option.
Right… I use WindowsGrep… similarly. Glad to know about AstroGrep tho!
But, having this in the IDE, seems much more intuitive then windowing out of the IDE to go to the folder and do a search that way.
Just an FYI in case you guys plan on adding some features to the IDE.