clemos / haxe-sublime-bundle

Sublime Text bundle for Haxe programming language
Apache License 2.0
235 stars 86 forks source link

Add support for "go to definition" using haxe 3.2 new --display @position feature #148

Closed nadako closed 10 years ago

nadako commented 10 years ago

This adds ctrl+] as a default shortcut for a new haxe_find_definition command that uses new haxe editor support features currently found in Haxe/git and soon(ish) in Haxe 3.2.

I had to hack the HaxeComplete.run_haxe command a bit to make it work, I guess it should be properly refactored to support new compiler features (toplevel completion, usage), but for now I think that change is quite minimal so it's okay.

Haxe supports finding positions of fields and local vars and to some extent of types.

clemos commented 10 years ago

Thanks a lot :D

clemos commented 10 years ago

And sorry for the delay, it seems I just forgot this PR...

clemos commented 10 years ago

I managed to make it work with current 3.1.3 release, but had to make a few fixes. I hope it doesn't break with latest Haxe git. Also, I changed the default key binding to Ctrl+<, as the one you chose didn't seem to work using a French keyboard :S Please let me know what you think. Great feature !

porfirioribeiro commented 10 years ago

Thanks for this feature! Could it be possible to map the shortcut to Ctrl+mouse click?

clemos commented 10 years ago

I don't think it's possible to use the mouse in custom shortcuts.