Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
7d069ed0
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,发现更多精彩内容 >>
提交
7d069ed0
编写于
3月 03, 2020
作者:
J
Jason Malinowski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Null annotate all the undo units we create for workspace change application
上级
e5cf10bd
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
60 addition
and
24 deletion
+60
-24
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs
.../VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs
+2
-0
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AbstractAddRemoveUndoUnit.cs
...em/VisualStudioWorkspaceImpl.AbstractAddRemoveUndoUnit.cs
+2
-1
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs
...sualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs
+3
-1
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AddAdditionalDocumentUndoUnit.cs
...isualStudioWorkspaceImpl.AddAdditionalDocumentUndoUnit.cs
+2
-0
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AddAnalyzerConfigDocumentUndoUnit.cs
...lStudioWorkspaceImpl.AddAnalyzerConfigDocumentUndoUnit.cs
+2
-0
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AddDocumentUndoUnit.cs
...ctSystem/VisualStudioWorkspaceImpl.AddDocumentUndoUnit.cs
+2
-0
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs
...VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs
+18
-13
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs
.../VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs
+2
-0
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RemoveAdditionalDocumentUndoUnit.cs
...alStudioWorkspaceImpl.RemoveAdditionalDocumentUndoUnit.cs
+4
-1
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RemoveAnalyzerConfigDocumentUndoUnit.cs
...udioWorkspaceImpl.RemoveAnalyzerConfigDocumentUndoUnit.cs
+3
-1
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RemoveDocumentUndoUnit.cs
...ystem/VisualStudioWorkspaceImpl.RemoveDocumentUndoUnit.cs
+4
-1
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs
...ualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs
+12
-6
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs
...sualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs
+2
-0
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RenameDocumentUndoUnit.cs
...ystem/VisualStudioWorkspaceImpl.RenameDocumentUndoUnit.cs
+2
-0
未找到文件。
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
Microsoft.CodeAnalysis
;
using
Microsoft.CodeAnalysis.Text
;
using
Microsoft.VisualStudio.OLE.Interop
;
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AbstractAddRemoveUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,9 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
System
;
using
Microsoft.CodeAnalysis
;
using
Microsoft.CodeAnalysis.AddImport
;
using
Microsoft.VisualStudio.OLE.Interop
;
namespace
Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
System.Collections.Generic
;
using
System.Linq
;
using
Microsoft.CodeAnalysis
;
...
...
@@ -25,7 +27,7 @@ private abstract class AbstractRemoveDocumentUndoUnit : AbstractAddRemoveUndoUni
protected
abstract
IReadOnlyList
<
DocumentId
>
GetDocumentIds
(
Project
fromProject
);
protected
abstract
TextDocument
GetDocument
(
Solution
currentSolution
);
protected
abstract
TextDocument
?
GetDocument
(
Solution
currentSolution
);
public
override
void
Do
(
IOleUndoManager
pUndoManager
)
{
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AddAdditionalDocumentUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
Microsoft.CodeAnalysis
;
using
Microsoft.CodeAnalysis.Text
;
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AddAnalyzerConfigDocumentUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
Microsoft.CodeAnalysis
;
using
Microsoft.CodeAnalysis.Text
;
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AddDocumentUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
Microsoft.CodeAnalysis
;
using
Microsoft.CodeAnalysis.Text
;
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
System
;
using
System.IO
;
using
System.Linq
;
...
...
@@ -29,22 +31,25 @@ public override void Do(IOleUndoManager pUndoManager)
{
var
currentSolution
=
Workspace
.
CurrentSolution
;
var
fromProject
=
currentSolution
.
GetProject
(
FromProjectId
);
var
reference
=
fromProject
?.
MetadataReferences
.
OfType
<
PortableExecutableReference
>()
.
FirstOrDefault
(
p
=>
StringComparer
.
OrdinalIgnoreCase
.
Equals
(
p
.
FilePath
,
_filePath
));
if
(
reference
==
null
)
if
(
fromProject
!=
null
)
{
try
{
reference
=
MetadataReference
.
CreateFromFile
(
_filePath
);
}
catch
(
IOException
)
var
reference
=
fromProject
.
MetadataReferences
.
OfType
<
PortableExecutableReference
>()
.
FirstOrDefault
(
p
=>
StringComparer
.
OrdinalIgnoreCase
.
Equals
(
p
.
FilePath
,
_filePath
));
if
(
reference
==
null
)
{
return
;
}
try
{
reference
=
MetadataReference
.
CreateFromFile
(
_filePath
);
}
catch
(
IOException
)
{
return
;
}
var
updatedProject
=
fromProject
.
AddMetadataReference
(
reference
);
Workspace
.
TryApplyChanges
(
updatedProject
.
Solution
);
var
updatedProject
=
fromProject
.
AddMetadataReference
(
reference
);
Workspace
.
TryApplyChanges
(
updatedProject
.
Solution
);
}
}
}
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
System.Linq
;
using
System.Threading
;
using
Microsoft.CodeAnalysis
;
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RemoveAdditionalDocumentUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,6 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
System
;
using
System.Collections.Generic
;
using
Microsoft.CodeAnalysis
;
...
...
@@ -21,7 +24,7 @@ private class RemoveAdditionalDocumentUndoUnit : AbstractRemoveDocumentUndoUnit
protected
override
IReadOnlyList
<
DocumentId
>
GetDocumentIds
(
Project
fromProject
)
=>
fromProject
.
AdditionalDocumentIds
;
protected
override
TextDocument
GetDocument
(
Solution
currentSolution
)
protected
override
TextDocument
?
GetDocument
(
Solution
currentSolution
)
=>
currentSolution
.
GetAdditionalDocument
(
this
.
DocumentId
);
}
}
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RemoveAnalyzerConfigDocumentUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
System.Collections.Generic
;
using
Microsoft.CodeAnalysis
;
...
...
@@ -21,7 +23,7 @@ private class RemoveAnalyzerConfigDocumentUndoUnit : AbstractRemoveDocumentUndoU
protected
override
IReadOnlyList
<
DocumentId
>
GetDocumentIds
(
Project
fromProject
)
=>
fromProject
.
State
.
AnalyzerConfigDocumentIds
.
AsImmutable
();
protected
override
TextDocument
GetDocument
(
Solution
currentSolution
)
protected
override
TextDocument
?
GetDocument
(
Solution
currentSolution
)
=>
currentSolution
.
GetAnalyzerConfigDocument
(
this
.
DocumentId
);
}
}
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RemoveDocumentUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,8 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
System.Collections.Generic
;
using
Microsoft.CodeAnalysis
;
using
Microsoft.CodeAnalysis.Shared.Extensions
;
namespace
Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
{
...
...
@@ -21,7 +24,7 @@ private class RemoveDocumentUndoUnit : AbstractRemoveDocumentUndoUnit
protected
override
IReadOnlyList
<
DocumentId
>
GetDocumentIds
(
Project
fromProject
)
=>
fromProject
.
DocumentIds
;
protected
override
TextDocument
GetDocument
(
Solution
currentSolution
)
protected
override
TextDocument
?
GetDocument
(
Solution
currentSolution
)
=>
currentSolution
.
GetDocument
(
this
.
DocumentId
);
}
}
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,10 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
System
;
using
System.IO
;
using
System.Linq
;
using
Microsoft.CodeAnalysis
;
using
Microsoft.CodeAnalysis.Shared.Extensions
;
using
Microsoft.VisualStudio.OLE.Interop
;
namespace
Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
...
...
@@ -29,13 +32,16 @@ public override void Do(IOleUndoManager pUndoManager)
{
var
currentSolution
=
Workspace
.
CurrentSolution
;
var
fromProject
=
currentSolution
.
GetProject
(
FromProjectId
);
var
reference
=
fromProject
?.
MetadataReferences
.
OfType
<
PortableExecutableReference
>()
.
FirstOrDefault
(
p
=>
StringComparer
.
OrdinalIgnoreCase
.
Equals
(
p
.
FilePath
,
_filePath
));
if
(
reference
!=
null
)
if
(
fromProject
!=
null
)
{
var
updatedProject
=
fromProject
.
RemoveMetadataReference
(
reference
);
Workspace
.
TryApplyChanges
(
updatedProject
.
Solution
);
var
reference
=
fromProject
.
MetadataReferences
.
OfType
<
PortableExecutableReference
>()
.
FirstOrDefault
(
p
=>
StringComparer
.
OrdinalIgnoreCase
.
Equals
(
p
.
FilePath
!,
_filePath
));
if
(
reference
!=
null
)
{
var
updatedProject
=
fromProject
.
RemoveMetadataReference
(
reference
);
Workspace
.
TryApplyChanges
(
updatedProject
.
Solution
);
}
}
}
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
System.Linq
;
using
Microsoft.CodeAnalysis
;
using
Microsoft.VisualStudio.OLE.Interop
;
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RenameDocumentUndoUnit.cs
浏览文件 @
7d069ed0
...
...
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#
nullable
enable
using
System
;
using
System.Linq
;
using
Microsoft.VisualStudio.OLE.Interop
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录