jcward / vscode-haxe

Haxe language extension for Visual Studio Code
MIT License
64 stars 10 forks source link

code completion not working (kha, compiler err - html5-resources/files.json) #2

Closed lewislepton closed 8 years ago

lewislepton commented 8 years ago

this has just turned up. but the auto-complete is pretty sketchy. same with the forked repo by @pleclech - dont know what it is. on files within folders, even the top most ones.

this is using kha, heaps. not tried openfl

but this is just recently

jcward commented 8 years ago

What does "pretty sketchy" mean? Sometimes it doesn't work? Does it just not show up? Can you take a screenshot (or paste the code here) that it's not working with?

Thanks!

lewislepton commented 8 years ago

yeah. it sometimes does not come on. then when i was trying to catch it, it started after 5 mins.

ill try and catch it after work today

lewislepton commented 8 years ago

though have noticed that within some lines of code later it has trouble. but again ill try and catch it

pleclech commented 8 years ago

You can always launch in a console haxe -v -wait 6000 and see what's going on on completion, maybe the time spent by the compiler on big project is litle high ?

lewislepton commented 8 years ago

@pleclech cool spot.

well did do that and did spot a few things. in a very small project. just a few files [3 in my project]. it churns this out

Client connected
Waiting for data...
Reading 150 bytes
Processing Arguments [--cwd,/Users/lepton/Developer/Kha/GAMES/HIRVIO,build.hxml,--no-output,--display,/Users/lepton/Developer/Kha/GAMES/HIRVIO/Sources/GameState.hx@1131]
Parsed /Users/lepton/Developer/Kha/GAMES/HIRVIO/Sources/GameState.hx
> /usr/local/lib/haxe/std/neko/_std/sys/io/File.hx:30: characters 20-51 : html5-resources/files.json: No such file or directory
> /usr/local/lib/haxelib/kha/git/Sources/kha/internal/AssetsBuilder.hx:41: characters 27-74 : Called from
> /usr/local/lib/haxelib/kha/git/Sources/kha/Assets.hx:36: characters 2-7 : Called from
> Aborted
Stats = 1 files, 110 classes, 918 methods, 1 macros
Time spent : 0.110s
Compacted memory 0.100s 16.5MB

what i am checking is the player.x, but that does not pop up at all

lewislepton commented 8 years ago

this seems to be the problewm with other files that are not the Main.hx, also any other files

lewislepton commented 8 years ago

an yes, this is using kha ;)

pleclech commented 8 years ago

Well it seems you have an error with a file not found html5-resources/files.json, so the compiler did not go further and you don't have completion.

lewislepton commented 8 years ago

odd. because the file is right where it should be. weird i must say screen shot 2016-01-05 at 18 40 24

jcward commented 8 years ago

I tried a kha project, and it has to do with where your build.hxml file and workspace directory are relative to the files in question. I setup my build.hxml and symlinked the html5-resources directory relative to my project root dir (the vscode workspace folder):

cd KhaProject
node Kha/make html5
cp build/project-html5.hxml build.hxml # for completion server
# edit build.hxml, change -cp ../Sources to -cp Sources
ln -s build/html5-resources .
code .

For me, this resolved the error:

> /home/jward/tools/haxe/std/neko/_std/sys/io/File.hx:30: characters 20-51 : html5-resources/files.json: No such file or directory
jcward commented 8 years ago

@lewislepton - closing this assuming it's the same as my problem above. If not, feel free to comment.