{"action":"created","issue":{"url":"https://api.github.com/repos/GameMakerDiscord/GMEdit/issues/1","repository_url":"https://api.github.com/repos/GameMakerDiscord/GMEdit","labels_url":"https://api.github.com/repos/GameMakerDiscord/GMEdit/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/GameMakerDiscord/GMEdit/issues/1/comments","events_url":"https://api.github.com/repos/GameMakerDiscord/GMEdit/issues/1/events","html_url":"https://github.com/GameMakerDiscord/GMEdit/issues/1","id":285493179,"number":1,"title":"Add auto-formatting support","user":{"login":"YellowAfterlife","id":731492,"avatar_url":"https://avatars2.githubusercontent.com/u/731492?v=4","gravatar_id":"","url":"https://api.github.com/users/YellowAfterlife","html_url":"https://github.com/YellowAfterlife","followers_url":"https://api.github.com/users/YellowAfterlife/followers","following_url":"https://api.github.com/users/YellowAfterlife/following{/other_user}","gists_url":"https://api.github.com/users/YellowAfterlife/gists{/gist_id}","starred_url":"https://api.github.com/users/YellowAfterlife/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YellowAfterlife/subscriptions","organizations_url":"https://api.github.com/users/YellowAfterlife/orgs","repos_url":"https://api.github.com/users/YellowAfterlife/repos","events_url":"https://api.github.com/users/YellowAfterlife/events{/privacy}","received_events_url":"https://api.github.com/users/YellowAfterlife/received_events","type":"User","site_admin":false},"labels":[{"id":791891298,"url":"https://api.github.com/repos/GameMakerDiscord/GMEdit/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":791891299,"url":"https://api.github.com/repos/GameMakerDiscord/GMEdit/labels/help%20wanted","name":"help wanted","color":"33aa3f","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-01-02T17:45:30Z","updated_at":"2018-02-25T21:38:29Z","closed_at":null,"author_association":"COLLABORATOR","body":"### Summary\r\n\r\nSeveral people voiced an opinion that it would have been nice to have an option to auto-format code, such as that in Visual Studio (Ctrl+K, Ctrl+D) or other commonly used code editors.\r\n\r\n### Considerations\r\n\r\nAce comes with a [beautify](https://github.com/ajaxorg/ace/blob/master/lib/ace/ext/beautify.js) plugin for this purpose, but [PHP rules](https://github.com/ajaxorg/ace/blob/master/lib/ace/ext/beautify/php_rules.js) do not work well for GML at all, and would likely have to be rewritten more or less completely to account for GML-specific keywords and structures.\r\n\r\nIn a general case a JS-specific beautifier could be used (which generally work based on parentheses rather than tokens), but these will generally butcher GML preprocessor-like structures (`#define`, `#macro`, etc.) so would require additional logic.\r\n\r\nThere seems to be an existing [GML-specific beatufier](https://github.com/nstbayless/gml-beautify) but it is written in C++. It hard to estimate whether compiling an Emscripten module for a auto-formatter would be an overkill.\r\n\r\nAce extension route seems to be by far the most logical choice, as relying on Ace token data would be more forward-compatible than writing a custom parser just for this purpose.\r\n\r\n### Implementation\r\n\r\nThis can be implemented either in Haxe or JavaScript (or anything else that compiles to JS) - ultimately the job of the extension/module is to take code as a string and return updated code as a string."},"comment":{"url":"https://api.github.com/repos/GameMakerDiscord/GMEdit/issues/comments/368347147","html_url":"https://github.com/GameMakerDiscord/GMEdit/issues/1#issuecomment-368347147","issue_url":"https://api.github.com/repos/GameMakerDiscord/GMEdit/issues/1","id":368347147,"user":{"login":"ShinaZin","id":18055854,"avatar_url":"https://avatars1.githubusercontent.com/u/18055854?v=4","gravatar_id":"","url":"https://api.github.com/users/ShinaZin","html_url":"https://github.com/ShinaZin","followers_url":"https://api.github.com/users/ShinaZin/followers","following_url":"https://api.github.com/users/ShinaZin/following{/other_user}","gists_url":"https://api.github.com/users/ShinaZin/gists{/gist_id}","starred_url":"https://api.github.com/users/ShinaZin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShinaZin/subscriptions","organizations_url":"https://api.github.com/users/ShinaZin/orgs","repos_url":"https://api.github.com/users/ShinaZin/repos","events_url":"https://api.github.com/users/ShinaZin/events{/privacy}","received_events_url":"https://api.github.com/users/ShinaZin/received_events","type":"User","site_admin":false},"created_at":"2018-02-25T21:38:29Z","updated_at":"2018-02-25T21:38:29Z","author_association":"NONE","body":"At this time auto-formatting doesn't work correctly with _#import #event_ lines:\r\n![gmedit](https://user-images.githubusercontent.com/18055854/36646729-a5da94d2-1a8c-11e8-9da9-a199ba32a0a0.gif)\r\n"}}
{"actor":{"display_login":"ShinaZin"}}