Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
b685f1a6
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b685f1a6
编写于
2月 19, 2016
作者:
A
Artur Spychaj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename reset interactive variables
上级
f55b9805
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
22 deletion
+22
-22
src/Interactive/EditorFeatures/Core/Extensibility/Interactive/ResetInteractive.cs
...atures/Core/Extensibility/Interactive/ResetInteractive.cs
+8
-8
src/VisualStudio/CSharp/Test/Interactive/Commands/ResetInteractiveTests.cs
...CSharp/Test/Interactive/Commands/ResetInteractiveTests.cs
+2
-2
src/VisualStudio/CSharp/Test/Interactive/Commands/TestResetInteractive.cs
.../CSharp/Test/Interactive/Commands/TestResetInteractive.cs
+6
-6
src/VisualStudio/InteractiveServices/Interactive/VsResetInteractive.cs
...dio/InteractiveServices/Interactive/VsResetInteractive.cs
+6
-6
未找到文件。
src/Interactive/EditorFeatures/Core/Extensibility/Interactive/ResetInteractive.cs
浏览文件 @
b685f1a6
...
...
@@ -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
>>
GetNamespacesToImport
Async
(
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>
...
...
src/VisualStudio/CSharp/Test/Interactive/Commands/ResetInteractiveTests.cs
浏览文件 @
b685f1a6
...
...
@@ -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"
,
};
...
...
src/VisualStudio/CSharp/Test/Interactive/Commands/TestResetInteractive.cs
浏览文件 @
b685f1a6
...
...
@@ -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
>>
GetNamespacesToImport
Async
(
IEnumerable
<
string
>
namespacesToImport
,
IInteractiveWindow
interactiveWindow
)
{
return
Task
.
FromResult
((
IEnumerable
<
string
>)
ExistingNamespaces
);
return
Task
.
FromResult
((
IEnumerable
<
string
>)
NamespacesToImport
);
}
}
}
src/VisualStudio/InteractiveServices/Interactive/VsResetInteractive.cs
浏览文件 @
b685f1a6
...
...
@@ -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
>>
GetNamespacesToImport
Async
(
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录