{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/43244","repository_url":"https://api.github.com/repos/Microsoft/vscode","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/43244/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/43244/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/43244/events","html_url":"https://github.com/Microsoft/vscode/issues/43244","id":295641340,"node_id":"MDU6SXNzdWUyOTU2NDEzNDA=","number":43244,"title":"Incorrect indentation for single line if/for/while/etc, multiline chaining statements etc","user":{"login":"johanolofsson","id":4460153,"node_id":"MDQ6VXNlcjQ0NjAxNTM=","avatar_url":"https://avatars2.githubusercontent.com/u/4460153?v=4","gravatar_id":"","url":"https://api.github.com/users/johanolofsson","html_url":"https://github.com/johanolofsson","followers_url":"https://api.github.com/users/johanolofsson/followers","following_url":"https://api.github.com/users/johanolofsson/following{/other_user}","gists_url":"https://api.github.com/users/johanolofsson/gists{/gist_id}","starred_url":"https://api.github.com/users/johanolofsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanolofsson/subscriptions","organizations_url":"https://api.github.com/users/johanolofsson/orgs","repos_url":"https://api.github.com/users/johanolofsson/repos","events_url":"https://api.github.com/users/johanolofsson/events{/privacy}","received_events_url":"https://api.github.com/users/johanolofsson/received_events","type":"User","site_admin":false},"labels":[{"id":577463440,"node_id":"MDU6TGFiZWw1Nzc0NjM0NDA=","url":"https://api.github.com/repos/Microsoft/vscode/labels/editor-autoindent","name":"editor-autoindent","color":"c5def5","default":false},{"id":272689392,"node_id":"MDU6TGFiZWwyNzI2ODkzOTI=","url":"https://api.github.com/repos/Microsoft/vscode/labels/feature-request","name":"feature-request","color":"dcdcdc","default":false},{"id":291124272,"node_id":"MDU6TGFiZWwyOTExMjQyNzI=","url":"https://api.github.com/repos/Microsoft/vscode/labels/javascript","name":"javascript","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":{"login":"rebornix","id":876920,"node_id":"MDQ6VXNlcjg3NjkyMA==","avatar_url":"https://avatars1.githubusercontent.com/u/876920?v=4","gravatar_id":"","url":"https://api.github.com/users/rebornix","html_url":"https://github.com/rebornix","followers_url":"https://api.github.com/users/rebornix/followers","following_url":"https://api.github.com/users/rebornix/following{/other_user}","gists_url":"https://api.github.com/users/rebornix/gists{/gist_id}","starred_url":"https://api.github.com/users/rebornix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebornix/subscriptions","organizations_url":"https://api.github.com/users/rebornix/orgs","repos_url":"https://api.github.com/users/rebornix/repos","events_url":"https://api.github.com/users/rebornix/events{/privacy}","received_events_url":"https://api.github.com/users/rebornix/received_events","type":"User","site_admin":false},"assignees":[{"login":"rebornix","id":876920,"node_id":"MDQ6VXNlcjg3NjkyMA==","avatar_url":"https://avatars1.githubusercontent.com/u/876920?v=4","gravatar_id":"","url":"https://api.github.com/users/rebornix","html_url":"https://github.com/rebornix","followers_url":"https://api.github.com/users/rebornix/followers","following_url":"https://api.github.com/users/rebornix/following{/other_user}","gists_url":"https://api.github.com/users/rebornix/gists{/gist_id}","starred_url":"https://api.github.com/users/rebornix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebornix/subscriptions","organizations_url":"https://api.github.com/users/rebornix/orgs","repos_url":"https://api.github.com/users/rebornix/repos","events_url":"https://api.github.com/users/rebornix/events{/privacy}","received_events_url":"https://api.github.com/users/rebornix/received_events","type":"User","site_admin":false},{"login":"mjbvz","id":12821956,"node_id":"MDQ6VXNlcjEyODIxOTU2","avatar_url":"https://avatars2.githubusercontent.com/u/12821956?v=4","gravatar_id":"","url":"https://api.github.com/users/mjbvz","html_url":"https://github.com/mjbvz","followers_url":"https://api.github.com/users/mjbvz/followers","following_url":"https://api.github.com/users/mjbvz/following{/other_user}","gists_url":"https://api.github.com/users/mjbvz/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbvz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbvz/subscriptions","organizations_url":"https://api.github.com/users/mjbvz/orgs","repos_url":"https://api.github.com/users/mjbvz/repos","events_url":"https://api.github.com/users/mjbvz/events{/privacy}","received_events_url":"https://api.github.com/users/mjbvz/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2018-02-08T19:44:18Z","updated_at":"2018-11-05T22:58:23Z","closed_at":null,"author_association":"NONE","body":"I am experiencing some weird indentation issues. Not using any plugins to prettify or similar.\r\n\r\n```\r\nif (condition) {\r\n    return; // <-- correct indentation\r\n}\r\n```\r\n```\r\nif(condition)\r\nreturn; // <-- incorrect indentation\r\n```\r\nSome ppl claim this should be avoided. I don't agree. Using pair of { } for simple early exits messes up code. Putting the return on the end of the same line can be hard to read if the condition is long.\r\nThis is not exclusive to return. Applies to all single lines. \r\n\r\nsame problems apply to for, while, etc.\r\n\r\n```\r\nvar transformedValues =\r\noriginalValues <-- incorrect should be indented one level.\r\n.where(condition) <-- incorrect, should be indented two levels.\r\n.select(transform); <-- incorrect, should be indented two levels. \r\n\r\nfunction someFunction() {\r\n    callToSomeOtherFunction(\r\n         variableWithLongNameWhichRequiresASeparateLine,\r\n         anotherVariableWithLongNameWhichRequiresASeparateLine);\r\n    }  <-- incorrect should not be indented.\r\n    function ... <-- incorrect the rest of the file is indented. \r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/comments/436067541","html_url":"https://github.com/Microsoft/vscode/issues/43244#issuecomment-436067541","issue_url":"https://api.github.com/repos/Microsoft/vscode/issues/43244","id":436067541,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjA2NzU0MQ==","user":{"login":"Spongman","id":1088194,"node_id":"MDQ6VXNlcjEwODgxOTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1088194?v=4","gravatar_id":"","url":"https://api.github.com/users/Spongman","html_url":"https://github.com/Spongman","followers_url":"https://api.github.com/users/Spongman/followers","following_url":"https://api.github.com/users/Spongman/following{/other_user}","gists_url":"https://api.github.com/users/Spongman/gists{/gist_id}","starred_url":"https://api.github.com/users/Spongman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spongman/subscriptions","organizations_url":"https://api.github.com/users/Spongman/orgs","repos_url":"https://api.github.com/users/Spongman/repos","events_url":"https://api.github.com/users/Spongman/events{/privacy}","received_events_url":"https://api.github.com/users/Spongman/received_events","type":"User","site_admin":false},"created_at":"2018-11-05T22:58:23Z","updated_at":"2018-11-05T22:58:23Z","author_association":"NONE","body":"here's another weirdness.\r\n\r\n1) new file\r\n2) set filetype to 'JS'\r\n3) type `if(true)<ENTER>`\r\n\r\nafter hitting `<ENTER>` the cursor drops to line 2, column **1**. this is clearly wrong. the cursor at this point should be indented, and only un-indented if the next keystroke is a `{`.\r\n\r\n![image](https://user-images.githubusercontent.com/1088194/48032083-27989100-e10b-11e8-9a03-e523d644c227.png)\r\n\r\n\r\n\r\nhowever...\r\n\r\n1) new file\r\n2) hit `<ENTER>` several times\r\n3) go to line 1\r\n4) type `if(true)<ENTER>`\r\n\r\n**now** the cursor ends up indented correctly:\r\n\r\n![image](https://user-images.githubusercontent.com/1088194/48032055-09329580-e10b-11e8-948f-485329ec9f1d.png)\r\n\r\n"}}
{"actor":{"display_login":"Spongman"}}