defold / editor2-issues

DEPRECATED
44 stars 4 forks source link

Some auto completion and script suggestions #439

Open blurymind opened 7 years ago

blurymind commented 7 years ago

I know some of this is true for the currently stable branch of Defold, but it would be nice if the auto completion worked more often in the code editor.

For example when I define a variable in init self.velocity = vmath.vector3(55,0,0)

then in update call it, typing self.ve... will fail to autocomplete it. So it doesnt autocomplete existing variables established earlier in the script.

however vmath.v will autocomplete and offer the options - so it works with builtin methods.

If I type go.set_p... it will not autocomplete at first. I have to wait at least 4-5 seconds before it loads the autocompletion data initially, then every next time it does work - as with other classes. It would be nice if that gets preloaded when we start the code editor and not the first time we ask it to autocomplete something

Godot in comparison is much better at auto completion, as it happens much more often and with less initial loading waiting.

A nice thing to have is also when hitting the enter key after a "then" , Defold could automatically add the "end" bellow the newly created row - similarly to how other code editors automatically add a close bracket when you open a new bracket

blurymind commented 7 years ago

defold has no ability to autocomplete msg.post calls in editor. Godot does have that in a way (they use something similar called "signals") and it autocompletes

Example:

writing msg.post(".","acq_") could autocomplete/suggest to msg.post(".","acquire_input_focus")

but it doesn't. So its more likely that user makes a typo

It would also be nice if it autocompletes/suggests game objects that the signal can be sending to - the way godot autocompletes nodes in the scene (when writing get_node(" - godot will suggest nodes in the scene).

blurymind commented 7 years ago

Another thing that can make scripting in Defold nicer that godot does. Let me know if it already does it, but I am perhaps getting it wrong.

When you create a variable, Defold2 does not establish it's initial value.

Currently if I do:

local curAnim = "idle"

outside of any function, I expect it to create the string variable curAnim and assign it the "idle" initial value.

It will however return a "nil" , unless I assign the value in the init function like this:

function init(self) self.curAnim = "idle" end

I dont know if it's a bug or a lua thing, but it currently just forces you to type more when handling variables. If I want to have a nil to begin with, I should be able to create it like this:

local curAnim = null

AGulev commented 6 years ago

writing msg.post(".","acq_") could autocomplete/suggest to msg.post(".","acquire_input_focus")

already works this way