Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements.. #7

Merged
merged 25 commits into from Jun 10, 2014

Conversation

@titoBouzout
Copy link
Contributor

titoBouzout commented Jun 8, 2014

Hi ! thanks for this package, very handy. I was worried about "scanning the complete folders on save", and took a look.. started doing some small improvements and ended doing a lot, but basically keeps the same heart. Here a somewhat complete list:

  • compile regular expressions at startup
  • add preferences to exclude folders and files
  • fix bug in regular expressions where in some situations more than the signature may be added
  • enable to work on unsaved files, these that hint JavaScript syntax
  • enabled in JavaScript scopes (eg in html 'script' tags)
  • only crawl the saved file if it is a JavaScript file
  • get signatures from all the windows
  • get signatures from all the opened views
  • simplifications
  • on post save runs async
  • parse opened files outside of this current project/folder only if it is not already indexed
  • avoids duplicates files and folders added by project folders duplicating paths
  • avoids duplicate signatures for the same file
  • watch for folders changes
  • only reparse files that have been modified

The major change is:

  1. Folders are scanned only the first time these are seen.
  2. Individual files are scanned when saving, and just that file
@titoBouzout

This comment has been minimized.

Copy link
Contributor Author

titoBouzout commented Jun 8, 2014

yay! just added option to iterate over arguments with tab key. https://github.com/titoBouzout/MySignaturePlugin/commit/1d0792482be1945908ca6de06d43291bdd4371d7

@eladyarkoni

This comment has been minimized.

Copy link
Owner

eladyarkoni commented Jun 9, 2014

Hi,
Thanks for your changes but its not working now.
Line 184 must run in main thread.
The plugin doesn't work after your commit and fire this exception:

Unhandled exception in thread started by <function folder_change_watcher at 0x10daa9758>
Traceback (most recent call last):
File "./mysign.py", line 184, in folder_change_watcher
RuntimeError: Must call on main thread, consider using sublime.set_timeout(function, timeout)

Please fix that issue, make a pull request again and I'll merge it.
and thanks again!

Elad

@titoBouzout

This comment has been minimized.

Copy link
Contributor Author

titoBouzout commented Jun 10, 2014

Added completions for "var" names of the current file, and also for functions (for when the current file is not yet saved) :)

Let me check these ST2 quirks.. you are seeing.. I use ST3! Poof

@titoBouzout

This comment has been minimized.

Copy link
Contributor Author

titoBouzout commented Jun 10, 2014

It should just work now, readme needs update, I'm on it.

@titoBouzout

This comment has been minimized.

Copy link
Contributor Author

titoBouzout commented Jun 10, 2014

OK, I added a monitor to the thread with a timeout (just in case[as the original intention of this package]). Replaced the recursive scanning for "os.walk" which is running super fast. I consider it done. I can't find more optimizations to add. Also tested in ST2. May using it a little bit we found minor corrections.

I think we should add a license, what about GPL2?

@eladyarkoni eladyarkoni merged commit 9925ff1 into eladyarkoni:master Jun 10, 2014
@eladyarkoni

This comment has been minimized.

Copy link
Owner

eladyarkoni commented Jun 10, 2014

Done!
I added MIT license.
Thanks for your work!
Elad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.