{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/43061324","id":43061324,"diff_hunk":"@@ -0,0 +1,180 @@\n+﻿// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.\n+\n+using System;\n+using System.ComponentModel.Composition;\n+using System.Diagnostics;\n+using System.Threading;\n+using Microsoft.CodeAnalysis.Editor.Commands;\n+using Microsoft.CodeAnalysis.Editor.Host;\n+using Microsoft.CodeAnalysis.Editor.Shared.Extensions;\n+using Microsoft.CodeAnalysis.Editor.Shared.SuggestionSupport;\n+using Microsoft.CodeAnalysis.LanguageServices;\n+using Microsoft.CodeAnalysis.Shared.Extensions;\n+using Microsoft.CodeAnalysis.Text;\n+using Microsoft.VisualStudio.Text;\n+using Microsoft.VisualStudio.Text.Editor;\n+using Microsoft.VisualStudio.Text.Outlining;\n+using Roslyn.Utilities;\n+\n+namespace Microsoft.CodeAnalysis.Editor\n+{\n+    [ExportCommandHandler(\"Go to next and previous method command handler\", ContentTypeNames.RoslynContentType)]\n+    class GoToNextAndPreviousMethodCommandHandler : ICommandHandler<GoToNextMethodCommandArgs>, ICommandHandler<GoToPreviousMethodCommandArgs>\n+    {\n+        private readonly IWaitIndicator _waitIndicator;\n+        private readonly IOutliningManagerService _outliningManagerService;\n+\n+        [ImportingConstructor]\n+        public GoToNextAndPreviousMethodCommandHandler(IWaitIndicator waitIndicator, IOutliningManagerService outliningManagerService)\n+        {\n+            _waitIndicator = waitIndicator;\n+            _outliningManagerService = outliningManagerService;\n+        }\n+\n+        public CommandState GetCommandState(GoToNextMethodCommandArgs args, Func<CommandState> nextHandler)\n+            => GetCommandState(args.SubjectBuffer, nextHandler);\n+\n+        public void ExecuteCommand(GoToNextMethodCommandArgs args, Action nextHandler)\n+            => ExecuteCommand(nextHandler, args.SubjectBuffer, args.TextView, next: true);\n+\n+        public CommandState GetCommandState(GoToPreviousMethodCommandArgs args, Func<CommandState> nextHandler)\n+            => GetCommandState(args.SubjectBuffer, nextHandler);\n+\n+        public void ExecuteCommand(GoToPreviousMethodCommandArgs args, Action nextHandler)\n+            => ExecuteCommand(nextHandler, args.SubjectBuffer, args.TextView, next: false);\n+\n+        private static CommandState GetCommandState(ITextBuffer subjectBuffer, Func<CommandState> nextHandler)\n+        {\n+            var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();\n+            var documentSupportsSuggestionService = document.Project.Solution.Workspace.Services.GetService<IDocumentSupportsSuggestionService>();\n+            if (document == null || !document.SupportsSyntaxTree || !documentSupportsSuggestionService.SupportsRefactorings(document))","path":"src/EditorFeatures/Core/GoToNextAndPreviousMethodCommandHandler.cs","position":50,"original_position":50,"commit_id":"40088d9c8474b2a03e1f2f4700410d480fb84f6b","original_commit_id":"40088d9c8474b2a03e1f2f4700410d480fb84f6b","user":{"login":"dpoeschl","id":235241,"avatar_url":"https://avatars.githubusercontent.com/u/235241?v=3","gravatar_id":"","url":"https://api.github.com/users/dpoeschl","html_url":"https://github.com/dpoeschl","followers_url":"https://api.github.com/users/dpoeschl/followers","following_url":"https://api.github.com/users/dpoeschl/following{/other_user}","gists_url":"https://api.github.com/users/dpoeschl/gists{/gist_id}","starred_url":"https://api.github.com/users/dpoeschl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpoeschl/subscriptions","organizations_url":"https://api.github.com/users/dpoeschl/orgs","repos_url":"https://api.github.com/users/dpoeschl/repos","events_url":"https://api.github.com/users/dpoeschl/events{/privacy}","received_events_url":"https://api.github.com/users/dpoeschl/received_events","type":"User","site_admin":false},"body":"```SupportsGoToNextPreviousMethod```, not ```SupportsRefactorings```","created_at":"2015-10-26T22:16:37Z","updated_at":"2015-10-26T22:16:37Z","html_url":"https://github.com/dotnet/roslyn/pull/6299#discussion_r43061324","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/6299","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/43061324"},"html":{"href":"https://github.com/dotnet/roslyn/pull/6299#discussion_r43061324"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/6299"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/6299","id":48667220,"html_url":"https://github.com/dotnet/roslyn/pull/6299","diff_url":"https://github.com/dotnet/roslyn/pull/6299.diff","patch_url":"https://github.com/dotnet/roslyn/pull/6299.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/6299","number":6299,"state":"open","locked":false,"title":"Support \"Go to next/previous method\" commands","user":{"login":"Pilchie","id":312835,"avatar_url":"https://avatars.githubusercontent.com/u/312835?v=3","gravatar_id":"","url":"https://api.github.com/users/Pilchie","html_url":"https://github.com/Pilchie","followers_url":"https://api.github.com/users/Pilchie/followers","following_url":"https://api.github.com/users/Pilchie/following{/other_user}","gists_url":"https://api.github.com/users/Pilchie/gists{/gist_id}","starred_url":"https://api.github.com/users/Pilchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pilchie/subscriptions","organizations_url":"https://api.github.com/users/Pilchie/orgs","repos_url":"https://api.github.com/users/Pilchie/repos","events_url":"https://api.github.com/users/Pilchie/events{/privacy}","received_events_url":"https://api.github.com/users/Pilchie/received_events","type":"User","site_admin":false},"body":"Fixes #4311","created_at":"2015-10-24T22:49:51Z","updated_at":"2015-10-26T22:16:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"857b54762518376c1d7452df5ccd4a48f9683776","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/6299/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/6299/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/6299/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/40088d9c8474b2a03e1f2f4700410d480fb84f6b","head":{"label":"Pilchie:Fix4311-NextAndPreviousMethodCommands","ref":"Fix4311-NextAndPreviousMethodCommands","sha":"40088d9c8474b2a03e1f2f4700410d480fb84f6b","user":{"login":"Pilchie","id":312835,"avatar_url":"https://avatars.githubusercontent.com/u/312835?v=3","gravatar_id":"","url":"https://api.github.com/users/Pilchie","html_url":"https://github.com/Pilchie","followers_url":"https://api.github.com/users/Pilchie/followers","following_url":"https://api.github.com/users/Pilchie/following{/other_user}","gists_url":"https://api.github.com/users/Pilchie/gists{/gist_id}","starred_url":"https://api.github.com/users/Pilchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pilchie/subscriptions","organizations_url":"https://api.github.com/users/Pilchie/orgs","repos_url":"https://api.github.com/users/Pilchie/repos","events_url":"https://api.github.com/users/Pilchie/events{/privacy}","received_events_url":"https://api.github.com/users/Pilchie/received_events","type":"User","site_admin":false},"repo":{"id":29272236,"name":"roslyn","full_name":"Pilchie/roslyn","owner":{"login":"Pilchie","id":312835,"avatar_url":"https://avatars.githubusercontent.com/u/312835?v=3","gravatar_id":"","url":"https://api.github.com/users/Pilchie","html_url":"https://github.com/Pilchie","followers_url":"https://api.github.com/users/Pilchie/followers","following_url":"https://api.github.com/users/Pilchie/following{/other_user}","gists_url":"https://api.github.com/users/Pilchie/gists{/gist_id}","starred_url":"https://api.github.com/users/Pilchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pilchie/subscriptions","organizations_url":"https://api.github.com/users/Pilchie/orgs","repos_url":"https://api.github.com/users/Pilchie/repos","events_url":"https://api.github.com/users/Pilchie/events{/privacy}","received_events_url":"https://api.github.com/users/Pilchie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Pilchie/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/Pilchie/roslyn","forks_url":"https://api.github.com/repos/Pilchie/roslyn/forks","keys_url":"https://api.github.com/repos/Pilchie/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Pilchie/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Pilchie/roslyn/teams","hooks_url":"https://api.github.com/repos/Pilchie/roslyn/hooks","issue_events_url":"https://api.github.com/repos/Pilchie/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/Pilchie/roslyn/events","assignees_url":"https://api.github.com/repos/Pilchie/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/Pilchie/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/Pilchie/roslyn/tags","blobs_url":"https://api.github.com/repos/Pilchie/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Pilchie/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Pilchie/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/Pilchie/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Pilchie/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/Pilchie/roslyn/languages","stargazers_url":"https://api.github.com/repos/Pilchie/roslyn/stargazers","contributors_url":"https://api.github.com/repos/Pilchie/roslyn/contributors","subscribers_url":"https://api.github.com/repos/Pilchie/roslyn/subscribers","subscription_url":"https://api.github.com/repos/Pilchie/roslyn/subscription","commits_url":"https://api.github.com/repos/Pilchie/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/Pilchie/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/Pilchie/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/Pilchie/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/Pilchie/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/Pilchie/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Pilchie/roslyn/merges","archive_url":"https://api.github.com/repos/Pilchie/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Pilchie/roslyn/downloads","issues_url":"https://api.github.com/repos/Pilchie/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/Pilchie/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/Pilchie/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/Pilchie/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Pilchie/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/Pilchie/roslyn/releases{/id}","created_at":"2015-01-15T00:05:23Z","updated_at":"2015-01-15T00:06:02Z","pushed_at":"2015-10-25T20:14:02Z","git_url":"git://github.com/Pilchie/roslyn.git","ssh_url":"git@github.com:Pilchie/roslyn.git","clone_url":"https://github.com/Pilchie/roslyn.git","svn_url":"https://github.com/Pilchie/roslyn","homepage":"","size":103778,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:stabilization","ref":"stabilization","sha":"260090e00943c149df7bde15c459fa6146246f62","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","created_at":"2015-01-11T02:39:03Z","updated_at":"2015-10-26T20:27:30Z","pushed_at":"2015-10-26T21:54:34Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":215664,"stargazers_count":3585,"watchers_count":3585,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":842,"mirror_url":null,"open_issues_count":1541,"forks":842,"open_issues":1541,"watchers":3585,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/6299"},"html":{"href":"https://github.com/dotnet/roslyn/pull/6299"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/6299"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/6299/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/6299/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/6299/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/40088d9c8474b2a03e1f2f4700410d480fb84f6b"}}}}