haxe
haxe copied to clipboard
[ide] Wrong autocomplete suggestions in some circumstances
This reproduces with development branch 526bd66 but not 4.1.2 or 4.0.5
See video, I'm trying to write: new Uniform(new Vector4()) but it replaces it with another random type, in the video it's Landscape but I've get other types if the compiler server has been running longer (see second video):
gif is 8MB so may take a moment to load

Another case when server was running longer, notice it replaces items with HTMLDocument when I try to select Vector4

Here's what I know:
- Reproduces the same way between restarts of vscode
- If I start typing from
new Uniform|the bug occurs, but if I backspace tonew Uniform(|and try again, the bug doesn't occur - ~~This bug happens when I create a new class that's not yet referenced anywhere else in the codebase. If I try that same line in a class referenced by Main.hx, the bug doesn't happen~~ Seems to happen elsewhere too
I have a reproducing project but it's not open source, let me know if you're investigating and I'll send a copy
Random thought: does increasing the "haxe.maxCompletionItems" limit help?
Tried setting "haxe.maxCompletionItems" to 100000, restarted vscode but got the same result
Update: I thought this only happened with modules not linked from Main, but it seems to happen in other modules. Here's another example. I'm trying to type new Box2(), first time it works, second time I get a random class (again testing with haxe 4.2.0).

Tried restarting vscode but got the same result
Update: I can reproduce in 4.1.2 and 4.0.5, maybe it's a vshaxe bug? In 4.0.5:

When Vector2 is fully typed out, it gives only a single incorrect suggestion, which presumably haxe-side is actually Vector2
I've found this bug occurs with a trivial Main.hx haxe file in 4.0.5, 4.1.3 and latest development commit
@Gama11 does this reproduce for you?

- I create a new Main.hx file
- write an empty main class and try to write
new Main()but it autocomplete replaces my text with some random class when I press(
I'm on macOS 10.14 with vshaxe 2.22.0
Is there a flag in vshaxe I can turn on to check the display output is correct?
@haxiomic That's not a bug, ( is a commit character for functions (which includes constructors). You can control that with the "editor.acceptSuggestionOnCommitCharacter" setting.
@Gama11 I don't mean the ( being commit is an issue (that's great :)) the bug is the autocompletion: I type new Main( and I get new IntMap() – because this example is so minimal I'm curious if it happens for you too
Well, that's a side effect of that being the selected completion item, because Main doesn't have a constructor that could appear before it.
Omgg I need to get more sleep, you're absolutely right – I decided main had a constructor for some reason, sorry to bother you
Will hide the comments because they're off topic from the original bug :X
This is tentatively looking fixed in development builds! Will update when I'm certain
I think this might be fixed! Thanks everyone <3
Testing with 4.3