clemos / haxe-sublime-bundle

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

Build problems again on build 3080 and 3083 #221

Closed ciscoheat closed 9 years ago

ciscoheat commented 9 years ago

I'm experiencing same problem as #209 again, also on build 3083 (Win 7 x64). This time the syntax highlighting disappeared, and after using "Set Syntax: Haxe" on one file and pressing Ctrl-Enter, no output is generated. It finds all the hxml files however with Ctrl-B, giving me a selection, but same result for all with Ctrl-Enter.

Tried it on multiple projects and on Flashdevelop, so there's nothing wrong with the installation or compilation server. One or more haxe.exe processes are still hanging after I close Sublime.

I have cloned this repo and installed it manually, so let me know if I can assist in debugging.

ghost commented 9 years ago

Try to reinstall sublime text and use default settings.

ciscoheat commented 9 years ago

That took care of the missing syntax highlighting, but still having the same problem with compiling using Ctrl-Enter.

ghost commented 9 years ago

It finds all the hxml files...

Can you share them?

ciscoheat commented 9 years ago

Sure, it's this repo: https://github.com/ciscoheat/mithril-hx It should compile right out-of-the-box with haxe webshop.hxml for example. There's even a sublime project file included there.

ghost commented 9 years ago

Works in my case. What you get in sublime's console (View-Show console) after you press Ctrl+Enter?

ciscoheat commented 9 years ago
Running haxe --connect 6001 --cwd E:\Projects\Haxe\mithril --no-output -cp example -lib mithril -js bin/webshop/webshop.js -main webshop.Webshop
ghost commented 9 years ago

Try to comment these lines in HaxeComplete.py (line ~2230):

if os.name == "nt":
    err_type = WindowsError

Or delete them.

ciscoheat commented 9 years ago

Sorry, that didn't change anything. :(

ghost commented 9 years ago

Ok, maybe this will help:

err_type = Exception
#if os.name == "nt":
#   err_type = WindowsError
ciscoheat commented 9 years ago

That didn't help either. I'm studying the source (HaxeComplete.py), where is the building taking place? Also, what is the purpose of --no-output when compiling?

ghost commented 9 years ago

In your case here:

class HaxeExecCommand(ExecCommand):
def run(...)

But I'm not sure.

ghost commented 9 years ago

Try to replace all append_data methods with append_string.

ciscoheat commented 9 years ago

Sorry, no luck there. It generates output if I comment out args.append( ("--no-output",) ) around line 1547.

ghost commented 9 years ago

It seems that this commit causes this issue.
Try to indent this code:

        if build.yaml is not None :
            # Call out to `flambe haxe-flags` for Flambe completion
            res, err = runcmd( ["flambe","--config" , build.yaml, "haxe-flags"] )
            if err :
                print("Flambe completion error: " + err)
            else:
                args += [(arg,) for arg in res.split("\n")]
            args.extend( build.args )
        elif build.nmml is not None :
            settings = view.settings()
            haxelib_path = settings.get("haxelib_path" , "haxelib")
            # print(build.nmml, HaxeBuild.nme_target[1].split(" ")[0])
            res, err = runcmd( [
                haxelib_path, 'run', 'openfl', 'display',
                build.nmml, HaxeBuild.nme_target[1].split(" ")[0]] )
            if err :
                print("OpenFl completion error: " + err)
            else:
                args += [(arg,) for arg in res.split("\n")]
        else:
            args.append( ("--no-output",) )
            output = build.output
            if output is None :
                output = "no-output"
            #args.append( ("-cp" , plugin_path ) )
            #args.append( ("--macro" , "SourceTools.complete()") )

            args.extend( build.args )
ciscoheat commented 9 years ago

Indenting cleared the whole command line buildup, so that didn't work. But I found no further usage of the output var, so changing the last else to:

        else:
            if build.output is None :
                args.append( ("--no-output",) )
            #args.append( ("-cp" , plugin_path ) )
            #args.append( ("--macro" , "SourceTools.complete()") )

            args.extend( build.args )

Seems to have fixed the problem. Let me know if I should make a PR.

ghost commented 9 years ago

It was my mistake in this commit. Please try the lattest version. I'm sure it fixes the issue. Thanks for testing.

ciscoheat commented 9 years ago

It works, thanks. :)

andyli commented 9 years ago

It works on my side too. Sorry for the earlier breaking commit. I've added a test in #222, so hopefully it will never be broken again :)