clemos / haxe-sublime-bundle

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

Exception in HaxeComplete on ST3 3035 #84

Closed nadako closed 11 years ago

nadako commented 11 years ago

Haxe completion doesn't work for me on Sublime Text 3035 (from here http://www.sublimetext.com/3dev). If I press ctrl+`, I see this exception there:

reloading plugin Haxe.HaxeComplete
Traceback (most recent call last):
  File "C:\Users\nadako\SublimeText\sublime_plugin.py", line 73, in reload_plugin
    m = importlib.import_module(modulename)
  File "X/importlib/__init__.py", line 88, in import_module
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "C:\Users\nadako\SublimeText\Data\Installed Packages\Haxe.sublime-package\HaxeComplete.py", line 153, in <module>
  File "C:\Users\nadako\SublimeText\Data\Installed Packages\Haxe.sublime-package\HaxeComplete.py", line 136, in scan
  File "C:\Users\nadako\SublimeText\Data\Installed Packages\Haxe.sublime-package\HaxeComplete.py", line 52, in runcmd
  File "X/subprocess.py", line 818, in __init__
  File "X/subprocess.py", line 1049, in _execute_child
  File "X/subprocess.py", line 627, in list2cmdline
TypeError: Type str doesn't support the buffer API
clemos commented 11 years ago

I just committed an attempt to fix this. What OS are you using ? So far I only tested it on Ubuntu 64...

clemos commented 11 years ago

I've committed more fixes while testing on Windows. Please confirm I can close the issue.

nadako commented 11 years ago

It is windows 8 64-bit. For some reason haxe bundle won't upgrade via package control for me, so I checked it out with git clone. And now I get this when trying to open hx file.

Traceback (most recent call last):
  File "C:\Users\nadako\SublimeText\sublime_plugin.py", line 303, in on_activated
    callback.on_activated(v)
  File "C:\Users\nadako\SublimeText\Data\Packages\haxe-sublime-bundle\HaxeComplete.py", line 774, in on_activated
    return self.on_open_file( view )
  File "C:\Users\nadako\SublimeText\Data\Packages\haxe-sublime-bundle\HaxeComplete.py", line 784, in on_open_file
    HaxeCreateType.on_activated( view )
  File "C:\Users\nadako\SublimeText\Data\Packages\haxe-sublime-bundle\HaxeComplete.py", line 611, in on_activated
    e = view.begin_edit()
TypeError: begin_edit() missing 2 required positional arguments: 'edit_token' and 'cmd'
clemos commented 11 years ago

This other issue shouldn't be blocking. I have yet to figure out how to fix it. Can you confirm most features work anyway ?

nadako commented 11 years ago

Well yeah, everything works apart from code completion :)

clemos commented 11 years ago

I believe it should be fixed now, please let me know.

nadako commented 11 years ago

It now crashes with other exception when opening hx or hxml file:

Traceback (most recent call last):
  File "C:\Users\nadako\SublimeText\sublime_plugin.py", line 303, in on_activated
    callback.on_activated(v)
  File "C:\Users\nadako\SublimeText\Data\Packages\Haxe\HaxeComplete.py", line 770, in on_activated
    return self.on_open_file( view )
  File "C:\Users\nadako\SublimeText\Data\Packages\Haxe\HaxeComplete.py", line 784, in on_open_file
    self.extract_build_args( view )
  File "C:\Users\nadako\SublimeText\Data\Packages\Haxe\HaxeComplete.py", line 997, in extract_build_args
    folder = os.path.dirname(fn)
  File "X/ntpath.py", line 316, in dirname
  File "X/ntpath.py", line 280, in split
  File "X/ntpath.py", line 208, in splitdrive
TypeError: object of type 'NoneType' has no len()
nadako commented 11 years ago

Also, haxe plugin disappeared from Package Control for some reason. Maybe it's related to repository rename (haxe-sublime2-bundle -> haxe-sublime-bundle

clemos commented 11 years ago

Ok I believe I've fixed it all this time. I've also sent a pull request to PC to make it reappear...

nadako commented 11 years ago

Thanks! It seems to work now!

clemos commented 11 years ago

Great ;)