gnysek
Member
I'm using GMS2 for more than 4 months now, so I'm very happy that it have better code completion now, but there are some things I think can be changed, having some experience with other companies IDEs for programming.
- All resources are also displayed as "variables" in code completion window, if they were mentioned in code at least once. Which causes duplicates (this is probably a bug):
- All variables defined in objects are visible in all other objects and scripts. This is bad, as the more objects you have with similar variable names, the longer "completion" list will be, even in scripts:
- Variables in completion code should be only ones from "current" object in most case. I know that @rwkay or @Mike already said, that it is hard to achieve, as you can define variables anywhere in GMS, but in fact there are some "good rules" what you can avoid, and I don't see why parsing variable names can skip "bad practices" for variable definitions (it would have even some educational benefit):
- variables should be created before they are used, or it will cause a fatal error, so the best place to it is always "Create event", as otherwise it's really easy to crash game. Other variable definitions within same object may not be counted to variable definitions by code editor (except temporary "var" of course, which works great now).
- if not keeping rules above, cause they are too strict, we may keep the rule, that all variables after which equal sign (=) is posted, and aren't in one of: with-block/if-block/instance reference (xxxx.var_name) could be marked as "object local variables".
- Having rule about, while in "with" block and object name is directly given, or using instance reference, variables from it could show variables from this object. Additionaly, there could be special JDOC reference
Code:
with (my_variable) { /// @var my_variable object_0 }
- Again, having rule 3) in mind, while in "collision event", an word "other." would point directly to same object that is said to be used in this event.
- "var" variables shouldn't be shown in completion code in lines before they definitions.
- Having indented code and pressing backspace could remove all spaces between last line and current one, not just move remove character in front of cursor (so it will move code to previous line):
- There could be "filter" buttons in code completion, so you can hide some results (for example all sounds, or sprites, or build-in functions), when having too much of them.
- Shortcut to display function/script arguments OVER current line - helpful especially on workspaces, where sometimes editor footer is outside of view. Prefarably Ctrl+P cause I've saw this shortcut in several IDEs (Ctrl-K then Ctrl+I in Visual Studio if I remember correctly for Quick info, or Ctrl+Shift+Space for Parameter Info):
- Ctrl+{ and Ctrl+} could go to next opening/ending bracket in current block code.
- And of course code folding, but it was already said by Mike, that there should be something like Visual Studio "regions" at some point, but probably no folding on if/else etc. I'm just mentioning it so people wouldn't propose it again here