提交 b685f1a6 编写于 作者: A Artur Spychaj

Rename reset interactive variables

上级 f55b9805
......@@ -38,10 +38,10 @@ internal ResetInteractive(IEditorOptionsFactoryService editorOptionsFactoryServi
internal Task Execute(IInteractiveWindow interactiveWindow, string title)
{
ImmutableArray<string> references, referenceSearchPaths, sourceSearchPaths, namespacesToImport;
ImmutableArray<string> references, referenceSearchPaths, sourceSearchPaths, projectNamespaces;
string projectDirectory;
if (GetProjectProperties(out references, out referenceSearchPaths, out sourceSearchPaths, out namespacesToImport, out projectDirectory))
if (GetProjectProperties(out references, out referenceSearchPaths, out sourceSearchPaths, out projectNamespaces, out projectDirectory))
{
// Now, we're going to do a bunch of async operations. So create a wait
// indicator so the user knows something is happening, and also so they cancel.
......@@ -53,7 +53,7 @@ internal Task Execute(IInteractiveWindow interactiveWindow, string title)
references,
referenceSearchPaths,
sourceSearchPaths,
namespacesToImport,
projectNamespaces,
projectDirectory,
waitContext);
......@@ -75,7 +75,7 @@ internal Task Execute(IInteractiveWindow interactiveWindow, string title)
ImmutableArray<string> referencePaths,
ImmutableArray<string> referenceSearchPaths,
ImmutableArray<string> sourceSearchPaths,
ImmutableArray<string> namespacesToImport,
ImmutableArray<string> projectNamespaces,
string projectDirectory,
IWaitContext waitContext)
{
......@@ -116,8 +116,8 @@ internal Task Execute(IInteractiveWindow interactiveWindow, string title)
// Project's default namespace might be different from namespace used within project.
// Filter out namespace imports that do not exist in interactive compilation.
IEnumerable<string> existingNamespaces = await GetNamespacesToImport(namespacesToImport, interactiveWindow).ConfigureAwait(true);
var importNamespacesCommand = existingNamespaces.Select(_createImport).Join(editorOptions.GetNewLineCharacter());
IEnumerable<string> namespacesToImport = await GetNamespacesToImportAsync(projectNamespaces, interactiveWindow).ConfigureAwait(true);
var importNamespacesCommand = namespacesToImport.Select(_createImport).Join(editorOptions.GetNewLineCharacter());
if (!string.IsNullOrWhiteSpace(importNamespacesCommand))
{
......@@ -125,7 +125,7 @@ internal Task Execute(IInteractiveWindow interactiveWindow, string title)
}
}
protected abstract Task<IEnumerable<string>> GetNamespacesToImport(IEnumerable<string> namespacesToImport, IInteractiveWindow interactiveWindow);
protected abstract Task<IEnumerable<string>> GetNamespacesToImportAsync(IEnumerable<string> namespacesToImport, IInteractiveWindow interactiveWindow);
/// <summary>
/// Gets the properties of the currently selected projects necessary for reset.
......@@ -134,7 +134,7 @@ internal Task Execute(IInteractiveWindow interactiveWindow, string title)
out ImmutableArray<string> references,
out ImmutableArray<string> referenceSearchPaths,
out ImmutableArray<string> sourceSearchPaths,
out ImmutableArray<string> namespacesToImport,
out ImmutableArray<string> projectNamespaces,
out string projectDirectory);
/// <summary>
......
......@@ -85,8 +85,8 @@ public async void TestResetREPLWithProjectContext()
References = ImmutableArray.CreateRange(GetProjectReferences(workspace, project)),
ReferenceSearchPaths = ImmutableArray.Create("rsp1", "rsp2"),
SourceSearchPaths = ImmutableArray.Create("ssp1", "ssp2"),
NamespacesToImport = ImmutableArray.Create("System", "ResetInteractiveTestsDocument", "VisualBasicResetInteractiveTestsDocument"),
ExistingNamespaces = ImmutableArray.Create("System", "ResetInteractiveTestsDocument"),
ProjectNamespaces = ImmutableArray.Create("System", "ResetInteractiveTestsDocument", "VisualBasicResetInteractiveTestsDocument"),
NamespacesToImport = ImmutableArray.Create("System", "ResetInteractiveTestsDocument"),
ProjectDirectory = "pj",
};
......
......@@ -27,9 +27,9 @@ internal class TestResetInteractive : ResetInteractive
internal ImmutableArray<string> SourceSearchPaths { get; set; }
internal ImmutableArray<string> NamespacesToImport { get; set; }
internal ImmutableArray<string> ProjectNamespaces { get; set; }
internal ImmutableArray<string> ExistingNamespaces { get; set; }
internal ImmutableArray<string> NamespacesToImport { get; set; }
internal string ProjectDirectory { get; set; }
......@@ -60,13 +60,13 @@ protected override Task<bool> BuildProject()
out ImmutableArray<string> references,
out ImmutableArray<string> referenceSearchPaths,
out ImmutableArray<string> sourceSearchPaths,
out ImmutableArray<string> namespacesToImport,
out ImmutableArray<string> projectNamespaces,
out string projectDirectory)
{
references = References;
referenceSearchPaths = ReferenceSearchPaths;
sourceSearchPaths = SourceSearchPaths;
namespacesToImport = NamespacesToImport;
projectNamespaces = ProjectNamespaces;
projectDirectory = ProjectDirectory;
return true;
}
......@@ -76,9 +76,9 @@ protected override IWaitIndicator GetWaitIndicator()
return _waitIndicator;
}
protected override Task<IEnumerable<string>> GetNamespacesToImport(IEnumerable<string> namespacesToImport, IInteractiveWindow interactiveWindow)
protected override Task<IEnumerable<string>> GetNamespacesToImportAsync(IEnumerable<string> namespacesToImport, IInteractiveWindow interactiveWindow)
{
return Task.FromResult((IEnumerable<string>)ExistingNamespaces);
return Task.FromResult((IEnumerable<string>)NamespacesToImport);
}
}
}
......@@ -53,7 +53,7 @@ internal sealed class VsResetInteractive : ResetInteractive
out ImmutableArray<string> references,
out ImmutableArray<string> referenceSearchPaths,
out ImmutableArray<string> sourceSearchPaths,
out ImmutableArray<string> namespacesToImport,
out ImmutableArray<string> projectNamespaces,
out string projectDirectory)
{
var hierarchyPointer = default(IntPtr);
......@@ -61,7 +61,7 @@ internal sealed class VsResetInteractive : ResetInteractive
references = ImmutableArray<string>.Empty;
referenceSearchPaths = ImmutableArray<string>.Empty;
sourceSearchPaths = ImmutableArray<string>.Empty;
namespacesToImport = ImmutableArray<string>.Empty;
projectNamespaces = ImmutableArray<string>.Empty;
projectDirectory = null;
try
......@@ -73,7 +73,7 @@ internal sealed class VsResetInteractive : ResetInteractive
if (hierarchyPointer != IntPtr.Zero)
{
GetProjectProperties(hierarchyPointer, out references, out referenceSearchPaths, out sourceSearchPaths, out namespacesToImport, out projectDirectory);
GetProjectProperties(hierarchyPointer, out references, out referenceSearchPaths, out sourceSearchPaths, out projectNamespaces, out projectDirectory);
return true;
}
}
......@@ -91,7 +91,7 @@ internal sealed class VsResetInteractive : ResetInteractive
out ImmutableArray<string> references,
out ImmutableArray<string> referenceSearchPaths,
out ImmutableArray<string> sourceSearchPaths,
out ImmutableArray<string> namespacesToImport,
out ImmutableArray<string> projectNamespaces,
out string projectDirectory)
{
var hierarchy = (IVsHierarchy)Marshal.GetObjectForIUnknown(hierarchyPointer);
......@@ -147,7 +147,7 @@ internal sealed class VsResetInteractive : ResetInteractive
references = referencesBuilder.ToImmutableArray();
referenceSearchPaths = referenceSearchPathsBuilder.ToImmutableArray();
sourceSearchPaths = sourceSearchPathsBuilder.ToImmutableArray();
namespacesToImport = namespacesToImportBuilder.ToImmutableArray();
projectNamespaces = namespacesToImportBuilder.ToImmutableArray();
}
private static string GetReferenceString(Reference reference)
......@@ -267,7 +267,7 @@ protected override IWaitIndicator GetWaitIndicator()
/// <summary>
/// Return namespaces that can be resolved in the latest interactive compilation.
/// </summary>
protected override async Task<IEnumerable<string>> GetNamespacesToImport(IEnumerable<string> namespacesToImport, IInteractiveWindow interactiveWindow)
protected override async Task<IEnumerable<string>> GetNamespacesToImportAsync(IEnumerable<string> namespacesToImport, IInteractiveWindow interactiveWindow)
{
var document = interactiveWindow.CurrentLanguageBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
var compilation = await document.Project.GetCompilationAsync().ConfigureAwait(true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册