YellowAfterlife / GMEdit

A high-end code editor for GameMaker: Studio, GameMaker Studio 2.x, and more!
https://yellowafterlife.itch.io/gmedit
MIT License
308 stars 45 forks source link

#import alias does not seem to work #164

Closed Ced-Sharp closed 2 years ago

Ced-Sharp commented 2 years ago

I'm using GMEdit Beta v11.3.0.0 (version Dec 8, 2021) on Windows 11. I'm using GameMaker Studio 2 with IDE v2.3.7.606 and runtime v2.3.7.476.

I created a new empty gml project with the following script:

// script my_script.gml

#import display.get_gui_width as gui_width;
#import display.get_gui_height as gui_height;

var width = gui_width();
var height = gui_height();

Not only is intellisense not working (gui_width does not seem to exists) but the generated code in GameMaker Studio is invalid:

#import display.get_gui_width /*#as gui_width*/;
#import display.get_gui_height /*#as gui_height*/;

var width = gui_width();
var height = gui_height();

Obviously the line starting with #import triggers an error. Either I'm doing something wrong, and then please be lenient on this noob that I am, or the feature is not working.

YellowAfterlife commented 2 years ago

Using in instead of as may work. Pressing Ctrl+S a second time may also work if you've not used #import in the project before.

Ced-Sharp commented 2 years ago

Using either as or in produces different results, yet none work as expected. image

Multiple Ctrl+S, or disabling the feature, saving, enabling it again then saving multiple time, none of those seems to fix it.

Something seems to happen, as I see comments appearing with as, but unfortunately it doesn't seem to happen properly.