clemos / haxe-sublime-bundle

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

Sublime Text keep asking to reload the .hx file and the .tmp file sticks around. #244

Closed aaulia closed 9 years ago

aaulia commented 9 years ago

So I have a cpp build.hxml with the following haxe libs

IIRC mcli uses macro. Everytime I triggered a completion Sublime asked me to reload the .hx file since it's "modified" an the .tmp file is not deleted. I'm not sure when exactly this happen, but IIRC it's when I started using Type Parameter and Lambda pretty heavily. (like .map inside a .map).

clemos commented 9 years ago

Do you get any error in the ST console ?

aaulia commented 9 years ago

Hmm, let me check.

Package Control: No updated packages
Starting Haxe server on port 6001
Traceback (most recent call last):
  File "C:\Program Files (x86)\Sublime Text 3\sublime_plugin.py", line 359, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "HaxeComplete in C:\Users\...\AppData\Roaming\Sublime Text 3\Installed Packages\Haxe.sublime-package", line 1915, in on_query_completions
  File "HaxeComplete in C:\Users\...\AppData\Roaming\Sublime Text 3\Installed Packages\Haxe.sublime-package", line 2090, in get_haxe_completions
  File "HaxeComplete in C:\Users\...\AppData\Roaming\Sublime Text 3\Installed Packages\Haxe.sublime-package", line 1828, in run_haxe
  File "features.haxe_helper in C:\Users\...\AppData\Roaming\Sublime Text 3\Installed Packages\Haxe.sublime-package", line 154, in parse_sig
IndexError: pop from empty list
aaulia commented 9 years ago

Hi, FWIW, I tested my project in FD using Haxe C++ Project. the completion work as intended, no modification whatsoever in the file.

wiggin77 commented 9 years ago

I have the same issue. ST3, Haxe 3.2, JS target. Using promhx lib from haxelib. Auto-complete on items from promhx lib seems to trigger it for me.

Starting Haxe server on port 6001 Traceback (most recent call last): File "/opt/sublime_text/sublime_plugin.py", line 359, in on_query_completions res = callback.on_query_completions(v, prefix, locations) File "HaxeComplete in /home/dlauder/.config/sublime-text-3/Installed Packages/Haxe.sublime-package", line 1915, in on_query_completions File "HaxeComplete in /home/dlauder/.config/sublime-text-3/Installed Packages/Haxe.sublime-package", line 2090, in get_haxe_completions File "HaxeComplete in /home/dlauder/.config/sublime-text-3/Installed Packages/Haxe.sublime-package", line 1828, in run_haxe File "features.haxe_helper in /home/dlauder/.config/sublime-text-3/Installed Packages/Haxe.sublime-package", line 154, in parse_sig IndexError: pop from empty list

ghost commented 9 years ago

Should be fixed. Please confirm.

aaulia commented 9 years ago

Confirmed, it's fixed.

On unrelated note, congrats and thank you for showing the function parameters in a popup. My days of glancing on the status bar is over (^_^)/.

wiggin77 commented 9 years ago

This problem has come back after an update yesterday (Aug 22). Regression?

Traceback (most recent call last): File "/opt/sublime_text/sublime_plugin.py", line 359, in on_query_completions res = callback.on_query_completions(v, prefix, locations) File "HaxeComplete in /home/dlauder/.config/sublime-text-3/Installed Packages/Haxe.sublime-package", line 1940, in on_query_completions File "HaxeComplete in /home/dlauder/.config/sublime-text-3/Installed Packages/Haxe.sublime-package", line 2115, in get_haxe_completions File "HaxeComplete in /home/dlauder/.config/sublime-text-3/Installed Packages/Haxe.sublime-package", line 1853, in run_haxe File "features.haxe_helper in /home/dlauder/.config/sublime-text-3/Installed Packages/Haxe.sublime-package", line 179, in parse_sig IndexError: pop from empty list

ghost commented 9 years ago

Are you using promhx lib? Please share the code that causes this issue. Like this:

var p = new Promise<Int>().|
wiggin77 commented 9 years ago

Yes, I happen to be using promhx. Also using hxnodejs but those are the only two libs.

Once the error happens, it happens for every completion popup within the file being edited, regardless of position within the file. For example, once the error occurs once, any of these will trigger it every time:

var | tra|

The error only occurs in a single file. A temp file sticks around as well.

The project is on Githib. It is a bunch of externs for MongoDb and Mongoose. https://github.com/wiggin77/HxMongoNode

Editing this file triggers the issue for me 100% of the time on multiple machines: https://github.com/wiggin77/HxMongoNode/blob/master/test/src/com/dal/mongotest/TestMongoose.hx

wiggin77 commented 9 years ago

I have chopped it down to a small reproducible bit of code. Error occurs at var|. src/Test.hx

package ;
import promhx.Promise;
class Test {
    public static function series<T>(calls:Array<Void->Promise<T>>) : Void  {
        var|
        return null;
    }
    public static function main() {
        trace("hi");
    }
}

build.hxml

-cp src
-lib promhx
-main Test
-js test.js
ghost commented 9 years ago

Thanks, now I can reproduce it.

ghost commented 9 years ago

I hope it fixed. Delete all generated *.tmp files in your file manager after update.

wiggin77 commented 9 years ago

Reload dialog no longer popping up. No more tmp files left behind. No errors in console.

Thanks for the quick fix.