Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
45f03cc2
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,发现更多精彩内容 >>
提交
45f03cc2
编写于
3月 16, 2017
作者:
C
CyrusNajmabadi
提交者:
GitHub
3月 16, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17904 from dotnet/merges/dev15.1.x-to-master-20170316-070003
Merge dev15.1.x to master
上级
4b6bb0c5
e990d8f7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
3 deletion
+37
-3
src/VisualStudio/Core/Test.Next/Services/ServiceHubServicesTests.cs
...Studio/Core/Test.Next/Services/ServiceHubServicesTests.cs
+31
-0
src/Workspaces/Remote/Core/Services/RemoteWorkspace.cs
src/Workspaces/Remote/Core/Services/RemoteWorkspace.cs
+6
-3
未找到文件。
src/VisualStudio/Core/Test.Next/Services/ServiceHubServicesTests.cs
浏览文件 @
45f03cc2
...
...
@@ -169,6 +169,37 @@ public async Task TestRemoteHostSynchronizeIncrementalUpdate()
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
RemoteHost
)]
public
void
TestRemoteWorkspaceCircularReferences
()
{
using
(
var
tempRoot
=
new
Microsoft
.
CodeAnalysis
.
Test
.
Utilities
.
TempRoot
())
{
var
file
=
tempRoot
.
CreateDirectory
().
CreateFile
(
"p1.dll"
);
file
.
CopyContentFrom
(
typeof
(
object
).
Assembly
.
Location
);
var
p1
=
ProjectId
.
CreateNewId
();
var
p2
=
ProjectId
.
CreateNewId
();
var
solutionInfo
=
SolutionInfo
.
Create
(
SolutionId
.
CreateNewId
(),
VersionStamp
.
Create
(),
""
,
new
[]
{
ProjectInfo
.
Create
(
p1
,
VersionStamp
.
Create
(),
"p1"
,
"p1"
,
LanguageNames
.
CSharp
,
outputFilePath
:
file
.
Path
,
projectReferences
:
new
[]
{
new
ProjectReference
(
p2
)
}),
ProjectInfo
.
Create
(
p2
,
VersionStamp
.
Create
(),
"p2"
,
"p2"
,
LanguageNames
.
CSharp
,
metadataReferences
:
new
[]
{
MetadataReference
.
CreateFromFile
(
file
.
Path
)
})
});
var
remoteWorkspace
=
new
RemoteWorkspace
(
workspaceKind
:
"test"
);
// this shouldn't throw exception
var
solution
=
remoteWorkspace
.
AddSolution
(
solutionInfo
);
Assert
.
NotNull
(
solution
);
}
}
private
static
async
Task
<
Solution
>
VerifyIncrementalUpdatesAsync
(
InProcRemoteHostClient
client
,
Solution
solution
,
string
csAddition
,
string
vbAddition
)
{
Assert
.
True
(
PrimaryWorkspace
.
Workspace
is
RemoteWorkspace
);
...
...
src/Workspaces/Remote/Core/Services/RemoteWorkspace.cs
浏览文件 @
45f03cc2
...
...
@@ -36,6 +36,12 @@ protected override void Dispose(bool finalize)
_registrationService
?.
Unregister
(
this
);
}
// constructor for testing
public
RemoteWorkspace
(
string
workspaceKind
)
:
base
(
RoslynServices
.
HostServices
,
workspaceKind
:
workspaceKind
)
{
}
// this workspace doesn't allow modification by calling TryApplyChanges.
// consumer of solution is still free to fork solution as they want, they just can't apply those changes
// back to primary workspace. only solution service can update primary workspace
...
...
@@ -68,7 +74,6 @@ public Solution AddSolution(SolutionInfo solutionInfo)
lock
(
_gate
)
{
this
.
OnSolutionAdded
(
solutionInfo
);
this
.
UpdateReferencesAfterAdd
();
return
this
.
CurrentSolution
;
}
...
...
@@ -92,8 +97,6 @@ public Solution UpdateSolution(Solution solution)
var
newSolution
=
this
.
SetCurrentSolution
(
solution
);
this
.
RaiseWorkspaceChangedEventAsync
(
WorkspaceChangeKind
.
SolutionChanged
,
oldSolution
,
newSolution
);
this
.
UpdateReferencesAfterAdd
();
return
this
.
CurrentSolution
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录