Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
31eeea58
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,发现更多精彩内容 >>
提交
31eeea58
编写于
4月 15, 2020
作者:
D
dotnet-bot
提交者:
Manish Vasani
4月 15, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FixAll in solution for IDE0036 (Order modifiers) for C# projects
上级
79a7d02d
变更
56
隐藏空白更改
内联
并排
Showing
56 changed file
with
76 addition
and
76 deletion
+76
-76
src/Analyzers/CSharp/Analyzers/UseInferredMemberName/CSharpUseInferredMemberNameDiagnosticAnalyzer.cs
...mberName/CSharpUseInferredMemberNameDiagnosticAnalyzer.cs
+1
-1
src/Analyzers/Core/Analyzers/UseInferredMemberName/AbstractUseInferredMemberNameDiagnosticAnalyzer.cs
...erName/AbstractUseInferredMemberNameDiagnosticAnalyzer.cs
+1
-1
src/Analyzers/Core/CodeFixes/UseInferredMemberName/AbstractUseInferredMemberNameCodeFixProvider.cs
...emberName/AbstractUseInferredMemberNameCodeFixProvider.cs
+1
-1
src/Features/CSharp/Portable/Completion/CompletionProviders/PartialTypeCompletionProvider.cs
...tion/CompletionProviders/PartialTypeCompletionProvider.cs
+1
-1
src/Features/CSharp/Portable/Completion/CompletionProviders/SymbolCompletionProvider.cs
...ompletion/CompletionProviders/SymbolCompletionProvider.cs
+2
-2
src/Features/CSharp/Portable/EncapsulateField/CSharpEncapsulateFieldService.cs
...ortable/EncapsulateField/CSharpEncapsulateFieldService.cs
+1
-1
src/Features/CSharp/Portable/ExternalAccess/Pythia/PythiaSignatureHelpProvider.cs
...able/ExternalAccess/Pythia/PythiaSignatureHelpProvider.cs
+1
-1
src/Features/CSharp/Portable/Organizing/Organizers/ModifiersOrganizer.Comparer.cs
...able/Organizing/Organizers/ModifiersOrganizer.Comparer.cs
+1
-1
src/Features/Core/Portable/AddImport/References/Reference.cs
src/Features/Core/Portable/AddImport/References/Reference.cs
+1
-1
src/Features/Core/Portable/AddPackage/AbstractAddPackageCodeFixProvider.cs
.../Portable/AddPackage/AbstractAddPackageCodeFixProvider.cs
+1
-1
src/Features/Core/Portable/CodeFixes/Async/AbstractAsyncCodeFix.cs
...res/Core/Portable/CodeFixes/Async/AbstractAsyncCodeFix.cs
+1
-1
src/Features/Core/Portable/CodeFixes/FixAllOccurrences/FixSomeCodeAction.cs
...Portable/CodeFixes/FixAllOccurrences/FixSomeCodeAction.cs
+1
-1
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.FixAllProvider.cs
...sion/AbstractSuppressionCodeFixProvider.FixAllProvider.cs
+1
-1
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.LocalSuppressMessageCodeAction.cs
...pressionCodeFixProvider.LocalSuppressMessageCodeAction.cs
+1
-1
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.PragmaHelpers.cs
...ssion/AbstractSuppressionCodeFixProvider.PragmaHelpers.cs
+1
-1
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.PragmaWarningCodeAction.cs
...ractSuppressionCodeFixProvider.PragmaWarningCodeAction.cs
+1
-1
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs
...CodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs
+1
-1
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs
...nCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs
+1
-1
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs
...sionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs
+1
-1
src/Features/Core/Portable/CodeFixes/Suppression/WrapperCodeFixProvider.cs
.../Portable/CodeFixes/Suppression/WrapperCodeFixProvider.cs
+1
-1
src/Features/Core/Portable/Completion/CompletionServiceWithProviders.cs
...ore/Portable/Completion/CompletionServiceWithProviders.cs
+1
-1
src/Features/Core/Portable/Completion/Providers/AbstractPartialTypeCompletionProvider.cs
...letion/Providers/AbstractPartialTypeCompletionProvider.cs
+1
-1
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractExtensionMethodImportCompletionProvider.cs
...ovider/AbstractExtensionMethodImportCompletionProvider.cs
+1
-1
src/Features/Core/Portable/Completion/Providers/SymbolMatchPriority.cs
...Core/Portable/Completion/Providers/SymbolMatchPriority.cs
+6
-6
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.InMemoryStorage.cs
...EngineV2/DiagnosticIncrementalAnalyzer.InMemoryStorage.cs
+1
-1
src/Features/Core/Portable/DocumentationComments/CodeFixes/AbstractAddDocCommentNodesCodeFixProvider.cs
...ts/CodeFixes/AbstractAddDocCommentNodesCodeFixProvider.cs
+1
-1
src/Features/Core/Portable/DocumentationComments/CodeFixes/AbstractRemoveDocCommentNodeCodeFixProvider.cs
.../CodeFixes/AbstractRemoveDocCommentNodeCodeFixProvider.cs
+1
-1
src/Features/Core/Portable/EditAndContinue/EditAndContinueMethodDebugInfoReader.cs
...e/EditAndContinue/EditAndContinueMethodDebugInfoReader.cs
+2
-2
src/Features/Core/Portable/GenerateMember/GenerateVariable/AbstractGenerateVariableService.GenerateLocalCodeAction.cs
...bstractGenerateVariableService.GenerateLocalCodeAction.cs
+1
-1
src/Features/Core/Portable/IntroduceVariable/AbstractIntroduceVariableService.State.cs
...troduceVariable/AbstractIntroduceVariableService.State.cs
+1
-1
src/Features/Core/Portable/MetadataAsSource/AbstractMetadataAsSourceService+CompatAbstractMetadataFormattingRule.cs
...taAsSourceService+CompatAbstractMetadataFormattingRule.cs
+6
-6
src/Features/Core/Portable/PullMemberUp/Dialog/PullMemberUpWithDialogCodeAction.cs
...e/PullMemberUp/Dialog/PullMemberUpWithDialogCodeAction.cs
+1
-1
src/Workspaces/CSharp/Portable/Workspace/LanguageServices/CSharpSyntaxTreeFactory.PathSyntaxReference.cs
...geServices/CSharpSyntaxTreeFactory.PathSyntaxReference.cs
+1
-1
src/Workspaces/CSharp/Portable/Workspace/LanguageServices/CSharpSyntaxTreeFactoryService.PositionalSyntaxReference.cs
...harpSyntaxTreeFactoryService.PositionalSyntaxReference.cs
+1
-1
src/Workspaces/Core/Portable/CodeActions/CodeAction.cs
src/Workspaces/Core/Portable/CodeActions/CodeAction.cs
+1
-1
src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/BatchFixAllProvider.cs
...rtable/CodeFixes/FixAllOccurrences/BatchFixAllProvider.cs
+1
-1
src/Workspaces/Core/Portable/Execution/AssetStorages.Storage.cs
...rkspaces/Core/Portable/Execution/AssetStorages.Storage.cs
+1
-1
src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingWorkspaceExtensions.cs
...lAccess/UnitTesting/Api/UnitTestingWorkspaceExtensions.cs
+1
-1
src/Workspaces/Core/Portable/LanguageServices/DeclaredSymbolFactoryService/AbstractDeclaredSymbolInfoFactoryService.cs
...actoryService/AbstractDeclaredSymbolInfoFactoryService.cs
+2
-2
src/Workspaces/Core/Portable/PatternMatching/PatternMatch.cs
src/Workspaces/Core/Portable/PatternMatching/PatternMatch.cs
+1
-1
src/Workspaces/Core/Portable/SymbolSearch/ISymbolSearchService.cs
...spaces/Core/Portable/SymbolSearch/ISymbolSearchService.cs
+1
-1
src/Workspaces/Core/Portable/TemporaryStorage/TemporaryStorageServiceFactory.MemoryMappedInfo.cs
...torage/TemporaryStorageServiceFactory.MemoryMappedInfo.cs
+1
-1
src/Workspaces/Core/Portable/Workspace/Host/Status/WorkspaceStatusService.cs
.../Portable/Workspace/Host/Status/WorkspaceStatusService.cs
+1
-1
src/Workspaces/Core/Portable/Workspace/WorkspaceDiagnosticDescriptors.cs
...Core/Portable/Workspace/WorkspaceDiagnosticDescriptors.cs
+1
-1
src/Workspaces/MSBuildTest/TestFiles/Resources.cs
src/Workspaces/MSBuildTest/TestFiles/Resources.cs
+2
-2
src/Workspaces/Remote/Core/Services/SolutionService.cs
src/Workspaces/Remote/Core/Services/SolutionService.cs
+2
-2
src/Workspaces/Remote/ServiceHub/Services/RemoteHostService.cs
...orkspaces/Remote/ServiceHub/Services/RemoteHostService.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/Rules/CompatAbstractFormattingRule.cs
...ler/Core/Formatting/Rules/CompatAbstractFormattingRule.cs
+6
-6
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/AbstractSyntaxFacts.cs
...Compiler/Core/Services/SyntaxFacts/AbstractSyntaxFacts.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/ComparerWithState.cs
...ndExtensions/Compiler/Core/Utilities/ComparerWithState.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/SerializableBytes.cs
...ndExtensions/Compiler/Core/Utilities/SerializableBytes.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/EmbeddedLanguages/VirtualChars/CSharpVirtualCharLanguageServiceFactory.cs
...s/VirtualChars/CSharpVirtualCharLanguageServiceFactory.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Extensions/ContextQuery/CSharpSyntaxContext.cs
...ace/CSharp/Extensions/ContextQuery/CSharpSyntaxContext.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpSyntaxFactsService.cs
...space/CSharp/LanguageServices/CSharpSyntaxFactsService.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpSyntaxKindsServiceFactory.cs
...Sharp/LanguageServices/CSharpSyntaxKindsServiceFactory.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/DocumentExtensions.cs
...xtensions/Workspace/Core/Extensions/DocumentExtensions.cs
+1
-1
未找到文件。
src/Analyzers/CSharp/Analyzers/UseInferredMemberName/CSharpUseInferredMemberNameDiagnosticAnalyzer.cs
浏览文件 @
31eeea58
...
...
@@ -22,7 +22,7 @@ internal sealed class CSharpUseInferredMemberNameDiagnosticAnalyzer : AbstractUs
protected
override
void
InitializeWorker
(
AnalysisContext
context
)
=>
context
.
RegisterSyntaxNodeAction
(
AnalyzeSyntax
,
SyntaxKind
.
NameColon
,
SyntaxKind
.
NameEquals
);
override
protected
void
LanguageSpecificAnalyzeSyntax
(
SyntaxNodeAnalysisContext
context
,
SyntaxTree
syntaxTree
,
AnalyzerOptions
options
,
CancellationToken
cancellationToken
)
protected
override
void
LanguageSpecificAnalyzeSyntax
(
SyntaxNodeAnalysisContext
context
,
SyntaxTree
syntaxTree
,
AnalyzerOptions
options
,
CancellationToken
cancellationToken
)
{
var
parseOptions
=
(
CSharpParseOptions
)
syntaxTree
.
Options
;
switch
(
context
.
Node
.
Kind
())
...
...
src/Analyzers/Core/Analyzers/UseInferredMemberName/AbstractUseInferredMemberNameDiagnosticAnalyzer.cs
浏览文件 @
31eeea58
...
...
@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.UseInferredMemberName
{
internal
abstract
class
AbstractUseInferredMemberNameDiagnosticAnalyzer
:
AbstractBuiltInCodeStyleDiagnosticAnalyzer
{
abstract
protected
void
LanguageSpecificAnalyzeSyntax
(
SyntaxNodeAnalysisContext
context
,
SyntaxTree
syntaxTree
,
AnalyzerOptions
options
,
CancellationToken
cancellationToken
);
protected
abstract
void
LanguageSpecificAnalyzeSyntax
(
SyntaxNodeAnalysisContext
context
,
SyntaxTree
syntaxTree
,
AnalyzerOptions
options
,
CancellationToken
cancellationToken
);
public
AbstractUseInferredMemberNameDiagnosticAnalyzer
()
:
base
(
IDEDiagnosticIds
.
UseInferredMemberNameDiagnosticId
,
...
...
src/Analyzers/Core/CodeFixes/UseInferredMemberName/AbstractUseInferredMemberNameCodeFixProvider.cs
浏览文件 @
31eeea58
...
...
@@ -17,7 +17,7 @@ namespace Microsoft.CodeAnalysis.UseInferredMemberName
{
internal
abstract
class
AbstractUseInferredMemberNameCodeFixProvider
:
SyntaxEditorBasedCodeFixProvider
{
abstract
protected
void
LanguageSpecificRemoveSuggestedNode
(
SyntaxEditor
editor
,
SyntaxNode
node
);
protected
abstract
void
LanguageSpecificRemoveSuggestedNode
(
SyntaxEditor
editor
,
SyntaxNode
node
);
public
override
ImmutableArray
<
string
>
FixableDiagnosticIds
{
get
;
}
=
ImmutableArray
.
Create
(
IDEDiagnosticIds
.
UseInferredMemberNameDiagnosticId
);
...
...
src/Features/CSharp/Portable/Completion/CompletionProviders/PartialTypeCompletionProvider.cs
浏览文件 @
31eeea58
...
...
@@ -89,7 +89,7 @@ private static bool IsPartialTypeDeclaration(SyntaxNode syntax)
return
ImmutableDictionary
<
string
,
string
>.
Empty
.
Add
(
InsertionTextOnLessThan
,
symbol
.
Name
.
EscapeIdentifier
());
}
public
async
override
Task
<
TextChange
?>
GetTextChangeAsync
(
public
override
async
Task
<
TextChange
?>
GetTextChangeAsync
(
Document
document
,
CompletionItem
selectedItem
,
char
?
ch
,
CancellationToken
cancellationToken
)
{
if
(
ch
==
'<'
)
...
...
src/Features/CSharp/Portable/Completion/CompletionProviders/SymbolCompletionProvider.cs
浏览文件 @
31eeea58
...
...
@@ -39,7 +39,7 @@ protected override Task<ImmutableArray<ISymbol>> GetSymbolsAsync(SyntaxContext c
context
.
SemanticModel
,
position
,
context
.
Workspace
,
options
,
cancellationToken
);
}
protected
async
override
Task
<
bool
>
ShouldProvidePreselectedItemsAsync
(
CompletionContext
completionContext
,
SyntaxContext
syntaxContext
,
Document
document
,
int
position
,
Lazy
<
ImmutableArray
<
ITypeSymbol
>>
inferredTypes
,
OptionSet
options
)
protected
override
async
Task
<
bool
>
ShouldProvidePreselectedItemsAsync
(
CompletionContext
completionContext
,
SyntaxContext
syntaxContext
,
Document
document
,
int
position
,
Lazy
<
ImmutableArray
<
ITypeSymbol
>>
inferredTypes
,
OptionSet
options
)
{
var
sourceText
=
await
document
.
GetTextAsync
(
CancellationToken
.
None
).
ConfigureAwait
(
false
);
if
(
ShouldTriggerInArgumentLists
(
sourceText
,
options
))
...
...
@@ -68,7 +68,7 @@ internal override bool IsInsertionTrigger(SourceText text, int characterPosition
:
CompletionUtilities
.
IsTriggerCharacter
(
text
,
characterPosition
,
options
);
}
internal
async
override
Task
<
bool
>
IsSyntacticTriggerCharacterAsync
(
Document
document
,
int
caretPosition
,
CompletionTrigger
trigger
,
OptionSet
options
,
CancellationToken
cancellationToken
)
internal
override
async
Task
<
bool
>
IsSyntacticTriggerCharacterAsync
(
Document
document
,
int
caretPosition
,
CompletionTrigger
trigger
,
OptionSet
options
,
CancellationToken
cancellationToken
)
{
if
(
trigger
.
Kind
==
CompletionTriggerKind
.
Insertion
&&
caretPosition
>
0
)
{
...
...
src/Features/CSharp/Portable/EncapsulateField/CSharpEncapsulateFieldService.cs
浏览文件 @
31eeea58
...
...
@@ -31,7 +31,7 @@ public CSharpEncapsulateFieldService()
{
}
protected
async
override
Task
<
SyntaxNode
>
RewriteFieldNameAndAccessibilityAsync
(
string
originalFieldName
,
bool
makePrivate
,
Document
document
,
SyntaxAnnotation
declarationAnnotation
,
CancellationToken
cancellationToken
)
protected
override
async
Task
<
SyntaxNode
>
RewriteFieldNameAndAccessibilityAsync
(
string
originalFieldName
,
bool
makePrivate
,
Document
document
,
SyntaxAnnotation
declarationAnnotation
,
CancellationToken
cancellationToken
)
{
var
root
=
await
document
.
GetSyntaxRootAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
...
...
src/Features/CSharp/Portable/ExternalAccess/Pythia/PythiaSignatureHelpProvider.cs
浏览文件 @
31eeea58
...
...
@@ -32,7 +32,7 @@ internal sealed class PythiaSignatureHelpProvider : InvocationExpressionSignatur
public
PythiaSignatureHelpProvider
(
Lazy
<
IPythiaSignatureHelpProviderImplementation
>
implementation
)
=>
_lazyImplementation
=
implementation
;
internal
async
override
Task
<(
ImmutableArray
<
SignatureHelpItem
>
items
,
int
?
selectedItemIndex
)>
GetMethodGroupItemsAndSelectionAsync
(
internal
override
async
Task
<(
ImmutableArray
<
SignatureHelpItem
>
items
,
int
?
selectedItemIndex
)>
GetMethodGroupItemsAndSelectionAsync
(
ImmutableArray
<
IMethodSymbol
>
accessibleMethods
,
Document
document
,
InvocationExpressionSyntax
invocationExpression
,
...
...
src/Features/CSharp/Portable/Organizing/Organizers/ModifiersOrganizer.Comparer.cs
浏览文件 @
31eeea58
...
...
@@ -31,7 +31,7 @@ public int Compare(SyntaxToken x, SyntaxToken y)
return
ComparerWithState
.
CompareTo
(
x
,
y
,
s_comparers
);
}
private
readonly
static
ImmutableArray
<
Func
<
SyntaxToken
,
IComparable
>>
s_comparers
=
private
static
readonly
ImmutableArray
<
Func
<
SyntaxToken
,
IComparable
>>
s_comparers
=
ImmutableArray
.
Create
<
Func
<
SyntaxToken
,
IComparable
>>(
t
=>
t
.
Kind
()
==
SyntaxKind
.
PartialKeyword
,
t
=>
GetOrdering
(
t
));
private
static
Ordering
GetOrdering
(
SyntaxToken
token
)
...
...
src/Features/Core/Portable/AddImport/References/Reference.cs
浏览文件 @
31eeea58
...
...
@@ -54,7 +54,7 @@ public int CompareTo(Document document, Reference other)
placeSystemNamespaceFirst
:
true
);
}
private
readonly
static
ImmutableArray
<
Func
<
Reference
,
Document
,
IComparable
>>
s_comparers
private
static
readonly
ImmutableArray
<
Func
<
Reference
,
Document
,
IComparable
>>
s_comparers
=
ImmutableArray
.
Create
<
Func
<
Reference
,
Document
,
IComparable
>>(
// If references have different weights, order by the ones with lower weight (i.e.
// they are better matches).
...
...
src/Features/Core/Portable/AddPackage/AbstractAddPackageCodeFixProvider.cs
浏览文件 @
31eeea58
...
...
@@ -33,7 +33,7 @@ internal abstract partial class AbstractAddPackageCodeFixProvider : CodeFixProvi
protected
abstract
bool
IncludePrerelease
{
get
;
}
public
override
abstract
FixAllProvider
GetFixAllProvider
();
public
abstract
override
FixAllProvider
GetFixAllProvider
();
protected
async
Task
<
ImmutableArray
<
CodeAction
>>
GetAddPackagesCodeActionsAsync
(
CodeFixContext
context
,
ISet
<
string
>
assemblyNames
)
...
...
src/Features/Core/Portable/CodeFixes/Async/AbstractAsyncCodeFix.cs
浏览文件 @
31eeea58
...
...
@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.CodeFixes.Async
{
internal
abstract
partial
class
AbstractAsyncCodeFix
:
CodeFixProvider
{
public
override
abstract
FixAllProvider
GetFixAllProvider
();
public
abstract
override
FixAllProvider
GetFixAllProvider
();
protected
abstract
Task
<
CodeAction
>
GetCodeActionAsync
(
SyntaxNode
root
,
SyntaxNode
node
,
Document
document
,
Diagnostic
diagnostic
,
CancellationToken
cancellationToken
);
...
...
src/Features/Core/Portable/CodeFixes/FixAllOccurrences/FixSomeCodeAction.cs
浏览文件 @
31eeea58
...
...
@@ -44,7 +44,7 @@ protected override async Task<IEnumerable<CodeActionOperation>> ComputeOperation
_showPreviewChangesDialog
);
}
internal
async
override
Task
<
Solution
>
GetChangedSolutionAsync
(
internal
override
async
Task
<
Solution
>
GetChangedSolutionAsync
(
IProgressTracker
progressTracker
,
CancellationToken
cancellationToken
)
{
cancellationToken
.
ThrowIfCancellationRequested
();
...
...
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.FixAllProvider.cs
浏览文件 @
31eeea58
...
...
@@ -18,7 +18,7 @@ private SuppressionFixAllProvider()
{
}
public
async
override
Task
<
CodeAction
>
GetFixAsync
(
FixAllContext
fixAllContext
)
public
override
async
Task
<
CodeAction
>
GetFixAsync
(
FixAllContext
fixAllContext
)
{
// currently there's no FixAll support for local suppression, just bail out
if
(
NestedSuppressionCodeAction
.
IsEquivalenceKeyForLocalSuppression
(
fixAllContext
.
CodeActionEquivalenceKey
))
...
...
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.LocalSuppressMessageCodeAction.cs
浏览文件 @
31eeea58
...
...
@@ -35,7 +35,7 @@ internal sealed class LocalSuppressMessageCodeAction : AbstractSuppressionCodeAc
_diagnostic
=
diagnostic
;
}
protected
async
override
Task
<
Document
>
GetChangedDocumentAsync
(
CancellationToken
cancellationToken
)
protected
override
async
Task
<
Document
>
GetChangedDocumentAsync
(
CancellationToken
cancellationToken
)
{
var
newTargetNode
=
_fixer
.
AddLocalSuppressMessageAttribute
(
_targetNode
,
_targetSymbol
,
_suppressMessageAttribute
,
_diagnostic
);
...
...
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.PragmaHelpers.cs
浏览文件 @
31eeea58
...
...
@@ -19,7 +19,7 @@ internal partial class AbstractSuppressionCodeFixProvider
/// </summary>
private
static
class
PragmaHelpers
{
internal
async
stati
c
Task
<
Document
>
GetChangeDocumentWithPragmaAdjustedAsync
(
internal
static
asyn
c
Task
<
Document
>
GetChangeDocumentWithPragmaAdjustedAsync
(
Document
document
,
TextSpan
diagnosticSpan
,
SuppressionTargetInfo
suppressionTargetInfo
,
...
...
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.PragmaWarningCodeAction.cs
浏览文件 @
31eeea58
...
...
@@ -49,7 +49,7 @@ public PragmaWarningCodeAction CloneForFixMultipleContext()
protected
override
string
DiagnosticIdForEquivalenceKey
=>
_forFixMultipleContext
?
string
.
Empty
:
_diagnostic
.
Id
;
protected
async
override
Task
<
Document
>
GetChangedDocumentAsync
(
CancellationToken
cancellationToken
)
protected
override
async
Task
<
Document
>
GetChangedDocumentAsync
(
CancellationToken
cancellationToken
)
=>
await
GetChangedDocumentAsync
(
includeStartTokenChange
:
true
,
includeEndTokenChange
:
true
,
cancellationToken
:
cancellationToken
).
ConfigureAwait
(
false
);
public
async
Task
<
Document
>
GetChangedDocumentAsync
(
bool
includeStartTokenChange
,
bool
includeEndTokenChange
,
CancellationToken
cancellationToken
)
...
...
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs
浏览文件 @
31eeea58
...
...
@@ -81,7 +81,7 @@ public BatchFixer(AbstractSuppressionCodeFixProvider suppressionFixProvider)
}
}
protected
async
override
Task
AddProjectFixesAsync
(
protected
override
async
Task
AddProjectFixesAsync
(
Project
project
,
ImmutableArray
<
Diagnostic
>
diagnostics
,
ConcurrentBag
<(
Diagnostic
diagnostic
,
CodeAction
action
)>
bag
,
FixAllState
fixAllState
,
CancellationToken
cancellationToken
)
...
...
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs
浏览文件 @
31eeea58
...
...
@@ -54,7 +54,7 @@ public async Task<SyntaxNode> GetAttributeToRemoveAsync(CancellationToken cancel
attributeNode
;
}
protected
async
override
Task
<
Solution
>
GetChangedSolutionAsync
(
CancellationToken
cancellationToken
)
protected
override
async
Task
<
Solution
>
GetChangedSolutionAsync
(
CancellationToken
cancellationToken
)
{
var
attributeNode
=
await
GetAttributeToRemoveAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
documentWithAttribute
=
_project
.
GetDocument
(
attributeNode
.
SyntaxTree
);
...
...
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs
浏览文件 @
31eeea58
...
...
@@ -55,7 +55,7 @@ public override RemoveSuppressionCodeAction CloneForFixMultipleContext()
public
override
SyntaxTree
SyntaxTreeToModify
=>
_suppressionTargetInfo
.
StartToken
.
SyntaxTree
;
protected
async
override
Task
<
Document
>
GetChangedDocumentAsync
(
CancellationToken
cancellationToken
)
protected
override
async
Task
<
Document
>
GetChangedDocumentAsync
(
CancellationToken
cancellationToken
)
=>
await
GetChangedDocumentAsync
(
includeStartTokenChange
:
true
,
includeEndTokenChange
:
true
,
cancellationToken
:
cancellationToken
).
ConfigureAwait
(
false
);
public
async
Task
<
Document
>
GetChangedDocumentAsync
(
bool
includeStartTokenChange
,
bool
includeEndTokenChange
,
CancellationToken
cancellationToken
)
...
...
src/Features/Core/Portable/CodeFixes/Suppression/WrapperCodeFixProvider.cs
浏览文件 @
31eeea58
...
...
@@ -23,7 +23,7 @@ public WrapperCodeFixProvider(IConfigurationFixProvider suppressionFixProvider,
public
IConfigurationFixProvider
SuppressionFixProvider
=>
_suppressionFixProvider
;
public
override
ImmutableArray
<
string
>
FixableDiagnosticIds
=>
_originalDiagnosticIds
;
public
async
override
Task
RegisterCodeFixesAsync
(
CodeFixContext
context
)
public
override
async
Task
RegisterCodeFixesAsync
(
CodeFixContext
context
)
{
var
diagnostics
=
context
.
Diagnostics
.
Where
(
_suppressionFixProvider
.
IsFixableDiagnostic
);
...
...
src/Features/Core/Portable/Completion/CompletionServiceWithProviders.cs
浏览文件 @
31eeea58
...
...
@@ -169,7 +169,7 @@ protected ImmutableArray<CompletionProvider> GetProviders(ImmutableHashSet<strin
return
ImmutableArray
<
CompletionProvider
>.
Empty
;
}
internal
protected
CompletionProvider
GetProvider
(
CompletionItem
item
)
protected
internal
CompletionProvider
GetProvider
(
CompletionItem
item
)
{
CompletionProvider
provider
=
null
;
...
...
src/Features/Core/Portable/Completion/Providers/AbstractPartialTypeCompletionProvider.cs
浏览文件 @
31eeea58
...
...
@@ -22,7 +22,7 @@ protected AbstractPartialTypeCompletionProvider()
{
}
public
async
sealed
override
Task
ProvideCompletionsAsync
(
CompletionContext
completionContext
)
public
sealed
override
async
Task
ProvideCompletionsAsync
(
CompletionContext
completionContext
)
{
try
{
...
...
src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractExtensionMethodImportCompletionProvider.cs
浏览文件 @
31eeea58
...
...
@@ -27,7 +27,7 @@ protected override bool ShouldProvideCompletion(Document document, SyntaxContext
protected
override
void
LogCommit
()
=>
CompletionProvidersLogger
.
LogCommitOfExtensionMethodImportCompletionItem
();
protected
async
override
Task
AddCompletionItemsAsync
(
protected
override
async
Task
AddCompletionItemsAsync
(
CompletionContext
completionContext
,
SyntaxContext
syntaxContext
,
HashSet
<
string
>
namespaceInScope
,
...
...
src/Features/Core/Portable/Completion/Providers/SymbolMatchPriority.cs
浏览文件 @
31eeea58
...
...
@@ -9,11 +9,11 @@ namespace Microsoft.CodeAnalysis.Completion.Providers
{
internal
static
class
SymbolMatchPriority
{
internal
readonly
static
int
Keyword
=
100
;
internal
readonly
static
int
PreferType
=
200
;
internal
readonly
static
int
PreferNamedArgument
=
300
;
internal
readonly
static
int
PreferEventOrMethod
=
400
;
internal
readonly
static
int
PreferFieldOrProperty
=
500
;
internal
readonly
static
int
PreferLocalOrParameterOrRangeVariable
=
600
;
internal
static
readonly
int
Keyword
=
100
;
internal
static
readonly
int
PreferType
=
200
;
internal
static
readonly
int
PreferNamedArgument
=
300
;
internal
static
readonly
int
PreferEventOrMethod
=
400
;
internal
static
readonly
int
PreferFieldOrProperty
=
500
;
internal
static
readonly
int
PreferLocalOrParameterOrRangeVariable
=
600
;
}
}
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.InMemoryStorage.cs
浏览文件 @
31eeea58
...
...
@@ -15,7 +15,7 @@ internal partial class DiagnosticIncrementalAnalyzer
private
static
class
InMemoryStorage
{
// the reason using nested map rather than having tuple as key is so that I dont have a gigantic map
private
readonly
static
ConcurrentDictionary
<
DiagnosticAnalyzer
,
ConcurrentDictionary
<(
object
key
,
string
stateKey
),
CacheEntry
>>
s_map
=
private
static
readonly
ConcurrentDictionary
<
DiagnosticAnalyzer
,
ConcurrentDictionary
<(
object
key
,
string
stateKey
),
CacheEntry
>>
s_map
=
new
ConcurrentDictionary
<
DiagnosticAnalyzer
,
ConcurrentDictionary
<(
object
key
,
string
stateKey
),
CacheEntry
>>(
concurrencyLevel
:
2
,
capacity
:
10
);
public
static
bool
TryGetValue
(
DiagnosticAnalyzer
analyzer
,
(
object
key
,
string
stateKey
)
key
,
out
CacheEntry
entry
)
...
...
src/Features/Core/Portable/DocumentationComments/CodeFixes/AbstractAddDocCommentNodesCodeFixProvider.cs
浏览文件 @
31eeea58
...
...
@@ -24,7 +24,7 @@ internal abstract class AbstractAddDocCommentNodesCodeFixProvider
{
public
override
FixAllProvider
GetFixAllProvider
()
=>
WellKnownFixAllProviders
.
BatchFixer
;
public
async
sealed
override
Task
RegisterCodeFixesAsync
(
CodeFixContext
context
)
public
sealed
override
async
Task
RegisterCodeFixesAsync
(
CodeFixContext
context
)
{
var
root
=
await
context
.
Document
.
GetSyntaxRootAsync
(
context
.
CancellationToken
).
ConfigureAwait
(
false
);
var
parentMethod
=
root
.
FindNode
(
context
.
Span
).
FirstAncestorOrSelf
<
TMemberDeclarationSyntax
>();
...
...
src/Features/Core/Portable/DocumentationComments/CodeFixes/AbstractRemoveDocCommentNodeCodeFixProvider.cs
浏览文件 @
31eeea58
...
...
@@ -30,7 +30,7 @@ internal abstract class AbstractRemoveDocCommentNodeCodeFixProvider<TXmlElementS
protected
abstract
bool
IsXmlNewLineToken
(
SyntaxToken
token
);
protected
abstract
bool
IsXmlWhitespaceToken
(
SyntaxToken
token
);
public
async
sealed
override
Task
RegisterCodeFixesAsync
(
CodeFixContext
context
)
public
sealed
override
async
Task
RegisterCodeFixesAsync
(
CodeFixContext
context
)
{
var
root
=
await
context
.
Document
.
GetSyntaxRootAsync
(
context
.
CancellationToken
).
ConfigureAwait
(
false
);
...
...
src/Features/Core/Portable/EditAndContinue/EditAndContinueMethodDebugInfoReader.cs
浏览文件 @
31eeea58
...
...
@@ -181,7 +181,7 @@ public override bool TryGetDocumentChecksum(string documentPath, out ImmutableAr
/// <remarks>
/// Automatically detects the underlying PDB format and returns the appropriate reader.
/// </remarks>
public
unsafe
static
EditAndContinueMethodDebugInfoReader
Create
(
ISymUnmanagedReader5
symReader
,
int
version
=
1
)
public
static
unsafe
EditAndContinueMethodDebugInfoReader
Create
(
ISymUnmanagedReader5
symReader
,
int
version
=
1
)
{
if
(
symReader
==
null
)
{
...
...
@@ -214,7 +214,7 @@ public unsafe static EditAndContinueMethodDebugInfoReader Create(ISymUnmanagedRe
/// <returns>
/// The resulting reader does not take ownership of the <paramref name="pdbReader"/> or the memory it reads.
/// </returns>
public
unsafe
static
EditAndContinueMethodDebugInfoReader
Create
(
MetadataReader
pdbReader
)
public
static
unsafe
EditAndContinueMethodDebugInfoReader
Create
(
MetadataReader
pdbReader
)
=>
new
Portable
(
pdbReader
??
throw
new
ArgumentNullException
(
nameof
(
pdbReader
)));
internal
static
bool
TryGetDocumentChecksum
(
ISymUnmanagedReader5
symReader
,
string
documentPath
,
out
ImmutableArray
<
byte
>
checksum
,
out
Guid
algorithmId
)
...
...
src/Features/Core/Portable/GenerateMember/GenerateVariable/AbstractGenerateVariableService.GenerateLocalCodeAction.cs
浏览文件 @
31eeea58
...
...
@@ -41,7 +41,7 @@ public override string Title
}
}
protected
async
override
Task
<
Document
>
GetChangedDocumentAsync
(
CancellationToken
cancellationToken
)
protected
override
async
Task
<
Document
>
GetChangedDocumentAsync
(
CancellationToken
cancellationToken
)
{
var
newRoot
=
await
GetNewRootAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
newDocument
=
_document
.
WithSyntaxRoot
(
newRoot
);
...
...
src/Features/Core/Portable/IntroduceVariable/AbstractIntroduceVariableService.State.cs
浏览文件 @
31eeea58
...
...
@@ -41,7 +41,7 @@ public State(TService service, SemanticDocument document)
Document
=
document
;
}
public
async
stati
c
Task
<
State
>
GenerateAsync
(
public
static
asyn
c
Task
<
State
>
GenerateAsync
(
TService
service
,
SemanticDocument
document
,
TextSpan
textSpan
,
...
...
src/Features/Core/Portable/MetadataAsSource/AbstractMetadataAsSourceService+CompatAbstractMetadataFormattingRule.cs
浏览文件 @
31eeea58
...
...
@@ -17,7 +17,7 @@ protected abstract class CompatAbstractMetadataFormattingRule : AbstractMetadata
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
void
AddSuppressOperations
(
List
<
SuppressOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextSuppressOperationAction
nextOperation
)
public
sealed
override
void
AddSuppressOperations
(
List
<
SuppressOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextSuppressOperationAction
nextOperation
)
{
var
nextOperationCopy
=
nextOperation
;
AddSuppressOperationsSlow
(
list
,
node
,
options
,
ref
nextOperationCopy
);
...
...
@@ -25,7 +25,7 @@ public override sealed void AddSuppressOperations(List<SuppressOperation> list,
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAnchorIndentationOperationAction
nextOperation
)
public
sealed
override
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAnchorIndentationOperationAction
nextOperation
)
{
var
nextOperationCopy
=
nextOperation
;
AddAnchorIndentationOperationsSlow
(
list
,
node
,
options
,
ref
nextOperationCopy
);
...
...
@@ -33,7 +33,7 @@ public override sealed void AddAnchorIndentationOperations(List<AnchorIndentatio
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
void
AddIndentBlockOperations
(
List
<
IndentBlockOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextIndentBlockOperationAction
nextOperation
)
public
sealed
override
void
AddIndentBlockOperations
(
List
<
IndentBlockOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextIndentBlockOperationAction
nextOperation
)
{
var
nextOperationCopy
=
nextOperation
;
AddIndentBlockOperationsSlow
(
list
,
node
,
options
,
ref
nextOperationCopy
);
...
...
@@ -41,7 +41,7 @@ public override sealed void AddIndentBlockOperations(List<IndentBlockOperation>
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
void
AddAlignTokensOperations
(
List
<
AlignTokensOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAlignTokensOperationAction
nextOperation
)
public
sealed
override
void
AddAlignTokensOperations
(
List
<
AlignTokensOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAlignTokensOperationAction
nextOperation
)
{
var
nextOperationCopy
=
nextOperation
;
AddAlignTokensOperationsSlow
(
list
,
node
,
options
,
ref
nextOperationCopy
);
...
...
@@ -49,7 +49,7 @@ public override sealed void AddAlignTokensOperations(List<AlignTokensOperation>
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
AdjustNewLinesOperation
GetAdjustNewLinesOperation
(
SyntaxToken
previousToken
,
SyntaxToken
currentToken
,
AnalyzerConfigOptions
options
,
in
NextGetAdjustNewLinesOperation
nextOperation
)
public
sealed
override
AdjustNewLinesOperation
GetAdjustNewLinesOperation
(
SyntaxToken
previousToken
,
SyntaxToken
currentToken
,
AnalyzerConfigOptions
options
,
in
NextGetAdjustNewLinesOperation
nextOperation
)
{
var
nextOperationCopy
=
nextOperation
;
return
GetAdjustNewLinesOperationSlow
(
previousToken
,
currentToken
,
options
,
ref
nextOperationCopy
);
...
...
@@ -57,7 +57,7 @@ public override sealed AdjustNewLinesOperation GetAdjustNewLinesOperation(Syntax
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
AdjustSpacesOperation
GetAdjustSpacesOperation
(
SyntaxToken
previousToken
,
SyntaxToken
currentToken
,
AnalyzerConfigOptions
options
,
in
NextGetAdjustSpacesOperation
nextOperation
)
public
sealed
override
AdjustSpacesOperation
GetAdjustSpacesOperation
(
SyntaxToken
previousToken
,
SyntaxToken
currentToken
,
AnalyzerConfigOptions
options
,
in
NextGetAdjustSpacesOperation
nextOperation
)
{
var
nextOperationCopy
=
nextOperation
;
return
GetAdjustSpacesOperationSlow
(
previousToken
,
currentToken
,
options
,
ref
nextOperationCopy
);
...
...
src/Features/Core/Portable/PullMemberUp/Dialog/PullMemberUpWithDialogCodeAction.cs
浏览文件 @
31eeea58
...
...
@@ -43,7 +43,7 @@ public override object GetOptions(CancellationToken cancellationToken)
return
pullMemberUpOptionService
.
GetPullMemberUpOptions
(
_document
,
_selectedMember
);
}
protected
async
override
Task
<
IEnumerable
<
CodeActionOperation
>>
ComputeOperationsAsync
(
object
options
,
CancellationToken
cancellationToken
)
protected
override
async
Task
<
IEnumerable
<
CodeActionOperation
>>
ComputeOperationsAsync
(
object
options
,
CancellationToken
cancellationToken
)
{
if
(
options
is
PullMembersUpOptions
pullMemberUpOptions
)
{
...
...
src/Workspaces/CSharp/Portable/Workspace/LanguageServices/CSharpSyntaxTreeFactory.PathSyntaxReference.cs
浏览文件 @
31eeea58
...
...
@@ -146,7 +146,7 @@ private SyntaxTrivia GetTrivia(SyntaxToken token, int triviaIndex)
public
override
SyntaxNode
GetSyntax
(
CancellationToken
cancellationToken
)
=>
this
.
GetNode
(
_tree
.
GetRoot
(
cancellationToken
));
public
async
override
Task
<
SyntaxNode
>
GetSyntaxAsync
(
CancellationToken
cancellationToken
=
default
)
public
override
async
Task
<
SyntaxNode
>
GetSyntaxAsync
(
CancellationToken
cancellationToken
=
default
)
{
var
root
=
await
_tree
.
GetRootAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
return
this
.
GetNode
(
root
);
...
...
src/Workspaces/CSharp/Portable/Workspace/LanguageServices/CSharpSyntaxTreeFactoryService.PositionalSyntaxReference.cs
浏览文件 @
31eeea58
...
...
@@ -57,7 +57,7 @@ public override SyntaxNode GetSyntax(CancellationToken cancellationToken)
return
this
.
GetNode
(
_tree
.
GetRoot
(
cancellationToken
));
}
public
async
override
Task
<
SyntaxNode
>
GetSyntaxAsync
(
CancellationToken
cancellationToken
=
default
)
public
override
async
Task
<
SyntaxNode
>
GetSyntaxAsync
(
CancellationToken
cancellationToken
=
default
)
{
var
root
=
await
_tree
.
GetRootAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
return
this
.
GetNode
(
root
);
...
...
src/Workspaces/Core/Portable/CodeActions/CodeAction.cs
浏览文件 @
31eeea58
...
...
@@ -142,7 +142,7 @@ protected virtual Task<IEnumerable<CodeActionOperation>> ComputePreviewOperation
/// Computes all changes for an entire solution.
/// Override this method if you want to implement a <see cref="CodeAction"/> subclass that changes more than one document.
/// </summary>
protected
async
virtual
Task
<
Solution
?>
GetChangedSolutionAsync
(
CancellationToken
cancellationToken
)
protected
virtual
async
Task
<
Solution
?>
GetChangedSolutionAsync
(
CancellationToken
cancellationToken
)
{
var
changedDocument
=
await
GetChangedDocumentAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
if
(
changedDocument
==
null
)
...
...
src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/BatchFixAllProvider.cs
浏览文件 @
31eeea58
...
...
@@ -104,7 +104,7 @@ public override async Task<CodeAction> GetFixAsync(FixAllContext fixAllContext)
return
fixesBag
.
ToImmutableArray
();
}
protected
async
virtual
Task
AddDocumentFixesAsync
(
protected
virtual
async
Task
AddDocumentFixesAsync
(
Document
document
,
ImmutableArray
<
Diagnostic
>
diagnostics
,
ConcurrentBag
<(
Diagnostic
diagnostic
,
CodeAction
action
)>
fixes
,
FixAllState
fixAllState
,
CancellationToken
cancellationToken
)
...
...
src/Workspaces/Core/Portable/Execution/AssetStorages.Storage.cs
浏览文件 @
31eeea58
...
...
@@ -26,7 +26,7 @@ internal partial class AssetStorages
public
sealed
class
Storage
{
// cache to remove lambda allocation
private
readonly
static
Func
<
ConcurrentDictionary
<
Checksum
,
CustomAsset
>>
s_additionalAssetsCreator
=
()
=>
new
ConcurrentDictionary
<
Checksum
,
CustomAsset
>(
concurrencyLevel
:
2
,
capacity
:
10
);
private
static
readonly
Func
<
ConcurrentDictionary
<
Checksum
,
CustomAsset
>>
s_additionalAssetsCreator
=
()
=>
new
ConcurrentDictionary
<
Checksum
,
CustomAsset
>(
concurrencyLevel
:
2
,
capacity
:
10
);
private
readonly
ISerializerService
_serializer
;
...
...
src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingWorkspaceExtensions.cs
浏览文件 @
31eeea58
...
...
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api
{
internal
static
class
UnitTestingWorkspaceExtensions
{
public
async
stati
c
Task
<
UnitTestingRemoteHostClientWrapper
>
TryGetUnitTestingRemoteHostClientWrapperAsync
(
this
Workspace
workspace
,
CancellationToken
cancellationToken
)
public
static
asyn
c
Task
<
UnitTestingRemoteHostClientWrapper
>
TryGetUnitTestingRemoteHostClientWrapperAsync
(
this
Workspace
workspace
,
CancellationToken
cancellationToken
)
{
var
client
=
await
RemoteHostClient
.
TryGetClientAsync
(
workspace
,
cancellationToken
).
ConfigureAwait
(
false
);
return
new
UnitTestingRemoteHostClientWrapper
(
client
);
...
...
src/Workspaces/Core/Portable/LanguageServices/DeclaredSymbolFactoryService/AbstractDeclaredSymbolInfoFactoryService.cs
浏览文件 @
31eeea58
...
...
@@ -18,7 +18,7 @@ internal abstract class AbstractDeclaredSymbolInfoFactoryService : IDeclaredSymb
private
const
string
GenericTypeNameManglingString
=
"`"
;
private
static
readonly
string
[]
s_aritySuffixesOneToNine
=
{
"`1"
,
"`2"
,
"`3"
,
"`4"
,
"`5"
,
"`6"
,
"`7"
,
"`8"
,
"`9"
};
private
readonly
static
ObjectPool
<
List
<
Dictionary
<
string
,
string
>>>
s_aliasMapListPool
private
static
readonly
ObjectPool
<
List
<
Dictionary
<
string
,
string
>>>
s_aliasMapListPool
=
SharedPools
.
Default
<
List
<
Dictionary
<
string
,
string
>>>();
// Note: these names are stored case insensitively. That way the alias mapping works
...
...
@@ -26,7 +26,7 @@ internal abstract class AbstractDeclaredSymbolInfoFactoryService : IDeclaredSymb
// for C#. However, that's ok. It will be rare in practice, and all it means is that
// we'll end up examining slightly more types (likely 0) when doing operations like
// Find all references.
private
readonly
static
ObjectPool
<
Dictionary
<
string
,
string
>>
s_aliasMapPool
private
static
readonly
ObjectPool
<
Dictionary
<
string
,
string
>>
s_aliasMapPool
=
SharedPools
.
StringIgnoreCaseDictionary
<
string
>();
protected
static
List
<
Dictionary
<
string
,
string
>>
AllocateAliasMapList
()
...
...
src/Workspaces/Core/Portable/PatternMatching/PatternMatch.cs
浏览文件 @
31eeea58
...
...
@@ -61,7 +61,7 @@ public int CompareTo(PatternMatch other)
public
int
CompareTo
(
PatternMatch
other
,
bool
ignoreCase
)
=>
ComparerWithState
.
CompareTo
(
this
,
other
,
ignoreCase
,
s_comparers
);
private
readonly
static
ImmutableArray
<
Func
<
PatternMatch
,
bool
,
IComparable
>>
s_comparers
=
private
static
readonly
ImmutableArray
<
Func
<
PatternMatch
,
bool
,
IComparable
>>
s_comparers
=
ImmutableArray
.
Create
<
Func
<
PatternMatch
,
bool
,
IComparable
>>(
// Compare types
(
p
,
b
)
=>
p
.
Kind
,
...
...
src/Workspaces/Core/Portable/SymbolSearch/ISymbolSearchService.cs
浏览文件 @
31eeea58
...
...
@@ -116,7 +116,7 @@ public int CompareTo(PackageWithAssemblyResult? other)
return
ComparerWithState
.
CompareTo
(
this
,
other
,
s_comparers
);
}
private
readonly
static
ImmutableArray
<
Func
<
PackageWithAssemblyResult
,
IComparable
>>
s_comparers
=
private
static
readonly
ImmutableArray
<
Func
<
PackageWithAssemblyResult
,
IComparable
>>
s_comparers
=
ImmutableArray
.
Create
<
Func
<
PackageWithAssemblyResult
,
IComparable
>>(
p
=>
p
.
Rank
,
p
=>
p
.
PackageName
);
}
...
...
src/Workspaces/Core/Portable/TemporaryStorage/TemporaryStorageServiceFactory.MemoryMappedInfo.cs
浏览文件 @
31eeea58
...
...
@@ -178,7 +178,7 @@ public void Dispose()
_memoryMappedFile
.
Dispose
();
}
private
unsafe
sealed
class
SharedReadableStream
:
Stream
,
ISupportDirectMemoryAccess
private
sealed
unsafe
class
SharedReadableStream
:
Stream
,
ISupportDirectMemoryAccess
{
private
readonly
ReferenceCountedDisposable
<
MemoryMappedViewAccessor
>
_accessor
;
...
...
src/Workspaces/Core/Portable/Workspace/Host/Status/WorkspaceStatusService.cs
浏览文件 @
31eeea58
...
...
@@ -15,7 +15,7 @@ namespace Microsoft.CodeAnalysis.Host
[
ExportWorkspaceService
(
typeof
(
IWorkspaceStatusService
),
ServiceLayer
.
Default
),
Shared
]
internal
sealed
class
WorkspaceStatusService
:
IWorkspaceStatusService
{
public
readonly
static
WorkspaceStatusService
Default
=
new
WorkspaceStatusService
();
public
static
readonly
WorkspaceStatusService
Default
=
new
WorkspaceStatusService
();
[
ImportingConstructor
]
[
SuppressMessage
(
"RoslynDiagnosticsReliability"
,
"RS0033:Importing constructor should be [Obsolete]"
,
Justification
=
"Incorrectly used in production code: https://github.com/dotnet/roslyn/issues/42839"
)]
...
...
src/Workspaces/Core/Portable/Workspace/WorkspaceDiagnosticDescriptors.cs
浏览文件 @
31eeea58
...
...
@@ -6,7 +6,7 @@ namespace Microsoft.CodeAnalysis
{
internal
sealed
class
WorkspaceDiagnosticDescriptors
{
internal
readonly
static
DiagnosticDescriptor
ErrorReadingFileContent
;
internal
static
readonly
DiagnosticDescriptor
ErrorReadingFileContent
;
internal
const
string
ErrorReadingFileContentId
=
"IDE1100"
;
...
...
src/Workspaces/MSBuildTest/TestFiles/Resources.cs
浏览文件 @
31eeea58
...
...
@@ -42,8 +42,8 @@ private static string LoadText(string name)
}
}
private
readonly
static
Func
<
string
,
byte
[
]>
s_bytesLoader
=
LoadBytes
;
private
readonly
static
Func
<
string
,
string
>
s_textLoader
=
LoadText
;
private
static
readonly
Func
<
string
,
byte
[
]>
s_bytesLoader
=
LoadBytes
;
private
static
readonly
Func
<
string
,
string
>
s_textLoader
=
LoadText
;
private
static
Dictionary
<
string
,
byte
[
]>
s_bytesCache
;
private
static
Dictionary
<
string
,
string
>
s_textCache
;
...
...
src/Workspaces/Remote/Core/Services/SolutionService.cs
浏览文件 @
31eeea58
...
...
@@ -30,8 +30,8 @@ internal sealed class SolutionService
private
static
readonly
SemaphoreSlim
s_gate
=
new
SemaphoreSlim
(
initialCount
:
1
);
// this simple cache hold onto the last and primary solution created
private
volatile
static
Tuple
<
Checksum
,
Solution
>?
s_primarySolution
;
private
volatile
static
Tuple
<
Checksum
,
Solution
>?
s_lastSolution
;
private
static
volatile
Tuple
<
Checksum
,
Solution
>?
s_primarySolution
;
private
static
volatile
Tuple
<
Checksum
,
Solution
>?
s_lastSolution
;
public
AssetProvider
AssetProvider
{
get
;
}
...
...
src/Workspaces/Remote/ServiceHub/Services/RemoteHostService.cs
浏览文件 @
31eeea58
...
...
@@ -37,7 +37,7 @@ namespace Microsoft.CodeAnalysis.Remote
/// </summary>
internal
partial
class
RemoteHostService
:
ServiceBase
,
IRemoteHostService
{
private
readonly
static
TimeSpan
s_reportInterval
=
TimeSpan
.
FromMinutes
(
2
);
private
static
readonly
TimeSpan
s_reportInterval
=
TimeSpan
.
FromMinutes
(
2
);
private
readonly
CancellationTokenSource
_shutdownCancellationSource
;
// it is saved here more on debugging purpose.
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/Rules/CompatAbstractFormattingRule.cs
浏览文件 @
31eeea58
...
...
@@ -16,7 +16,7 @@ internal abstract class CompatAbstractFormattingRule : AbstractFormattingRule
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
void
AddSuppressOperations
(
List
<
SuppressOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextSuppressOperationAction
nextOperation
)
public
sealed
override
void
AddSuppressOperations
(
List
<
SuppressOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextSuppressOperationAction
nextOperation
)
{
var
nextOperationCopy
=
nextOperation
;
AddSuppressOperationsSlow
(
list
,
node
,
options
,
ref
nextOperationCopy
);
...
...
@@ -24,7 +24,7 @@ public override sealed void AddSuppressOperations(List<SuppressOperation> list,
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAnchorIndentationOperationAction
nextOperation
)
public
sealed
override
void
AddAnchorIndentationOperations
(
List
<
AnchorIndentationOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAnchorIndentationOperationAction
nextOperation
)
{
var
nextOperationCopy
=
nextOperation
;
AddAnchorIndentationOperationsSlow
(
list
,
node
,
options
,
ref
nextOperationCopy
);
...
...
@@ -32,7 +32,7 @@ public override sealed void AddAnchorIndentationOperations(List<AnchorIndentatio
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
void
AddIndentBlockOperations
(
List
<
IndentBlockOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextIndentBlockOperationAction
nextOperation
)
public
sealed
override
void
AddIndentBlockOperations
(
List
<
IndentBlockOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextIndentBlockOperationAction
nextOperation
)
{
var
nextOperationCopy
=
nextOperation
;
AddIndentBlockOperationsSlow
(
list
,
node
,
options
,
ref
nextOperationCopy
);
...
...
@@ -40,7 +40,7 @@ public override sealed void AddIndentBlockOperations(List<IndentBlockOperation>
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
void
AddAlignTokensOperations
(
List
<
AlignTokensOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAlignTokensOperationAction
nextOperation
)
public
sealed
override
void
AddAlignTokensOperations
(
List
<
AlignTokensOperation
>
list
,
SyntaxNode
node
,
AnalyzerConfigOptions
options
,
in
NextAlignTokensOperationAction
nextOperation
)
{
var
nextOperationCopy
=
nextOperation
;
AddAlignTokensOperationsSlow
(
list
,
node
,
options
,
ref
nextOperationCopy
);
...
...
@@ -48,7 +48,7 @@ public override sealed void AddAlignTokensOperations(List<AlignTokensOperation>
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
AdjustNewLinesOperation
?
GetAdjustNewLinesOperation
(
SyntaxToken
previousToken
,
SyntaxToken
currentToken
,
AnalyzerConfigOptions
options
,
in
NextGetAdjustNewLinesOperation
nextOperation
)
public
sealed
override
AdjustNewLinesOperation
?
GetAdjustNewLinesOperation
(
SyntaxToken
previousToken
,
SyntaxToken
currentToken
,
AnalyzerConfigOptions
options
,
in
NextGetAdjustNewLinesOperation
nextOperation
)
{
var
nextOperationCopy
=
nextOperation
;
return
GetAdjustNewLinesOperationSlow
(
previousToken
,
currentToken
,
options
,
ref
nextOperationCopy
);
...
...
@@ -56,7 +56,7 @@ public override sealed void AddAlignTokensOperations(List<AlignTokensOperation>
[
Obsolete
(
"Do not call this method directly (it will Stack Overflow)."
,
error
:
true
)]
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
public
override
sealed
AdjustSpacesOperation
?
GetAdjustSpacesOperation
(
SyntaxToken
previousToken
,
SyntaxToken
currentToken
,
AnalyzerConfigOptions
options
,
in
NextGetAdjustSpacesOperation
nextOperation
)
public
sealed
override
AdjustSpacesOperation
?
GetAdjustSpacesOperation
(
SyntaxToken
previousToken
,
SyntaxToken
currentToken
,
AnalyzerConfigOptions
options
,
in
NextGetAdjustSpacesOperation
nextOperation
)
{
var
nextOperationCopy
=
nextOperation
;
return
GetAdjustSpacesOperationSlow
(
previousToken
,
currentToken
,
options
,
ref
nextOperationCopy
);
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/AbstractSyntaxFacts.cs
浏览文件 @
31eeea58
...
...
@@ -24,7 +24,7 @@ namespace Microsoft.CodeAnalysis.LanguageServices
{
internal
abstract
class
AbstractSyntaxFacts
{
private
readonly
static
ObjectPool
<
Stack
<(
SyntaxNodeOrToken
nodeOrToken
,
bool
leading
,
bool
trailing
)>>
s_stackPool
private
static
readonly
ObjectPool
<
Stack
<(
SyntaxNodeOrToken
nodeOrToken
,
bool
leading
,
bool
trailing
)>>
s_stackPool
=
SharedPools
.
Default
<
Stack
<(
SyntaxNodeOrToken
nodeOrToken
,
bool
leading
,
bool
trailing
)>>();
public
abstract
ISyntaxKinds
SyntaxKinds
{
get
;
}
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/ComparerWithState.cs
浏览文件 @
31eeea58
...
...
@@ -9,7 +9,7 @@
namespace
Roslyn.Utilities
{
static
internal
class
ComparerWithState
internal
static
class
ComparerWithState
{
public
static
int
CompareTo
<
T
,
S
>(
T
first
,
T
second
,
S
state
,
ImmutableArray
<
Func
<
T
,
S
,
IComparable
>>
comparableMethods
)
{
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/SerializableBytes.cs
浏览文件 @
31eeea58
...
...
@@ -30,7 +30,7 @@ internal static PooledStream CreateReadableStream(byte[] bytes, int length)
return
stream
;
}
internal
async
stati
c
Task
<
PooledStream
>
CreateReadableStreamAsync
(
Stream
stream
,
CancellationToken
cancellationToken
)
internal
static
asyn
c
Task
<
PooledStream
>
CreateReadableStreamAsync
(
Stream
stream
,
CancellationToken
cancellationToken
)
{
var
length
=
stream
.
Length
;
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/EmbeddedLanguages/VirtualChars/CSharpVirtualCharLanguageServiceFactory.cs
浏览文件 @
31eeea58
...
...
@@ -24,7 +24,7 @@ public ILanguageService CreateLanguageService(HostLanguageServices languageServi
private
sealed
class
CSharpVirtualCharLanguageService
:
CSharpVirtualCharService
,
IVirtualCharLanguageService
{
internal
static
readonly
new
CSharpVirtualCharLanguageService
Instance
=
new
CSharpVirtualCharLanguageService
();
internal
static
new
readonly
CSharpVirtualCharLanguageService
Instance
=
new
CSharpVirtualCharLanguageService
();
private
CSharpVirtualCharLanguageService
()
{
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Extensions/ContextQuery/CSharpSyntaxContext.cs
浏览文件 @
31eeea58
...
...
@@ -273,7 +273,7 @@ public static CSharpSyntaxContext CreateContext_Test(SemanticModel semanticModel
return
CreateContextWorker
(
workspace
:
null
,
semanticModel
:
semanticModel
,
position
:
position
,
cancellationToken
:
cancellationToken
);
}
private
new
static
bool
IsWithinAsyncMethod
()
private
static
new
bool
IsWithinAsyncMethod
()
{
// TODO: Implement this if any C# completion code needs to know if it is in an async
// method or not.
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpSyntaxFactsService.cs
浏览文件 @
31eeea58
...
...
@@ -21,7 +21,7 @@ internal sealed partial class CSharpSyntaxFactsServiceFactory
{
private
sealed
class
CSharpSyntaxFactsService
:
CSharpSyntaxFacts
,
ISyntaxFactsService
{
internal
static
readonly
new
CSharpSyntaxFactsService
Instance
=
new
CSharpSyntaxFactsService
();
internal
static
new
readonly
CSharpSyntaxFactsService
Instance
=
new
CSharpSyntaxFactsService
();
public
bool
IsInInactiveRegion
(
SyntaxTree
syntaxTree
,
int
position
,
CancellationToken
cancellationToken
)
{
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpSyntaxKindsServiceFactory.cs
浏览文件 @
31eeea58
...
...
@@ -24,7 +24,7 @@ public ILanguageService CreateLanguageService(HostLanguageServices languageServi
private
sealed
class
CSharpSyntaxKindsService
:
CSharpSyntaxKinds
,
ISyntaxKindsService
{
public
static
readonly
new
CSharpSyntaxKindsService
Instance
=
new
CSharpSyntaxKindsService
();
public
static
new
readonly
CSharpSyntaxKindsService
Instance
=
new
CSharpSyntaxKindsService
();
}
}
}
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/DocumentExtensions.cs
浏览文件 @
31eeea58
...
...
@@ -178,7 +178,7 @@ public static bool IsGeneratedCode(this Document document, CancellationToken can
}
#endif
public
async
stati
c
Task
<
bool
>
IsGeneratedCodeAsync
(
this
Document
document
,
CancellationToken
cancellationToken
)
public
static
asyn
c
Task
<
bool
>
IsGeneratedCodeAsync
(
this
Document
document
,
CancellationToken
cancellationToken
)
{
var
generatedCodeRecognitionService
=
document
.
GetLanguageService
<
IGeneratedCodeRecognitionService
>();
return
generatedCodeRecognitionService
!=
null
&&
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录