{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vscode-go/issues/500","repository_url":"https://api.github.com/repos/Microsoft/vscode-go","labels_url":"https://api.github.com/repos/Microsoft/vscode-go/issues/500/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode-go/issues/500/comments","events_url":"https://api.github.com/repos/Microsoft/vscode-go/issues/500/events","html_url":"https://github.com/Microsoft/vscode-go/pull/500","id":178982304,"number":500,"title":"Proposal to implement collapsing","user":{"login":"benclarkwood","id":4732025,"avatar_url":"https://avatars.githubusercontent.com/u/4732025?v=3","gravatar_id":"","url":"https://api.github.com/users/benclarkwood","html_url":"https://github.com/benclarkwood","followers_url":"https://api.github.com/users/benclarkwood/followers","following_url":"https://api.github.com/users/benclarkwood/following{/other_user}","gists_url":"https://api.github.com/users/benclarkwood/gists{/gist_id}","starred_url":"https://api.github.com/users/benclarkwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benclarkwood/subscriptions","organizations_url":"https://api.github.com/users/benclarkwood/orgs","repos_url":"https://api.github.com/users/benclarkwood/repos","events_url":"https://api.github.com/users/benclarkwood/events{/privacy}","received_events_url":"https://api.github.com/users/benclarkwood/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/vscode-go/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-23T21:59:29Z","updated_at":"2016-09-26T15:36:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Microsoft/vscode-go/pulls/500","html_url":"https://github.com/Microsoft/vscode-go/pull/500","diff_url":"https://github.com/Microsoft/vscode-go/pull/500.diff","patch_url":"https://github.com/Microsoft/vscode-go/pull/500.patch"},"body":"1. Add new setting \"go.blockImportsOnly\"\r\n2. Add parsing of package name for single import lines\r\n3. When the user adds an import manually and there is already one or more single imports, collapse it all into a block if go.blockImportsOnly is true.\r\n\r\nnote: addresses #374 "},"comment":{"url":"https://api.github.com/repos/Microsoft/vscode-go/issues/comments/249606691","html_url":"https://github.com/Microsoft/vscode-go/pull/500#issuecomment-249606691","issue_url":"https://api.github.com/repos/Microsoft/vscode-go/issues/500","id":249606691,"user":{"login":"benclarkwood","id":4732025,"avatar_url":"https://avatars.githubusercontent.com/u/4732025?v=3","gravatar_id":"","url":"https://api.github.com/users/benclarkwood","html_url":"https://github.com/benclarkwood","followers_url":"https://api.github.com/users/benclarkwood/followers","following_url":"https://api.github.com/users/benclarkwood/following{/other_user}","gists_url":"https://api.github.com/users/benclarkwood/gists{/gist_id}","starred_url":"https://api.github.com/users/benclarkwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benclarkwood/subscriptions","organizations_url":"https://api.github.com/users/benclarkwood/orgs","repos_url":"https://api.github.com/users/benclarkwood/repos","events_url":"https://api.github.com/users/benclarkwood/events{/privacy}","received_events_url":"https://api.github.com/users/benclarkwood/received_events","type":"User","site_admin":false},"created_at":"2016-09-26T15:36:05Z","updated_at":"2016-09-26T15:36:05Z","body":"Oh my gosh this is such a better way of doing this!\n\nThanks!\n\n> On Sep 25, 2016, at 23:03, Ramya Rao <notifications@github.com> wrote:\n> \n> @ramya-rao-a commented on this pull request.\n> \n> In src/goImport.ts:\n> \n> > +\t\t\tlet firstImport = imports[0];\n> +\t\t\tlet lastImport = imports[imports.length - 1];\n> +\n> +\t\t\t// Construct the import block.\n> +\t\t\tlet importBlock = 'import (\\n';\n> +\t\t\timports.forEach(element => {\n> +\t\t\t\timportBlock += '\\t\"' + element.package + '\"\\n';\n> +\t\t\t});\n> +\t\t\timportBlock += '\\t\"' + imp + '\"\\n'; // Add the user's new import\n> +\t\t\timportBlock += ')\\n';\n> +\n> +\t\t\treturn vscode.window.activeTextEditor.edit(editBuilder => {\n> +\t\t\t\t// First, delete all the single packages.\n> +\t\t\t\teditBuilder.delete(new vscode.Range(new vscode.Position(firstImport.start, 0), new vscode.Position(lastImport.end, 10000)));\n> +\t\t\t\t// Now, insert the import block.\n> +\t\t\t\teditBuilder.insert(new vscode.Position(pkg.start + 2, 0), importBlock);\n> Like @lukehoban says, this would result in comments that were previously between packages and imports to appear after the new import block.\n> Also, comments in between single import statements are lost too. Example:\n> \n> import \"math\"  //Helps me in math\n> // This is my custom package\n> import \"mycustom\"\n> How about doing this instead?\n> 1. Insert (\\n\\t after the word \"import\" in the first import\n> 2. Replace the word \"import\" with \\t for rest of the imports\n> 3. Insert ) in the line after the last import\n> \n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub, or mute the thread.\n> \n"}}
{"actor":{"display_login":"benclarkwood"}}