VSCode + OpenFL autocomplete strange behavior

#1

Greetings everyone here! Trying to start with OpenFL + VSCode, but having issues with autocomplete or at least I think I am having them. I created a new project using openfl create project command, opened it in VSCode. At first I had the same problem as Josh(build before autocompletion starts to work) but google helped me here. Then it looked fine with imported by default openfl.display.Sprite, but for some reason it doesn’t suggest me other stuff. For example when I start typing Bit, I expect to see Bitmap which will be automatically imported if I select it. Now I have to manually import everything I want before I get it in autocompletion. It should work like this or I am doing something wrong?

0 Likes

#2

Are you using Haxe 4 or 3.4? The extension works a lot better with Haxe 4.

1 Like

#3

I am using 3.4. Autoimport works only in Haxe 4?

0 Likes

#4

Yes, that’s correct.

1 Like

#5

Thanks! One more newbie question. I came from as3 with Flash Builder development and for now it’s kind of unclear to me how to create and use my own local library. I only managed to install some libraries using haxelib install, but how for instance I can start using feathers port which I downloaded from https://github.com/openfl/feathers? I tried to place it in HaxeToolkit/haxe/lib folder and mimic the structure of installed libraries, but it won’t work when I try to add reference in project.xml file, I get this Error: Could not find haxelib “feathers”, does it need to be installed? Funnily enough I can see this library if I type haxelib list command.

0 Likes

#6

You don’t have to install it manually, just use haxelib git:

haxelib git feathers https://github.com/openfl/feathers

A lot of libs have the instructions in their readme, looks like this one doesn’t.

Also note that currently, a restart of VSCode is required for newly added libs to show up in completion, as the Lime extension doesn’t watch project.xml for changes yet.

1 Like