Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
f6ad71ab
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,发现更多精彩内容 >>
未验证
提交
f6ad71ab
编写于
4月 06, 2020
作者:
S
Sam Harwell
提交者:
GitHub
4月 06, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #42962 from sharwell/faster-suppressions
Faster suppressions
上级
efa5d647
b7b2d0f7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
58 addition
and
12 deletion
+58
-12
src/Compilers/Core/Portable/CommandLine/CommonCompiler.SuppressionDiagnostic.cs
...table/CommandLine/CommonCompiler.SuppressionDiagnostic.cs
+5
-5
src/Compilers/Core/Portable/Diagnostic/Diagnostic.DiagnosticWithProgrammaticSuppression.cs
...ostic/Diagnostic.DiagnosticWithProgrammaticSuppression.cs
+5
-5
src/Compilers/Core/Portable/Diagnostic/DiagnosticDescriptor.cs
...ompilers/Core/Portable/Diagnostic/DiagnosticDescriptor.cs
+5
-0
src/Compilers/Core/Portable/Diagnostic/DiagnosticWithInfo.cs
src/Compilers/Core/Portable/Diagnostic/DiagnosticWithInfo.cs
+1
-1
src/Compilers/Core/Portable/Diagnostic/Diagnostic_SimpleDiagnostic.cs
...s/Core/Portable/Diagnostic/Diagnostic_SimpleDiagnostic.cs
+5
-0
src/Compilers/Core/Portable/DiagnosticAnalyzer/Suppression.cs
...Compilers/Core/Portable/DiagnosticAnalyzer/Suppression.cs
+32
-1
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
+5
-0
未找到文件。
src/Compilers/Core/Portable/CommandLine/CommonCompiler.SuppressionDiagnostic.cs
浏览文件 @
f6ad71ab
...
...
@@ -69,15 +69,15 @@ public override string GetMessage(IFormatProvider formatProvider = null)
public
override
bool
Equals
(
Diagnostic
obj
)
{
var
other
=
obj
as
SuppressionDiagnostic
;
if
(
other
==
null
)
if
(
ReferenceEquals
(
this
,
obj
))
{
return
fals
e
;
return
tru
e
;
}
if
(
ReferenceEquals
(
this
,
other
))
var
other
=
obj
as
SuppressionDiagnostic
;
if
(
other
==
null
)
{
return
tru
e
;
return
fals
e
;
}
return
Equals
(
_originalDiagnostic
,
other
.
_originalDiagnostic
)
&&
...
...
src/Compilers/Core/Portable/Diagnostic/Diagnostic.DiagnosticWithProgrammaticSuppression.cs
浏览文件 @
f6ad71ab
...
...
@@ -87,15 +87,15 @@ public override IReadOnlyList<Location> AdditionalLocations
public
override
bool
Equals
(
Diagnostic
?
obj
)
{
var
other
=
obj
as
DiagnosticWithProgrammaticSuppression
;
if
(
other
==
null
)
if
(
ReferenceEquals
(
this
,
obj
))
{
return
fals
e
;
return
tru
e
;
}
if
(
ReferenceEquals
(
this
,
other
))
var
other
=
obj
as
DiagnosticWithProgrammaticSuppression
;
if
(
other
==
null
)
{
return
tru
e
;
return
fals
e
;
}
return
Equals
(
_originalUnsuppressedDiagnostic
,
other
.
_originalUnsuppressedDiagnostic
)
&&
...
...
src/Compilers/Core/Portable/Diagnostic/DiagnosticDescriptor.cs
浏览文件 @
f6ad71ab
...
...
@@ -173,6 +173,11 @@ public sealed class DiagnosticDescriptor : IEquatable<DiagnosticDescriptor?>
public
bool
Equals
(
DiagnosticDescriptor
?
other
)
{
if
(
ReferenceEquals
(
this
,
other
))
{
return
true
;
}
return
other
!=
null
&&
this
.
Category
==
other
.
Category
&&
...
...
src/Compilers/Core/Portable/Diagnostic/DiagnosticWithInfo.cs
浏览文件 @
f6ad71ab
...
...
@@ -150,7 +150,7 @@ public override bool Equals(object? obj)
public
override
bool
Equals
(
Diagnostic
?
obj
)
{
if
(
this
==
obj
)
if
(
ReferenceEquals
(
this
,
obj
)
)
{
return
true
;
}
...
...
src/Compilers/Core/Portable/Diagnostic/Diagnostic_SimpleDiagnostic.cs
浏览文件 @
f6ad71ab
...
...
@@ -146,6 +146,11 @@ public override IReadOnlyList<Location> AdditionalLocations
public
override
bool
Equals
(
Diagnostic
?
obj
)
{
if
(
ReferenceEquals
(
this
,
obj
))
{
return
true
;
}
var
other
=
obj
as
SimpleDiagnostic
;
if
(
other
==
null
)
{
...
...
src/Compilers/Core/Portable/DiagnosticAnalyzer/Suppression.cs
浏览文件 @
f6ad71ab
...
...
@@ -3,14 +3,16 @@
// See the LICENSE file in the project root for more information.
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
Roslyn.Utilities
;
namespace
Microsoft.CodeAnalysis.Diagnostics
{
/// <summary>
/// Programmatic suppression of a <see cref="Diagnostic"/> by a <see cref="DiagnosticSuppressor"/>.
/// </summary>
public
struct
Suppression
public
struct
Suppression
:
IEquatable
<
Suppression
>
{
private
Suppression
(
SuppressionDescriptor
descriptor
,
Diagnostic
suppressedDiagnostic
)
{
...
...
@@ -48,5 +50,34 @@ public static Suppression Create(SuppressionDescriptor descriptor, Diagnostic su
/// Diagnostic suppressed by this suppression.
/// </summary>
public
Diagnostic
SuppressedDiagnostic
{
get
;
}
public
static
bool
operator
==(
Suppression
left
,
Suppression
right
)
{
return
left
.
Equals
(
right
);
}
public
static
bool
operator
!=(
Suppression
left
,
Suppression
right
)
{
return
!(
left
==
right
);
}
public
override
bool
Equals
(
object
obj
)
{
return
obj
is
Suppression
suppression
&&
Equals
(
suppression
);
}
public
bool
Equals
(
Suppression
other
)
{
return
EqualityComparer
<
SuppressionDescriptor
>.
Default
.
Equals
(
Descriptor
,
other
.
Descriptor
)
&&
EqualityComparer
<
Diagnostic
>.
Default
.
Equals
(
SuppressedDiagnostic
,
other
.
SuppressedDiagnostic
);
}
public
override
int
GetHashCode
()
{
return
Hash
.
Combine
(
EqualityComparer
<
SuppressionDescriptor
>.
Default
.
GetHashCode
(
Descriptor
),
EqualityComparer
<
Diagnostic
>.
Default
.
GetHashCode
(
SuppressedDiagnostic
));
}
}
}
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
浏览文件 @
f6ad71ab
Microsoft.CodeAnalysis.CommandLineSourceFile.CommandLineSourceFile(string path, bool isScript, bool isInputRedirected) -> void
Microsoft.CodeAnalysis.CommandLineSourceFile.IsInputRedirected.get -> bool
Microsoft.CodeAnalysis.Diagnostics.Suppression.Equals(Microsoft.CodeAnalysis.Diagnostics.Suppression other) -> bool
Microsoft.CodeAnalysis.GeneratorAttribute
Microsoft.CodeAnalysis.GeneratorAttribute.GeneratorAttribute() -> void
Microsoft.CodeAnalysis.GeneratorDriver
...
...
@@ -26,5 +27,9 @@ Microsoft.CodeAnalysis.SourceGeneratorContext.SyntaxReceiver.get -> Microsoft.Co
Microsoft.CodeAnalysis.SyntaxNode.FirstAncestorOrSelf<TNode, TArg>(System.Func<TNode, TArg, bool> predicate, TArg argument, bool ascendOutOfTrivia = true) -> TNode
Microsoft.CodeAnalysis.SyntaxReceiverCreator
override Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.GetGenerators() -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISourceGenerator>
override Microsoft.CodeAnalysis.Diagnostics.Suppression.Equals(object obj) -> bool
override Microsoft.CodeAnalysis.Diagnostics.Suppression.GetHashCode() -> int
static Microsoft.CodeAnalysis.Diagnostics.Suppression.operator !=(Microsoft.CodeAnalysis.Diagnostics.Suppression left, Microsoft.CodeAnalysis.Diagnostics.Suppression right) -> bool
static Microsoft.CodeAnalysis.Diagnostics.Suppression.operator ==(Microsoft.CodeAnalysis.Diagnostics.Suppression left, Microsoft.CodeAnalysis.Diagnostics.Suppression right) -> bool
virtual Microsoft.CodeAnalysis.Diagnostics.AnalyzerReference.GetGenerators() -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISourceGenerator>
const Microsoft.CodeAnalysis.WellKnownDiagnosticTags.CustomObsolete = "CustomObsolete" -> string
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录