COMMUNITY

VSCode completion

Hej all !

I work on Haxe nightly builds for a long time now and for some weeks I have’nt comletion anymore in VSCode, just simple local completion…) in VSCode, I wonder if it comes from Haxe or VSCode ?
Did somebody experiments same thing please ?

Check if you have some errors from the haxe vscode plugin in vscode’s help->developer tools and haxe plugin in view->output. If any post them here or in vshaxe repo or haxe repo depending on the error. Also, does vscode give you error than cache could not be built because of errors? Also, are you using lime/openfl/kha/lix and have their respective plugins installed? Also, is your haxe binary in path? Also, try to reinstall the haxe plugin. Because the plugin works for me.

Thanks for your reply.
I have nothing in developper tools console related to any error.
I’ve reinstalled Haxe plugin and still can’t even get definition F12 says No definition found for “foo”, CTRL+Click doesn’t work anymore… Maybe I’ve desactivated something in otpions that I can’t see now ?

Oh, after restarting VSCode it works again… Strange. Thanks !

Sorry, I know it’s not a VSCode forum but BTW you seem to well know VSCode, how can I disable auto import please ? I’ve done all what is suggested here : https://stackoverflow.com/questions/47350589/how-to-disable-automatic-import-statements-in-vscode-october-2017
In User, Workspace and folder sections and it still add import when I try for example php.Global and press Enter, it adds it as import and just let Global please ?

AFAIK, auto import is feature which has to be implemented via the plugin/extension and there is no global way to turn it off in vscode. And the vshaxe extension does not provide any option to disable it for now.
@Gama11 is the author of the extension, maybe he can add such an option in the future. He is active in the forums, so he might reply soon.

1 Like

And the vshaxe extension does not provide any option to disable it for now.

Actually, it does, via the "haxe.codeGeneration" setting.

Hej Jens !
Thanks for your answer !
So what should I do exactly in codeGeneration please ?

I haven’t completion anymore again. I do’nt know what to do, it’s not very stable, something is killing all my completion. Now even if I restart, I haven’t it anymore … :confused:

This might be a long shot, but recently on windows 10 in a project using WSL somehow I had turned off WSL in vscode for that particular project and that killed completion for haxe I had installed in linux there. Reopening that folder with WSL turned on fixed it.

Thanks Chris for your answer.
I’ve uninstalled all extensions, reinstaller Haxe, reinstalled VSCode, and still no degfinition found, it drives me crazy…

Do you have a .hxml file at the root of your project?
If yes do you see it in the status bar at the bottom, next to “:gear: Haxe”?
Do you see “Haxe: Building cache…” next to it when starting vscode?

Yes I have .hxml, I see build cache, without any problem, compilation works also fine.
i’ve tried with a smaller project I got definitions, but in this big project I have a cache.hxml that is called inside another common.hxml that is called in server.hxml and the same with client.hxml. Maybe it doesn’t like that ?
But what is strange is that it worked before a date, and even this morning after restarting VSCode it did work for a moment and now imposbile to make it work again … I’me uninstalling all and again…
I don’t know what to do now …

It’s more complicated, it occurs when I also call a macro in my compile hxml file and when this macro function does that :
Context.defineType( cl, "foo" );
When foo is null, all works fine, but when it’s something, it fails…