Home Download Buy Blog Forum Support

Scope Hunter

Scope Hunter

Postby facelessuser on Fri Mar 30, 2012 3:12 am

After goofing around with some others in another thread and debating with them the best way to get the scope, I put this together to accommodate everyone's preferences.

It supports multi-select. You can have it display the scope to in a popup output panel, you can have it just log the scopes to the console, and you can have the first selection's scope displayed in the status bar. It also allows you to display the extent of the scope by points or by line and column. You can have it copy the scopes to the clipboard for you, and you can also toggle an instant mode that will display the scope as you move your cursor around. All of these can be enabled or disabled.

This is really only useful for plugin developers.

https://github.com/facelessuser/ScopeHunter

It will hopefully be on Package Control soon.
facelessuser
 
Posts: 1448
Joined: Tue Apr 05, 2011 7:38 pm

Re: Scope Hunter

Postby facelessuser on Fri Mar 30, 2012 6:12 am

Version 0.4.0
- Add highlight scope extent option
- Remove console logging

Added new option to highlight extent to give you a visual representation of of like regions of scoping.
Screen Shot 2012-03-29 at 11.36.55 PM.png
Screen Shot 2012-03-29 at 11.36.55 PM.png (71.96 KiB) Viewed 5476 times


There is a configurable threshold, so it wont highlight your whole document if you click on something that is only scoped with something like python.source

I did end up removing console logging. Now this might make some people sad, but during instant scoping, you get sometimes multiple events for only one selection action which makes things confusing in the console, especially when you are using multi-select. With the panel and status bar, it is no big deal, because it just gets updated and the user is none the wiser, but with console, you get a list of all of the events and then you don't know which one is which.

Ultimately, I find performance more important than console logging. But if people really want console logging back, I will add it for non-instant scoping, and I will revert to the panel during instant scoping.
facelessuser
 
Posts: 1448
Joined: Tue Apr 05, 2011 7:38 pm

Re: Scope Hunter

Postby facelessuser on Fri Mar 30, 2012 3:22 pm

Console logging is back again. I worked out the issues.

Every plugin has different requirements, so it is hard to use one unaltered way to minimize on_selection_modified events to boost performance, and provide the exact functionality to you want. I spent a little time tweaking the Scope Hunter's algorithm, and I can now throw away the redundant console logging.

So those who enjoy sending the scope to console can now be happy. Sorry I pulled it prematurely.

I think that is it for this plugin. There really isn't much more to do with a scope plugin. Enjoy.

Version 0.4.1
- Console logging is back
facelessuser
 
Posts: 1448
Joined: Tue Apr 05, 2011 7:38 pm

Re: Scope Hunter

Postby nick. on Fri Mar 30, 2012 6:54 pm

Thanks faceless. I'm impressed by your speed of plugin development!
nick.
 
Posts: 266
Joined: Wed Jan 18, 2012 3:45 am

Re: Scope Hunter

Postby facelessuser on Fri Mar 30, 2012 7:06 pm

nick. wrote:Thanks faceless. I'm impressed by your speed of plugin development!


Thanks, but I am only fast because I have solved most of the same issues in other plugins. Not much original work needed to be done on this. Most of the code was copied and pasted from my other plugins. It is kind of like Lego code blocks. Grabbing the scope is easy, after that it was just grabbing the functional blocks from everything else I already have and doing a little tweaking for the specific purpose of this plugin.

Makes me seem faster than I am :).
facelessuser
 
Posts: 1448
Joined: Tue Apr 05, 2011 7:38 pm

Re: Scope Hunter

Postby nick. on Fri Mar 30, 2012 8:10 pm

Well that's good modularity then, still a skill!
nick.
 
Posts: 266
Joined: Wed Jan 18, 2012 3:45 am

Re: Scope Hunter

Postby quodlibet on Fri Mar 30, 2012 9:52 pm

@facelessuser:

You code/post/fork/bugfix/etc much faster than I can follow.

I had a bit of time to play around with the plugin (the pre-console version) earlier. I was so happy with the instant scoper, I didn't even miss the console.

Thanks again for a brilliant plugin.

(I had to throw together an "example" file, because the .tmLanguage I was working on has very long extents in "real world" files -- think Markdown paragraphs -- and I think the addition of the console will might help troubleshooting stuff down the line. So thank you also for working to include that :) )
quodlibet
 
Posts: 460
Joined: Sat Jun 18, 2011 5:53 pm

Re: Scope Hunter

Postby joemaller on Mon Jul 30, 2012 6:03 pm

Does this still work? Maybe I'm missing something obvious, but I've been fiddling with it on two different machines (dev build 2216 and v2.0.1 build 2217) and can't get anything to appear anywhere. Both installed via Package Control.
joemaller
 
Posts: 3
Joined: Mon Jul 30, 2012 5:09 pm

Re: Scope Hunter

Postby facelessuser on Mon Jul 30, 2012 7:27 pm

Works fine here. All of my plugins should be working on ST2 release.

How are you trying to invoke it?

It doesn't do anything automatically. You press ctrl+shift+p (replace ctrl with super if on mac) and start typing scope hunter. You will see two options, one that will show the scope under the cursor, and one that will toggle instant scoping on which will constantly show you the scope every time you move the cursor (this can be toggled back off when you are done using it. Depending on your scope hunter settings, this will highlight the current scope (if it doesn't extend too far), show the scope in the console, show scope in a special popup panel, show scope in the status bar, copy scope to clipboard, etc. blah, blah, you get the idea.
facelessuser
 
Posts: 1448
Joined: Tue Apr 05, 2011 7:38 pm

Re: Scope Hunter

Postby handycam on Wed Oct 24, 2012 2:38 pm

This is an incredibly useful plug-in, thank you for making it available!
Mac OS 10.8.5
ST 3 (3053)
handycam
 
Posts: 269
Joined: Tue Jan 03, 2012 2:42 pm

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 4 guests