提交 14248995 编写于 作者: A Andrew Casey

Remove namespaces from ScriptOptions.Default

The IDE does not consume ScriptOptions.Default so the IDE and the host
were out of sync.  For example, ```typeof(Console)``` would be squiggled
in the Interactive window but would evaluate correctly when submitted.

Fixes #4154
上级 4b0e2a75
......@@ -71,7 +71,7 @@ public void TestRunScriptWithSpecifiedReturnType()
[Fact]
public void TestRunVoidScript()
{
var result = CSharpScript.RunAsync("Console.WriteLine(0);");
var result = CSharpScript.RunAsync("System.Console.WriteLine(0);");
var task = result.ReturnValue;
Assert.Null(task.Result);
}
......
......@@ -33,8 +33,7 @@ public ScriptOptions()
static ScriptOptions()
{
Default = new ScriptOptions()
.WithReferences(typeof(int).GetTypeInfo().Assembly)
.WithNamespaces("System");
.WithReferences(typeof(int).GetTypeInfo().Assembly);
}
private ScriptOptions(
......
......@@ -62,11 +62,18 @@ Namespace Microsoft.CodeAnalysis.Scripting.VisualBasic.UnitTests
<Fact>
Public Sub TestRunVoidScript()
Dim result = VisualBasicScript.RunAsync("Console.WriteLine(0)", DefaultOptions)
Dim result = VisualBasicScript.RunAsync("System.Console.WriteLine(0)", DefaultOptions)
Dim task = result.ReturnValue
Assert.Null(task.Result)
End Sub
<Fact>
Public Sub TestDefaultNamespaces()
' If this ever changes, it is important to ensure that the
' IDE is also updated with the same default namespaces.
Assert.Empty(ScriptOptions.Default.Namespaces)
End Sub
Public Class Globals
Public X As Integer
Public Y As Integer
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册