[SOLVED - Not Available] Is there a way to add code completion to the default editor?

V

Vercaelus

Guest
I've been searching for a solution everywhere, and I keep coming up empty handed. To be clear, I want things like closing bracket/string quote pairing, auto-indentation, etc. Does anyone have any idea how to import this functionality?
 

SnoutUp

Member
I'm not sure if I'm missing something, but this does absolutely nothing (edit: I stand corrected, OP did wanted auto-completlion, although Ctrl+Space still feels a bit faster than that "helper") of what OP asked for and as far as I know, there's no way to get those nice things in GameMaker's editor (I hope I'm wrong!).

 
Last edited:
S

Sudo_Radish

Guest
Looking at the manual all I can see is the option to give "hints". A popup window will appear and if you press enter it should auto complete that single item.
 
V

Vercaelus

Guest
Looking at the manual all I can see is the option to give "hints". A popup window will appear and if you press enter it should auto complete that single item.
Indeed, that was the only lead I found as well, which is what brought me here. Hopefully, we're just looking in the wrong place.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Nope, there is nothing that will automagically add brackets, quotes, etc... and stuff for you.
 

Yambam

Member
Notepad++ does this. One editor I haven't really tried but looks promising is called Atom and it has a GML Highlighting addon too. It also should work on Linux, but I haven't successfully installed it in Linux. :)
 

Yal

šŸ§ *penguin noises*
GMC Elder
Yeah, you can't add functionality to the default editor that isn't there already, which is why you can use other editors that has it.
 

TheouAegis

Member
How do they work? Are they the type like if you type a bracket it adds closing bracket right after? Or are they the type like in forums where you click a button and it puts both brackets up? Do they have a nice feature like highlighting a block of code, clicking a bracket button, adding the brackets on both sides of the code block, then tabbing the block over?

Unless they do the third thing, I wouldn't be interested in an external editor.
 

Yambam

Member
@TheouAegis Below I explained the way it works in Notepad++ and probably in some other editors too. :)
Code:
You type 'if (' without the closing bracket and it expands to the following.

    if (|)

(The | is simply the blinking caret, or the place where you are typing.)
Then you type the expression and go to the end of the line by pressing <End>, or simply using a right-arrow key press or two.

    if (point_in_rectangle(mouse_x,mouse_y,x,y,x+sprite_width,y+sprite_height|))
    if (point_in_rectangle(mouse_x,mouse_y,x,y,x+sprite_width,y+sprite_height))|

Then when you type a space and an opening bracket (' {') you get this.

    if (point_in_rectangle(mouse_x,mouse_y,x,y,x+sprite_width,y+sprite_height)) {|}

And you just press enter to get this:

    if (point_in_rectangle(mouse_x,mouse_y,x,y,x+sprite_width,y+sprite_height)) {
        |
    }

...where the indentation is added automatically.

I think it would be possible to create this feature for the existing GM:Studio code editor by making a AutoHotKey script (it's probably made for this kind of jobs), I haven't used that program in a while though and it would probably be possible to use a Simulate Key Press DLL to make some kind of code helper utility in GML. :)
 
Top