{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/47420340","id":47420340,"diff_hunk":"@@ -532,5 +534,118 @@ Namespace Microsoft.CodeAnalysis.VisualBasic\n             Return SyntaxEquivalence.AreEquivalent(oldList.Node, newList.Node, ignoreChildNode, topLevel:=False)\n         End Function\n \n+        ''' <summary>\n+        ''' Determines if a submission contains an incomplete LINQ query.\n+        '''\n+        ''' If the last expression of a submission is a LINQ query then it is\n+        ''' complete only if the submission ends with a empty new line.\n+        ''' For the examples below the first code submission the LINQ query is\n+        ''' not completed, the second it is.\n+        ''' <code>\n+        ''' Dim x = FROM {1,2,3}\n+        ''' </code>\n+        ''' <code>\n+        ''' Dim x = FROM {1,2,3}\n+        '''\n+        ''' </code>\n+        ''' <param name=\"token\">Last expected token of the last statement in a submission.</param>\n+        ''' <param name=\"statementNode\">Top level statement which token is part of.</param>\n+        ''' <param name=\"endOfFileToken\">Token that marks the end of submission.</param>\n+        ''' </summary>\n+        Private Shared Function IsPartOfIncompleteLinqQuery(token As SyntaxToken, statementNode As SyntaxNode, endOfFileToken As SyntaxToken) As Boolean\n+            ' Checking if the submission ends with a new line.\n+            For Each leadingTrivia In endOfFileToken.LeadingTrivia\n+                If leadingTrivia.IsKind(SyntaxKind.EndOfLineTrivia) Then\n+                    Return False\n+                End If\n+            Next\n+\n+\n+            ' Checking if the last token is part of a LINQ query.\n+            Dim node = token.Parent\n+            Do\n+                If node.IsKind(SyntaxKind.QueryExpression) Then\n+                    Return True\n+                End If\n+\n+                If node Is statementNode Then\n+                    Return False\n+                End If\n+\n+                node = node.Parent\n+            Loop\n+\n+            Return False\n+        End Function\n+\n+        ''' <summary>\n+        ''' Determines if a submission is complete.\n+        ''' Returns false if the syntax is valid but incomplete.\n+        ''' Returns true if the syntax is invalid or complete.\n+        ''' Throws ArgumentException in case the tree is not a submission.\n+        ''' </summary>\n+        ''' <param name=\"tree\">Syntax tree.</param>\n+        Public Shared Function IsCompleteSubmission(tree As SyntaxTree) As Boolean\n+            If tree Is Nothing Then\n+                Throw New ArgumentNullException(NameOf(tree))\n+            End If\n+\n+            Dim options As VisualBasicParseOptions = DirectCast(tree.Options, VisualBasicParseOptions)\n+            Dim languageVersion As LanguageVersion = options.LanguageVersion\n+\n+            If Not tree.HasCompilationUnitRoot Then\n+                Return False\n+            End If\n+\n+            If options.Kind = SourceCodeKind.Regular Then\n+                Throw New ArgumentException(\"The syntax tree should be created from a submission.\")","path":"src/Compilers/VisualBasic/Portable/Syntax/SyntaxFactory.vb","position":null,"original_position":77,"commit_id":"a3237511fff234bd7bfc6d87a23f1287e9633572","original_commit_id":"e38af952207eea63e04292cb5e212372e5c2ea7f","user":{"login":"drognanar","id":3418274,"avatar_url":"https://avatars.githubusercontent.com/u/3418274?v=3","gravatar_id":"","url":"https://api.github.com/users/drognanar","html_url":"https://github.com/drognanar","followers_url":"https://api.github.com/users/drognanar/followers","following_url":"https://api.github.com/users/drognanar/following{/other_user}","gists_url":"https://api.github.com/users/drognanar/gists{/gist_id}","starred_url":"https://api.github.com/users/drognanar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drognanar/subscriptions","organizations_url":"https://api.github.com/users/drognanar/orgs","repos_url":"https://api.github.com/users/drognanar/repos","events_url":"https://api.github.com/users/drognanar/events{/privacy}","received_events_url":"https://api.github.com/users/drognanar/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2015-12-12T00:05:37Z","updated_at":"2015-12-12T00:05:37Z","html_url":"https://github.com/dotnet/roslyn/pull/7302#discussion_r47420340","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/7302","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/47420340"},"html":{"href":"https://github.com/dotnet/roslyn/pull/7302#discussion_r47420340"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/7302"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/7302","id":52909260,"html_url":"https://github.com/dotnet/roslyn/pull/7302","diff_url":"https://github.com/dotnet/roslyn/pull/7302.diff","patch_url":"https://github.com/dotnet/roslyn/pull/7302.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/7302","number":7302,"state":"open","locked":false,"title":"Submission completions and intellisense","user":{"login":"drognanar","id":3418274,"avatar_url":"https://avatars.githubusercontent.com/u/3418274?v=3","gravatar_id":"","url":"https://api.github.com/users/drognanar","html_url":"https://github.com/drognanar","followers_url":"https://api.github.com/users/drognanar/followers","following_url":"https://api.github.com/users/drognanar/following{/other_user}","gists_url":"https://api.github.com/users/drognanar/gists{/gist_id}","starred_url":"https://api.github.com/users/drognanar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drognanar/subscriptions","organizations_url":"https://api.github.com/users/drognanar/orgs","repos_url":"https://api.github.com/users/drognanar/repos","events_url":"https://api.github.com/users/drognanar/events{/privacy}","received_events_url":"https://api.github.com/users/drognanar/received_events","type":"User","site_admin":false},"body":"Implements IsSubmissionComplete for Visual Sasic that allows to write multi line statements such as `Function`, `Class`, `Sub`, `#if` statements inside of vbi.\r\n\r\nAdds intellisense support to display suggestions for expressions in top level scope (`Action`, `Console`, `DateTime`, etc...)","created_at":"2015-12-07T22:16:22Z","updated_at":"2015-12-12T00:05:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd6e1851fec54e7f478cc47c20a36308292484ee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/7302/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/7302/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/7302/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/a3237511fff234bd7bfc6d87a23f1287e9633572","head":{"label":"drognanar:vbsubmissioncomplete","ref":"vbsubmissioncomplete","sha":"a3237511fff234bd7bfc6d87a23f1287e9633572","user":{"login":"drognanar","id":3418274,"avatar_url":"https://avatars.githubusercontent.com/u/3418274?v=3","gravatar_id":"","url":"https://api.github.com/users/drognanar","html_url":"https://github.com/drognanar","followers_url":"https://api.github.com/users/drognanar/followers","following_url":"https://api.github.com/users/drognanar/following{/other_user}","gists_url":"https://api.github.com/users/drognanar/gists{/gist_id}","starred_url":"https://api.github.com/users/drognanar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drognanar/subscriptions","organizations_url":"https://api.github.com/users/drognanar/orgs","repos_url":"https://api.github.com/users/drognanar/repos","events_url":"https://api.github.com/users/drognanar/events{/privacy}","received_events_url":"https://api.github.com/users/drognanar/received_events","type":"User","site_admin":false},"repo":{"id":45070113,"name":"roslyn","full_name":"drognanar/roslyn","owner":{"login":"drognanar","id":3418274,"avatar_url":"https://avatars.githubusercontent.com/u/3418274?v=3","gravatar_id":"","url":"https://api.github.com/users/drognanar","html_url":"https://github.com/drognanar","followers_url":"https://api.github.com/users/drognanar/followers","following_url":"https://api.github.com/users/drognanar/following{/other_user}","gists_url":"https://api.github.com/users/drognanar/gists{/gist_id}","starred_url":"https://api.github.com/users/drognanar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drognanar/subscriptions","organizations_url":"https://api.github.com/users/drognanar/orgs","repos_url":"https://api.github.com/users/drognanar/repos","events_url":"https://api.github.com/users/drognanar/events{/privacy}","received_events_url":"https://api.github.com/users/drognanar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drognanar/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/drognanar/roslyn","forks_url":"https://api.github.com/repos/drognanar/roslyn/forks","keys_url":"https://api.github.com/repos/drognanar/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drognanar/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drognanar/roslyn/teams","hooks_url":"https://api.github.com/repos/drognanar/roslyn/hooks","issue_events_url":"https://api.github.com/repos/drognanar/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/drognanar/roslyn/events","assignees_url":"https://api.github.com/repos/drognanar/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/drognanar/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/drognanar/roslyn/tags","blobs_url":"https://api.github.com/repos/drognanar/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drognanar/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drognanar/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/drognanar/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drognanar/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/drognanar/roslyn/languages","stargazers_url":"https://api.github.com/repos/drognanar/roslyn/stargazers","contributors_url":"https://api.github.com/repos/drognanar/roslyn/contributors","subscribers_url":"https://api.github.com/repos/drognanar/roslyn/subscribers","subscription_url":"https://api.github.com/repos/drognanar/roslyn/subscription","commits_url":"https://api.github.com/repos/drognanar/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/drognanar/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/drognanar/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/drognanar/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/drognanar/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/drognanar/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drognanar/roslyn/merges","archive_url":"https://api.github.com/repos/drognanar/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drognanar/roslyn/downloads","issues_url":"https://api.github.com/repos/drognanar/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/drognanar/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/drognanar/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/drognanar/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drognanar/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/drognanar/roslyn/releases{/id}","created_at":"2015-10-27T21:07:49Z","updated_at":"2015-10-27T21:08:34Z","pushed_at":"2015-12-12T00:01:51Z","git_url":"git://github.com/drognanar/roslyn.git","ssh_url":"git@github.com:drognanar/roslyn.git","clone_url":"https://github.com/drognanar/roslyn.git","svn_url":"https://github.com/drognanar/roslyn","homepage":"","size":121960,"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:master","ref":"master","sha":"7b5b28e993d272a347243d29c425ce444c6ab779","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-12-11T23:34:07Z","pushed_at":"2015-12-12T00:01:51Z","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":145341,"stargazers_count":3988,"watchers_count":3988,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":976,"mirror_url":null,"open_issues_count":1782,"forks":976,"open_issues":1782,"watchers":3988,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/7302"},"html":{"href":"https://github.com/dotnet/roslyn/pull/7302"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/7302"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/7302/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/7302/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/7302/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/a3237511fff234bd7bfc6d87a23f1287e9633572"}}}}