{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/65488284","id":65488284,"diff_hunk":"@@ -0,0 +1,96 @@\n+﻿using System;\n+using System.Composition;\n+using System.Linq;\n+using Microsoft.CodeAnalysis.CodeRefactorings;\n+using Microsoft.CodeAnalysis.CSharp.Extensions;\n+using Microsoft.CodeAnalysis.CSharp.Syntax;\n+using Microsoft.CodeAnalysis.Simplification;\n+using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n+\n+namespace Microsoft.CodeAnalysis.CSharp.CodeRefactorings.ConvertToInterpolatedString\n+{\n+    [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = PredefinedCodeRefactoringProviderNames.ConvertToInterpolatedString), Shared]\n+    internal partial class ConvertToInterpolatedStringRefactoringProvider :\n+        AbstractConvertToInterpolatedStringRefactoringProvider\n+            <InterpolatedStringExpressionSyntax,\n+             InterpolatedStringContentSyntax,\n+             InterpolationSyntax,\n+             InvocationExpressionSyntax,\n+             ExpressionSyntax,\n+             ArgumentSyntax,\n+             LiteralExpressionSyntax>\n+    {\n+        protected override SeparatedSyntaxList<ArgumentSyntax>? GetArguments(InvocationExpressionSyntax invocation) =>\n+            invocation?.ArgumentList?.Arguments;\n+\n+        protected override LiteralExpressionSyntax GetFirstArgument(SeparatedSyntaxList<ArgumentSyntax> arguments) =>\n+            arguments[0]?.Expression as LiteralExpressionSyntax;\n+\n+        protected override InterpolatedStringExpressionSyntax GetInterpolatedString(string text) =>\n+            ParseExpression(\"$\" + text) as InterpolatedStringExpressionSyntax;\n+\n+        protected override LiteralExpressionSyntax GetLiteralExpressionSyntax(SeparatedSyntaxList<ArgumentSyntax> arguments) =>\n+            arguments[0].Expression as LiteralExpressionSyntax;\n+\n+        protected override LiteralExpressionSyntax GetLiteralExpressionSyntax(InterpolationSyntax interpolation) =>\n+            interpolation.Expression as LiteralExpressionSyntax;\n+\n+        protected override string GetText(LiteralExpressionSyntax literalExpression)\n+        {\n+            var stringToken = literalExpression.Token;\n+            var text = stringToken.ToString();\n+\n+            if (stringToken.IsVerbatimStringLiteral())\n+            {\n+                // We need to escape braces as this is an ambiguous case in interpolated strings that is \n+                // not ambiguous in verbatim strings\n+                text = text.Replace(@\"'{'\", @\"'{{'\").Replace(@\"'}'\", @\"'}}'\");\n+            }\n+\n+            return text;\n+        }\n+\n+        protected override bool IsStringLiteral(LiteralExpressionSyntax firstArgument) =>\n+            firstArgument?.IsKind(SyntaxKind.StringLiteralExpression) == true;\n+\n+        protected override ExpressionSyntax GetExpression(ArgumentSyntax argument) =>","path":"src/Features/CSharp/Portable/CodeRefactorings/ConvertToInterpolatedString/ConvertToInterpolatedStringRefactoringProvider.cs","position":56,"original_position":56,"commit_id":"6ad9b9cf1350d0b05ab8577fd5e3848a646d000d","original_commit_id":"18e0fd51a7325b374715511bbd7a2116c502010d","user":{"login":"CyrusNajmabadi","id":4564579,"avatar_url":"https://avatars.githubusercontent.com/u/4564579?v=3","gravatar_id":"","url":"https://api.github.com/users/CyrusNajmabadi","html_url":"https://github.com/CyrusNajmabadi","followers_url":"https://api.github.com/users/CyrusNajmabadi/followers","following_url":"https://api.github.com/users/CyrusNajmabadi/following{/other_user}","gists_url":"https://api.github.com/users/CyrusNajmabadi/gists{/gist_id}","starred_url":"https://api.github.com/users/CyrusNajmabadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyrusNajmabadi/subscriptions","organizations_url":"https://api.github.com/users/CyrusNajmabadi/orgs","repos_url":"https://api.github.com/users/CyrusNajmabadi/repos","events_url":"https://api.github.com/users/CyrusNajmabadi/events{/privacy}","received_events_url":"https://api.github.com/users/CyrusNajmabadi/received_events","type":"User","site_admin":false},"body":"You can get this functionality through ISyntaxFacts service.  negating the need for the subclasses to provide this functionality.","created_at":"2016-06-02T06:08:02Z","updated_at":"2016-06-02T06:08:02Z","html_url":"https://github.com/dotnet/roslyn/pull/11415#discussion_r65488284","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/11415","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/65488284"},"html":{"href":"https://github.com/dotnet/roslyn/pull/11415#discussion_r65488284"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/11415"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/11415","id":70627197,"html_url":"https://github.com/dotnet/roslyn/pull/11415","diff_url":"https://github.com/dotnet/roslyn/pull/11415.diff","patch_url":"https://github.com/dotnet/roslyn/pull/11415.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/11415","number":11415,"state":"open","locked":false,"title":"Port from CSharpEssentials of Convert-To-Interpolated-String","user":{"login":"jmarolf","id":9797472,"avatar_url":"https://avatars.githubusercontent.com/u/9797472?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarolf","html_url":"https://github.com/jmarolf","followers_url":"https://api.github.com/users/jmarolf/followers","following_url":"https://api.github.com/users/jmarolf/following{/other_user}","gists_url":"https://api.github.com/users/jmarolf/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarolf/subscriptions","organizations_url":"https://api.github.com/users/jmarolf/orgs","repos_url":"https://api.github.com/users/jmarolf/repos","events_url":"https://api.github.com/users/jmarolf/events{/privacy}","received_events_url":"https://api.github.com/users/jmarolf/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-19T02:08:12Z","updated_at":"2016-06-02T06:08:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0e5ac0e6392db87ab670327fdef980929945f12","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/11415/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/11415/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/11415/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/6ad9b9cf1350d0b05ab8577fd5e3848a646d000d","head":{"label":"jmarolf:interpolated-string-refactoring","ref":"interpolated-string-refactoring","sha":"6ad9b9cf1350d0b05ab8577fd5e3848a646d000d","user":{"login":"jmarolf","id":9797472,"avatar_url":"https://avatars.githubusercontent.com/u/9797472?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarolf","html_url":"https://github.com/jmarolf","followers_url":"https://api.github.com/users/jmarolf/followers","following_url":"https://api.github.com/users/jmarolf/following{/other_user}","gists_url":"https://api.github.com/users/jmarolf/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarolf/subscriptions","organizations_url":"https://api.github.com/users/jmarolf/orgs","repos_url":"https://api.github.com/users/jmarolf/repos","events_url":"https://api.github.com/users/jmarolf/events{/privacy}","received_events_url":"https://api.github.com/users/jmarolf/received_events","type":"User","site_admin":false},"repo":{"id":29874637,"name":"roslyn","full_name":"jmarolf/roslyn","owner":{"login":"jmarolf","id":9797472,"avatar_url":"https://avatars.githubusercontent.com/u/9797472?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarolf","html_url":"https://github.com/jmarolf","followers_url":"https://api.github.com/users/jmarolf/followers","following_url":"https://api.github.com/users/jmarolf/following{/other_user}","gists_url":"https://api.github.com/users/jmarolf/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarolf/subscriptions","organizations_url":"https://api.github.com/users/jmarolf/orgs","repos_url":"https://api.github.com/users/jmarolf/repos","events_url":"https://api.github.com/users/jmarolf/events{/privacy}","received_events_url":"https://api.github.com/users/jmarolf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmarolf/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/jmarolf/roslyn","forks_url":"https://api.github.com/repos/jmarolf/roslyn/forks","keys_url":"https://api.github.com/repos/jmarolf/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmarolf/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmarolf/roslyn/teams","hooks_url":"https://api.github.com/repos/jmarolf/roslyn/hooks","issue_events_url":"https://api.github.com/repos/jmarolf/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/jmarolf/roslyn/events","assignees_url":"https://api.github.com/repos/jmarolf/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/jmarolf/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/jmarolf/roslyn/tags","blobs_url":"https://api.github.com/repos/jmarolf/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmarolf/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmarolf/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmarolf/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmarolf/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/jmarolf/roslyn/languages","stargazers_url":"https://api.github.com/repos/jmarolf/roslyn/stargazers","contributors_url":"https://api.github.com/repos/jmarolf/roslyn/contributors","subscribers_url":"https://api.github.com/repos/jmarolf/roslyn/subscribers","subscription_url":"https://api.github.com/repos/jmarolf/roslyn/subscription","commits_url":"https://api.github.com/repos/jmarolf/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmarolf/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmarolf/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmarolf/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmarolf/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/jmarolf/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmarolf/roslyn/merges","archive_url":"https://api.github.com/repos/jmarolf/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmarolf/roslyn/downloads","issues_url":"https://api.github.com/repos/jmarolf/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/jmarolf/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/jmarolf/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/jmarolf/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmarolf/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/jmarolf/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/jmarolf/roslyn/deployments","created_at":"2015-01-26T18:16:39Z","updated_at":"2015-09-24T00:09:04Z","pushed_at":"2016-06-02T06:07:03Z","git_url":"git://github.com/jmarolf/roslyn.git","ssh_url":"git@github.com:jmarolf/roslyn.git","clone_url":"https://github.com/jmarolf/roslyn.git","svn_url":"https://github.com/jmarolf/roslyn","homepage":"","size":157218,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"dotnet:future","ref":"future","sha":"d772eb080fad8fb0bf5d0d0704899025e1309c7a","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}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2016-06-02T05:31:50Z","pushed_at":"2016-06-02T06:07:04Z","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":297892,"stargazers_count":5252,"watchers_count":5252,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1313,"mirror_url":null,"open_issues_count":2847,"forks":1313,"open_issues":2847,"watchers":5252,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/11415"},"html":{"href":"https://github.com/dotnet/roslyn/pull/11415"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/11415"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/11415/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/11415/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/11415/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/6ad9b9cf1350d0b05ab8577fd5e3848a646d000d"}}}}
{"actor":{"display_login":"CyrusNajmabadi"}}