{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/43072498","id":43072498,"diff_hunk":"@@ -0,0 +1,105 @@\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+extern alias InteractiveWindow;\n+\n+using System;\n+using System.ComponentModel.Composition;\n+using System.Runtime.CompilerServices;\n+using System.Windows;\n+using Microsoft.VisualStudio.Text.Editor;\n+using Microsoft.VisualStudio.Text.Operations;\n+using Microsoft.VisualStudio.Utilities;\n+using Microsoft.CodeAnalysis.Editor.Commands;\n+\n+namespace Microsoft.CodeAnalysis.Editor.CommandHandlers\n+{\n+    [ExportCommandHandler(PredefinedCommandHandlerNames.InteractivePaste, ContentTypeNames.RoslynContentType)]\n+    [Order(After = PredefinedCommandHandlerNames.Rename)]\n+    [Order(After = PredefinedCommandHandlerNames.FormatDocument)]\n+    [Order(After = PredefinedCommandHandlerNames.Commit)]\n+    [Order(Before = PredefinedCommandHandlerNames.Completion)]\n+    internal sealed class InteractivePasteCommandHandler : ICommandHandler<PasteCommandArgs>\n+    {\n+        // Duplicated string, originally defined at `Microsoft.VisualStudio.InteractiveWindow.PredefinedInteractiveContentTypes`\n+        private const string InteractiveContentTypeName = \"Interactive Content\";\n+        // Duplicated string, originally defined at `Microsoft.VisualStudio.InteractiveWindow.InteractiveWindow`\n+        private const string InteractiveClipboardFormat = \"89344A36-9821-495A-8255-99A63969F87D\";\n+\n+        private readonly IEditorOperationsFactoryService _editorOperationsFactoryService;\n+        private readonly ITextUndoHistoryRegistry _textUndoHistoryRegistry;\n+\n+        // This is for unit test purpose only, do not explicitly set this field otherwise.\n+        internal IRoslynClipboard RoslynClipBoard;","path":"src/EditorFeatures/Core/CommandHandlers/InteractivePasteCommandHandler.cs","position":32,"original_position":32,"commit_id":"444eb49693792e2e8564d81a962a3e6e8419a3a5","original_commit_id":"444eb49693792e2e8564d81a962a3e6e8419a3a5","user":{"login":"genlu","id":788783,"avatar_url":"https://avatars.githubusercontent.com/u/788783?v=3","gravatar_id":"","url":"https://api.github.com/users/genlu","html_url":"https://github.com/genlu","followers_url":"https://api.github.com/users/genlu/followers","following_url":"https://api.github.com/users/genlu/following{/other_user}","gists_url":"https://api.github.com/users/genlu/gists{/gist_id}","starred_url":"https://api.github.com/users/genlu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/genlu/subscriptions","organizations_url":"https://api.github.com/users/genlu/orgs","repos_url":"https://api.github.com/users/genlu/repos","events_url":"https://api.github.com/users/genlu/events{/privacy}","received_events_url":"https://api.github.com/users/genlu/received_events","type":"User","site_admin":false},"body":"Won't change it to using MEF now sicne it does't affect functionality. Need to check this in and run perf test ASAP so we can get the fix in stabilization.","created_at":"2015-10-27T00:31:09Z","updated_at":"2015-10-27T00:31:09Z","html_url":"https://github.com/dotnet/roslyn/pull/6289#discussion_r43072498","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/6289","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/43072498"},"html":{"href":"https://github.com/dotnet/roslyn/pull/6289#discussion_r43072498"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/6289"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/6289","id":48643561,"html_url":"https://github.com/dotnet/roslyn/pull/6289","diff_url":"https://github.com/dotnet/roslyn/pull/6289.diff","patch_url":"https://github.com/dotnet/roslyn/pull/6289.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/6289","number":6289,"state":"open","locked":false,"title":"Add a command handler for pasting from interactive window","user":{"login":"genlu","id":788783,"avatar_url":"https://avatars.githubusercontent.com/u/788783?v=3","gravatar_id":"","url":"https://api.github.com/users/genlu","html_url":"https://github.com/genlu","followers_url":"https://api.github.com/users/genlu/followers","following_url":"https://api.github.com/users/genlu/following{/other_user}","gists_url":"https://api.github.com/users/genlu/gists{/gist_id}","starred_url":"https://api.github.com/users/genlu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/genlu/subscriptions","organizations_url":"https://api.github.com/users/genlu/orgs","repos_url":"https://api.github.com/users/genlu/repos","events_url":"https://api.github.com/users/genlu/events{/privacy}","received_events_url":"https://api.github.com/users/genlu/received_events","type":"User","site_admin":false},"body":"- The expected behavior is, when pasting text copied from interactive window into CS/VB code editor, the prompt should be dropped. See #5212.\r\n- `InteractivePasteCommandHandler` is created under `EditorFeatures`. While the actual paste depends on `InteractiveWindow`, special care is taken to avoid loading that assembly in VS unless necessary.\r\n- Unit tests are created.\r\n\r\nThis is (mostly) ported from PR https://github.com/dotnet/roslyn/pull/6188. Now merge this into master first to verify the assembly loading behavior is actually correct (since it's hard to diagnose in dev hive).\r\n\r\n@dotnet/interactive @dotnet/roslyn-ide ","created_at":"2015-10-24T00:19:42Z","updated_at":"2015-10-27T00:31:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3357246056df52dc313fbe76bcb3ec8a07dd705d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/6289/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/6289/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/6289/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/444eb49693792e2e8564d81a962a3e6e8419a3a5","head":{"label":"genlu:IntactivePasteMaster","ref":"IntactivePasteMaster","sha":"444eb49693792e2e8564d81a962a3e6e8419a3a5","user":{"login":"genlu","id":788783,"avatar_url":"https://avatars.githubusercontent.com/u/788783?v=3","gravatar_id":"","url":"https://api.github.com/users/genlu","html_url":"https://github.com/genlu","followers_url":"https://api.github.com/users/genlu/followers","following_url":"https://api.github.com/users/genlu/following{/other_user}","gists_url":"https://api.github.com/users/genlu/gists{/gist_id}","starred_url":"https://api.github.com/users/genlu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/genlu/subscriptions","organizations_url":"https://api.github.com/users/genlu/orgs","repos_url":"https://api.github.com/users/genlu/repos","events_url":"https://api.github.com/users/genlu/events{/privacy}","received_events_url":"https://api.github.com/users/genlu/received_events","type":"User","site_admin":false},"repo":{"id":38650594,"name":"roslyn","full_name":"genlu/roslyn","owner":{"login":"genlu","id":788783,"avatar_url":"https://avatars.githubusercontent.com/u/788783?v=3","gravatar_id":"","url":"https://api.github.com/users/genlu","html_url":"https://github.com/genlu","followers_url":"https://api.github.com/users/genlu/followers","following_url":"https://api.github.com/users/genlu/following{/other_user}","gists_url":"https://api.github.com/users/genlu/gists{/gist_id}","starred_url":"https://api.github.com/users/genlu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/genlu/subscriptions","organizations_url":"https://api.github.com/users/genlu/orgs","repos_url":"https://api.github.com/users/genlu/repos","events_url":"https://api.github.com/users/genlu/events{/privacy}","received_events_url":"https://api.github.com/users/genlu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/genlu/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/genlu/roslyn","forks_url":"https://api.github.com/repos/genlu/roslyn/forks","keys_url":"https://api.github.com/repos/genlu/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/genlu/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/genlu/roslyn/teams","hooks_url":"https://api.github.com/repos/genlu/roslyn/hooks","issue_events_url":"https://api.github.com/repos/genlu/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/genlu/roslyn/events","assignees_url":"https://api.github.com/repos/genlu/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/genlu/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/genlu/roslyn/tags","blobs_url":"https://api.github.com/repos/genlu/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/genlu/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/genlu/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/genlu/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/genlu/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/genlu/roslyn/languages","stargazers_url":"https://api.github.com/repos/genlu/roslyn/stargazers","contributors_url":"https://api.github.com/repos/genlu/roslyn/contributors","subscribers_url":"https://api.github.com/repos/genlu/roslyn/subscribers","subscription_url":"https://api.github.com/repos/genlu/roslyn/subscription","commits_url":"https://api.github.com/repos/genlu/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/genlu/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/genlu/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/genlu/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/genlu/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/genlu/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/genlu/roslyn/merges","archive_url":"https://api.github.com/repos/genlu/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/genlu/roslyn/downloads","issues_url":"https://api.github.com/repos/genlu/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/genlu/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/genlu/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/genlu/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/genlu/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/genlu/roslyn/releases{/id}","created_at":"2015-07-06T22:48:49Z","updated_at":"2015-07-06T22:49:19Z","pushed_at":"2015-10-26T23:30:15Z","git_url":"git://github.com/genlu/roslyn.git","ssh_url":"git@github.com:genlu/roslyn.git","clone_url":"https://github.com/genlu/roslyn.git","svn_url":"https://github.com/genlu/roslyn","homepage":"","size":106942,"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":"0153cd7a193eed2bccde75cb13635daa017b982d","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-27T00:06:37Z","pushed_at":"2015-10-26T23:59:11Z","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":215419,"stargazers_count":3587,"watchers_count":3587,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":842,"mirror_url":null,"open_issues_count":1542,"forks":842,"open_issues":1542,"watchers":3587,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/6289"},"html":{"href":"https://github.com/dotnet/roslyn/pull/6289"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/6289"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/6289/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/6289/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/6289/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/444eb49693792e2e8564d81a962a3e6e8419a3a5"}}}}