Zinggi/UnrealScriptIDE

Any plans to support Sublime Text 3?

margaretdax opened this issue · 11 comments

Any plans to support Sublime Text 3?

This is the log I get when I try to install your package under ST3

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\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:\Program Files\Sublime Text 3\sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "UnrealBuildSystem in C:\Users\lblackburn\AppData\Roaming\Sublime Text 3\Installed Packages\UnrealScriptIDE.sublime-package", line 69
    print "Src folder not found!!!"
                                  ^
SyntaxError: invalid syntax
reloading plugin UnrealScriptIDE.UnrealDebuggerIntegration
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\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:\Program Files\Sublime Text 3\sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "UnrealDebuggerIntegration in C:\Users\lblackburn\AppData\Roaming\Sublime Text 3\Installed Packages\UnrealScriptIDE.sublime-package", line 29
    print "Src folder not found!!!"
                                  ^
SyntaxError: invalid syntax
reloading plugin UnrealScriptIDE.UnrealScriptIDEClassBrowser
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\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:\Program Files\Sublime Text 3\sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "UnrealScriptIDEClassBrowser in C:\Users\lblackburn\AppData\Roaming\Sublime Text 3\Installed Packages\UnrealScriptIDE.sublime-package", line 67
    print "open"
               ^
SyntaxError: invalid syntax
reloading plugin UnrealScriptIDE.UnrealScriptIDEData
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\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:\Program Files\Sublime Text 3\sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "UnrealScriptIDEData in C:\Users\lblackburn\AppData\Roaming\Sublime Text 3\Installed Packages\UnrealScriptIDE.sublime-package", line 113
    print "class ", out_of.name(), " not parsed yet, parse class now..."
                 ^
SyntaxError: invalid syntax
reloading plugin UnrealScriptIDE.UnrealScriptIDEGoToDeclaration
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\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:\Program Files\Sublime Text 3\sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "UnrealScriptIDEGoToDeclaration in C:\Users\lblackburn\AppData\Roaming\Sublime Text 3\Installed Packages\UnrealScriptIDE.sublime-package", line 14, in <module>
ImportError: No module named 'UnrealScriptIDEMain'
reloading plugin UnrealScriptIDE.UnrealScriptIDEMain
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\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:\Program Files\Sublime Text 3\sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "UnrealScriptIDEMain in C:\Users\lblackburn\AppData\Roaming\Sublime Text 3\Installed Packages\UnrealScriptIDE.sublime-package", line 129
    print "startup: start parsing classes..."
                                            ^
SyntaxError: invalid syntax
reloading plugin UnrealScriptIDE.UnrealScriptIDEParser
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\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:\Program Files\Sublime Text 3\sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "UnrealScriptIDEParser in C:\Users\lblackburn\AppData\Roaming\Sublime Text 3\Installed Packages\UnrealScriptIDE.sublime-package", line 40
    print "cache exists. Loading classes from memory"
                                                    ^
SyntaxError: invalid syntax
generating syntax summary
generating meta info summary
found 4 files for base name Default.sublime-keymap
found 2 files for base name Default.sublime-mousemap
found 3 files for base name Main.sublime-menu
loading pointer bindings
reloading Packages/User/Preferences.sublime-settings
found 1 files for base name Default.sublime-theme
theme loaded

For a long time I thought I wouldn't be adding support for ST3, but since the new ST3 Beta is now public, I might just do it.
Most compatibility issues come from the change to the print function from python 2 to 3, but it shouldn't be a big problem to fix these. But it might be that the ST api got some changes, so it would be hard to make the plugin be compatible for different apis.

When I find some time, I'll have a look into this.

I tried it out, but there seem to be many problems going on.

The basics steps are:
replace print something to print(something)
replace except Error, e to except Error as e
replace import SomeUnrealScriptIDEModule to import UnrealScriptIDE.SomeUnrealScriptIDEModule

Those are the simple things to fix, and that way some parts would already run, however most wouldn't.
There seem to be many problems with the threading module, but I really don't have the time to investigate those.

You're of course free to try to port it by yourself.

So I won't try to port it in the near future, but I might have a look at it again when ST3 if officially released.

Best regards,
Zinggi

I don't really have the time to, but good to hear it might be ported after ST3 officially releases.

Thanks :)

How difficult do you think it would be to port this to ST3 if a few of us contribute? I'm willing to help in the near future if I can.

It shouldn't be too difficult, it's probably just a matter of adding some:

try:
    import blabla
except ImportError:
    import UnrealScriptIDE.blabla

At the top and replacing some print statements.
But I'd have to read through some other plugins that support both version to see what the best practise is and how they deal with different versions.

You're of course welcome to help, just fork this repo and send me a pull request if you have made some useful changes.

I like this one better:

ST3 = int(sublime.version()) > 3000

if ST3:
    import ...
else:
    import ....

Cool. I'll look into it when I have some free time in the coming weeks. :)

Would be supercool!

I took some time over this weekend to port it over to ST3.

Everything is working pretty good, however there is a major bug that prevents me from releasing this to the public yet: #21
If anyone of you could help find the issue, that would be awesome. Also, can you confirm that this bug is also happening on your pc and not only on mine?

Also, before I release the update, I have to make sure I haven't broken anything in ST2..

Thanks for your help!

Here's the ST3 branch: https://github.com/Zinggi/UnrealScriptIDE/tree/ST3

Alright, that's fixed, gonna merge the ST3 branch soo.

Hope I didn't introduce any bugs ;)