{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/9894","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/9894/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/9894/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/9894/events","html_url":"https://github.com/dotnet/roslyn/pull/9894","id":141930057,"number":9894,"title":"Allow interactive window evaluation of empty line.","user":{"login":"huguesv","id":1696845,"avatar_url":"https://avatars.githubusercontent.com/u/1696845?v=3","gravatar_id":"","url":"https://api.github.com/users/huguesv","html_url":"https://github.com/huguesv","followers_url":"https://api.github.com/users/huguesv/followers","following_url":"https://api.github.com/users/huguesv/following{/other_user}","gists_url":"https://api.github.com/users/huguesv/gists{/gist_id}","starred_url":"https://api.github.com/users/huguesv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huguesv/subscriptions","organizations_url":"https://api.github.com/users/huguesv/orgs","repos_url":"https://api.github.com/users/huguesv/repos","events_url":"https://api.github.com/users/huguesv/events{/privacy}","received_events_url":"https://api.github.com/users/huguesv/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Interactive","name":"Area-Interactive","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/cla-signed","name":"cla-signed","color":"207de5"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Interactive-ScriptingIDE","name":"Interactive-ScriptingIDE","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-18T17:25:42Z","updated_at":"2016-03-29T20:45:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/9894","html_url":"https://github.com/dotnet/roslyn/pull/9894","diff_url":"https://github.com/dotnet/roslyn/pull/9894.diff","patch_url":"https://github.com/dotnet/roslyn/pull/9894.patch"},"body":"In R Tools for Visual Studio (http://github.com/Microsoft/RTVS), we are having an issue with scenarios where the user runs built-in demos in the interactive window, and those prompt the user to hit return to continue.\r\n\r\nhttps://github.com/dotnet/roslyn/issues/8569\r\nhttps://github.com/Microsoft/RTVS/issues/626 (see the image in my Feb 5 comment)\r\n\r\nThis is a case where the input code is empty, ie. after it's trimmed, its length is 0.  While most examples will work fine if the user types anything but spaces before hitting return, the user just doesn't know that.\r\n\r\nWith the existing interactive window code, when the user presses return without typing any code, the interactive window asks our evaluator if the code can be executed, to which we say yes, but then the evaluator never gets called to execute the code.\r\n\r\nUnfortunately, with the way things are with the R interpreter, we are not able to tell the difference between reading code and reading standard input.  In Python, we can, and we call ReadStandardInput when scripts call things such as `input()`, so we do not run into this issue.  In R, this all goes through evaluate code.\r\n\r\nThe existing automated tests indicate that there are no regressions if I just remove the code that tries to special case empty lines, which is what I did in this PR.  Manually poking around using C# interactive, I have not noticed any change in behavior.\r\n\r\nI've also experimented with making this opt-in, by adding an InteractiveWindowOptions.EvaluateEmptyLine option to Window.TextView.Options.\r\n\r\nIf you think you would prefer that, I can issue a PR with those changes.  Adding options add more complexity, and I felt it wasn't worth it in this case.\r\n\r\nLet me know what you think.  Thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/203093375","html_url":"https://github.com/dotnet/roslyn/pull/9894#issuecomment-203093375","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/9894","id":203093375,"user":{"login":"huguesv","id":1696845,"avatar_url":"https://avatars.githubusercontent.com/u/1696845?v=3","gravatar_id":"","url":"https://api.github.com/users/huguesv","html_url":"https://github.com/huguesv","followers_url":"https://api.github.com/users/huguesv/followers","following_url":"https://api.github.com/users/huguesv/following{/other_user}","gists_url":"https://api.github.com/users/huguesv/gists{/gist_id}","starred_url":"https://api.github.com/users/huguesv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huguesv/subscriptions","organizations_url":"https://api.github.com/users/huguesv/orgs","repos_url":"https://api.github.com/users/huguesv/repos","events_url":"https://api.github.com/users/huguesv/events{/privacy}","received_events_url":"https://api.github.com/users/huguesv/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T20:45:44Z","updated_at":"2016-03-29T20:45:44Z","body":"Please let me know if you want me to make further changes to this PR.  Thanks!"}}