Sublime Forum

ST3: ScopeHunter

#15

[quote=“jfcherng”]Before I find ScopeHunter, I used Scope​Always.
And I tried ScopeHunter, it has a noticeable delay while ScopeAlways is real time.
If ScopeHunter can act more fast, it would be good!![/quote]

First, this is by design. Second, seriously, how fast are you reading scopes?

When I tap into something like on_modified and/or on_selection (which will literally run on every keypress and every cursor move), I make sure to check if multiple requests are coming in too fast (doing a lot of quick typing). That way, I can hold off on executing the payload until constant requests slow down or finish coming in (stop typing). Basically, I have given everyone a respectful plugin that won’t bog down when people are doing a lot of typing or holding down the arrow key for cursor navigation (python isn’t nearly as fast as native C). I personally think the current delay is fine and have felt no reason to tweak it.

Granted ScopeAlways does very little except post the scope in the status bar, so it isn’t going to impact performance much, nor will ScopeHunter if you turn off most of the other stuff, but it can also do much more as well. I wrote ScopeHunter first, and foremost, for myself. I’m not going to try and convince anyone to use my plugin, so if another plugin works better for you, please use that one instead. I personally like ScopeHunter and found it useful when writing language syntaxes and other various things, which is why I still support it :wink:.

0 Likes

#16

Release 1.4.3

A lot of visual tweaks and re-formatting. CSS has been re-worked a bit, and now uses classes for a bit of the styling. Now that Jon added scrolling in Windows, it should be more usable there, but I have not yet tested Windows. As always, let me know if I broke something, or there is something you want to see. I have only a couple more things I am considering looking into. We’ll see if I get those out sometime soon.

0 Likes

#17

Release 1.4.4

  • Copy links to copy specific data from tooltips
  • SubNotify plugin support for visual feedback messages
  • Some reformatting of info

0 Likes

#18

FYI, I am aware that the individual copy links in tooltips don’t work with multi-selection; I am working on it. I am wrapping up the rest of my planned features and fixes for the next release.

0 Likes

#19

Release 1.4.5 github.com/facelessuser/ScopeHu … /st3-1.4.5:

  • Fixed multi-select tooltip copy link issues
  • Better scope extent detection
  • Small formatting changes

Earlier it was asked if ScopeHunter can just display scopes, and the answer is yes. By default, scope is the only think enabled. All other advanced things must be enabled by the user. So here is just scopes.

I think we can call this done until Jon tweaks the API. Formatting may change a little if Jon adds new CSS and/or HTML capabilities, but functionality is complete unless anyone finds any more bugs.

0 Likes

#20

Not works. Nothing happens when select either menu on Command Pallete
ST3 b3071, installed via Package Control
I tested the default tooltips still work:self.view.show_popup('Hello, <b>World!</b><br><a href="moo">Click Me</a> <style>color=red</style>', on_navigate=print)
My User Settings:{ "show_popup": true, "show_statusbar": true, }

0 Likes

#21

Did you restart sublime after installing?

0 Likes

#22

yes, I did restarted ST
btw, I’m on Win 7 x64, STx64

0 Likes

#23

I can’t think of any windows specific things that would break it. Are you getting errors in the console?

0 Likes

#24

reloading plugin ScopeHunter.scope_hunter reloading Packages/ScopeHunter/scope_hunter.sublime-settings reloading plugin ScopeHunter.scope_hunter_notify Unhandled exception in thread started by <function sh_loop at 0x0000000004984488> Traceback (most recent call last): File "scope_hunter in C:\Users\Fichte\AppData\Roaming\Sublime Text 3\Installed Packages\ScopeHunter.sublime-package", line 629, in sh_loop AttributeError: 'NoneType' object has no attribute 'ignore_all'

Edit: That only happens when disabling and enabling the plugin btw. You should close the sh_loop thread in plugin_unloaded.

Other than that it works fine. I’m just a bit annoyed by the verbosity, imo the information can be condensed quite some.

Edit2: Your usage of the global keyword is also rather inconsistent. Sometimes you use it (when you don’t need to) and sometimes you don’t. You generally only need to use it when assigning to a non-local variable, reading will be forwarded upwards.

Edit3: In fact, I would prefer nonlocal in pretty much all cases since you define the default value very early in the code and it’s a more defensive style of coding because trying to reference a non-existant nonlocal identifier raises while globaling one just creates it (and is not a great idea in general).

0 Likes

#25

Yeah, that is a scenario I haven’t bothered to test. I can look into that. So, basically it works in Windows; that’s what I thought because I haven’t changed anything since Friday (when I last tested Windows) that would be platform specific.

I am open to suggestions.

Yeah, some of that could be cleaned up, but it isn’t really a big deal. I only really need it when I am directly changing the variable. I can modify the object all day long without needing to use “global” since I am not changing the actual variable, but everything works, so that kind of stuff usually gets overlooked.

0 Likes

#26

Release 1.4.6

Thanks to @FichteFoll for finding it, a bug where when disabling and reenabling a package caused an error has now been fixed. This bug actually existing on a number of my plugins that employ the same threading mechanism, so it was good to get this fixed across the board.

I have verified this works in OSX and Windows. So I will need more info from you, @Binocular222, if I am to troubleshoot your issuer further. I would look in the console, and also check if other plugins are somehow interfering, double check your settings file is not corrupt, and possibly consider a Sublime revert as I am unable to reproduce your issue.

0 Likes

#27

Still nothing happens, even console display nothing

0 Likes

#28

Make sure the package isn’t disabled in Package Control (I’ve seen package control do that on occasion, but I imagine you wouldn’t see the plugin commands in the command palette if that was the case; but check anyways). If that doesn’t work, try a Sublime revert. Right now, that is the best I can offer as I am on Windows x64 ST3x64@3071 and it is working fine for me. Without any additional info, I can only assume you have some local anomaly that no one else has; I simply cannot fix what I cannot observe to be broken, I am sorry I can’t do more.

0 Likes

#29

Release 1.5.0

Changes

  • Tooltips are less verbose
  • Tooltips are more compact
  • Tooltips now generate images for color boxes
  • CSS changes to tooltips
  • Better control of tooltip content
  • Dividers between multiselect scopes
  • Added messages.

Important!
Tooltips now only work on 3072. There were some changes in the Sublime API that Scope Hunter is now taking advantage of, so if you want tooltips to still look good, please upgrade Sublime to 3072 or disable tooltips.

There have also been some settings changes to give users even better control of the info shown:

  • Discontinue show_color_scheme_info settings.
  • Added styling, selectors, and file_paths options to show respective info.
  • Remove css_file setting. ScopeHunter now always uses either dark or light css depending on brightness of the user’s color scheme. So if you would like to change the tooltip theme, please override those in the settings file.
0 Likes

#30

Given some time, I may be able to generate transparent color boxes that show a checkered pattern behind it. Completely possible now that I am generating images for color boxes :ugeek:.

0 Likes

#31

Had a little more time and got transparent color squares working which will be included in the next release.

I probably won’t make another release until I am certain the tooltip API isn’t going to change much anymore, or when the next public beta hits.

0 Likes

#32

ScopeHunter 2.8.0 is released and handles .sublime-color-scheme files. Should show results based on overrides as well. Some things it may have shown before may not be shown now due to the way data is acquired via the new API, but a plus side is ScopeHunter will now always show the most up to date info while before it could show slightly old info if the color scheme was updated behind the scenes.

Again, let me know if you run into bugs in the latest release.

0 Likes

#33

Just an FYI for people using ScopeHunter on 3150+. Due to the new override system of scheme files, and the fact that the API only exposes the merged final style, I can’t provide info anymore like the scope responsible for bold or italic, or what scope influenced the background etc. So the fact that they aren’t shown was done on purpose.

I have the ability to parse the format, but I don’t have an easy way to aggregate all the overrides and essentially import a single merged copy. It could be done if I scanned all the packages and merged each override (assuming I could reliably get the order correctly), but I imagine there is no solid way to guarantee I’d get the order correct…and I’m not going to spend time scanning all the packages. If there ever is a way to pull in the fully merged copy of the scheme to parse it raw, then this will change, but since that is not currently possible, some info you may be used to is omitted.

0 Likes

#34

Relevant discussion:

0 Likes