Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
7a105a46
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,发现更多精彩内容 >>
提交
7a105a46
编写于
11月 04, 2016
作者:
C
CyrusNajmabadi
提交者:
GitHub
11月 04, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14980 from CyrusNajmabadi/dogfooding
Fix function naming.
上级
c0c999c3
25a6675a
变更
56
隐藏空白更改
内联
并排
Showing
56 changed file
with
119 addition
and
467 deletion
+119
-467
src/EditorFeatures/Core/CommandArgs.cs
src/EditorFeatures/Core/CommandArgs.cs
+3
-13
src/EditorFeatures/Core/ExportContentTypeLanguageServiceAttribute.cs
...eatures/Core/ExportContentTypeLanguageServiceAttribute.cs
+1
-6
src/EditorFeatures/Core/Extensibility/BraceMatching/ExportBraceMatcherAttribute.cs
...xtensibility/BraceMatching/ExportBraceMatcherAttribute.cs
+1
-6
src/EditorFeatures/Core/Extensibility/Completion/ExportCompletionProviderAttribute.cs
...nsibility/Completion/ExportCompletionProviderAttribute.cs
+2
-12
src/EditorFeatures/Core/Extensibility/Highlighting/ExportHighlighterAttribute.cs
.../Extensibility/Highlighting/ExportHighlighterAttribute.cs
+2
-7
src/EditorFeatures/Core/Extensibility/QuickInfo/ExportQuickInfoProviderAttribute.cs
...tensibility/QuickInfo/ExportQuickInfoProviderAttribute.cs
+2
-12
src/EditorFeatures/Core/Implementation/AutomaticCompletion/Extensions.cs
...res/Core/Implementation/AutomaticCompletion/Extensions.cs
+4
-4
src/EditorFeatures/Core/Implementation/InlineRename/Dashboard/Dashboard.xaml.cs
...e/Implementation/InlineRename/Dashboard/Dashboard.xaml.cs
+1
-6
src/EditorFeatures/Core/Implementation/LineSeparators/LineSeparatorTag.cs
...es/Core/Implementation/LineSeparators/LineSeparatorTag.cs
+7
-6
src/EditorFeatures/Core/Implementation/NavigateTo/NavigateToItemProviderFactory.cs
...mplementation/NavigateTo/NavigateToItemProviderFactory.cs
+1
-6
src/EditorFeatures/Core/Implementation/NavigationBar/NavigationBarController.cs
...e/Implementation/NavigationBar/NavigationBarController.cs
+8
-4
src/EditorFeatures/Core/Implementation/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.cs
...ighlighting/NagivateToHighlightReferenceCommandHandler.cs
+2
-12
src/EditorFeatures/Core/Implementation/SmartIndent/SmartIndent.cs
...orFeatures/Core/Implementation/SmartIndent/SmartIndent.cs
+1
-6
src/EditorFeatures/Core/Shared/Utilities/SynchronizationContextTaskScheduler.cs
...e/Shared/Utilities/SynchronizationContextTaskScheduler.cs
+1
-4
src/EditorFeatures/Core/Tagging/TaggerContext.cs
src/EditorFeatures/Core/Tagging/TaggerContext.cs
+1
-6
src/Features/Core/Portable/CodeFixes/Suppression/ExportSuppressionFixProviderAttribute.cs
...ixes/Suppression/ExportSuppressionFixProviderAttribute.cs
+2
-12
src/Features/Core/Portable/Common/NavigationOperation.cs
src/Features/Core/Portable/Common/NavigationOperation.cs
+1
-6
src/Features/Core/Portable/Common/TaggedText.cs
src/Features/Core/Portable/Common/TaggedText.cs
+2
-12
src/Features/Core/Portable/Completion/CompletionContext.cs
src/Features/Core/Portable/Completion/CompletionContext.cs
+3
-18
src/Features/Core/Portable/Completion/ExportCompletionProviderAttribute.cs
.../Portable/Completion/ExportCompletionProviderAttribute.cs
+2
-12
src/Features/Core/Portable/Diagnostics/Analyzers/NamingStyles/Serialization/NamingStyle.cs
...stics/Analyzers/NamingStyles/Serialization/NamingStyle.cs
+9
-8
src/Features/Core/Portable/Diagnostics/Analyzers/NamingStyles/Serialization/SerializableNamingRule.cs
...zers/NamingStyles/Serialization/SerializableNamingRule.cs
+7
-9
src/Features/Core/Portable/Diagnostics/Analyzers/NamingStyles/Serialization/SerializableNamingStylePreferencesInfo.cs
...s/Serialization/SerializableNamingStylePreferencesInfo.cs
+3
-3
src/Features/Core/Portable/Diagnostics/Analyzers/NamingStyles/Serialization/SymbolSpecification.cs
...alyzers/NamingStyles/Serialization/SymbolSpecification.cs
+5
-4
src/Features/Core/Portable/NavigateTo/AbstractNavigateToSearchService.InProcess.cs
...e/NavigateTo/AbstractNavigateToSearchService.InProcess.cs
+3
-3
src/Features/Core/Portable/SignatureHelp/ExportSignatureHelpProviderAttribute.cs
...ble/SignatureHelp/ExportSignatureHelpProviderAttribute.cs
+2
-12
src/Features/Core/Portable/SolutionCrawler/Extensibility/ExportPerLanguageIncrementalAnalyzerProviderAttribute.cs
.../ExportPerLanguageIncrementalAnalyzerProviderAttribute.cs
+2
-12
src/VisualStudio/Core/Def/Implementation/AbstractEditorFactory.cs
...alStudio/Core/Def/Implementation/AbstractEditorFactory.cs
+1
-6
src/VisualStudio/Core/Def/Implementation/ProvideAutomationPropertiesAttribute.cs
...ef/Implementation/ProvideAutomationPropertiesAttribute.cs
+2
-12
src/VisualStudio/Core/Def/Implementation/Venus/AbstractContainedLanguage.cs
...ore/Def/Implementation/Venus/AbstractContainedLanguage.cs
+3
-18
src/Workspaces/Core/Portable/CodeActions/Operations/ApplyChangesOperation.cs
.../Portable/CodeActions/Operations/ApplyChangesOperation.cs
+1
-6
src/Workspaces/Core/Portable/CodeActions/Operations/OpenDocumentOperation.cs
.../Portable/CodeActions/Operations/OpenDocumentOperation.cs
+1
-6
src/Workspaces/Core/Portable/CodeCleanup/Providers/ExportCodeCleanupProvider.cs
...rtable/CodeCleanup/Providers/ExportCodeCleanupProvider.cs
+1
-6
src/Workspaces/Core/Portable/CodeFixes/ExportCodeFixProviderAttribute.cs
...Core/Portable/CodeFixes/ExportCodeFixProviderAttribute.cs
+1
-6
src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/FixAllState.cs
.../Core/Portable/CodeFixes/FixAllOccurrences/FixAllState.cs
+2
-13
src/Workspaces/Core/Portable/CodeRefactorings/CodeRefactoringContext.cs
.../Core/Portable/CodeRefactorings/CodeRefactoringContext.cs
+2
-12
src/Workspaces/Core/Portable/CodeRefactorings/ExportCodeRefactoringProviderAttribute.cs
...odeRefactorings/ExportCodeRefactoringProviderAttribute.cs
+1
-6
src/Workspaces/Core/Portable/Editing/SyntaxEditor.cs
src/Workspaces/Core/Portable/Editing/SyntaxEditor.cs
+1
-6
src/Workspaces/Core/Portable/FindSymbols/SymbolFinder_Declarations.cs
...es/Core/Portable/FindSymbols/SymbolFinder_Declarations.cs
+2
-12
src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeIdentifierInfo.cs
...rtable/FindSymbols/SyntaxTree/SyntaxTreeIdentifierInfo.cs
+2
-12
src/Workspaces/Core/Portable/Formatting/Rules/ExportFormattingRule.cs
...es/Core/Portable/Formatting/Rules/ExportFormattingRule.cs
+1
-6
src/Workspaces/Core/Portable/Options/OptionKey.cs
src/Workspaces/Core/Portable/Options/OptionKey.cs
+1
-6
src/Workspaces/Core/Portable/Shared/Utilities/BloomFilter.cs
src/Workspaces/Core/Portable/Shared/Utilities/BloomFilter.cs
+1
-6
src/Workspaces/Core/Portable/SolutionCrawler/ExportIncrementalAnalyzerProviderAttribute.cs
...tionCrawler/ExportIncrementalAnalyzerProviderAttribute.cs
+2
-11
src/Workspaces/Core/Portable/SymbolKey/SymbolKey.cs
src/Workspaces/Core/Portable/SymbolKey/SymbolKey.cs
+1
-6
src/Workspaces/Core/Portable/Utilities/EditDistance.cs
src/Workspaces/Core/Portable/Utilities/EditDistance.cs
+1
-6
src/Workspaces/Core/Portable/Utilities/SpellChecker.cs
src/Workspaces/Core/Portable/Utilities/SpellChecker.cs
+1
-6
src/Workspaces/Core/Portable/Workspace/Host/Mef/ExportLanguageServiceAttribute.cs
...able/Workspace/Host/Mef/ExportLanguageServiceAttribute.cs
+1
-6
src/Workspaces/Core/Portable/Workspace/Host/Mef/ExportLanguageServiceFactoryAttribute.cs
...rkspace/Host/Mef/ExportLanguageServiceFactoryAttribute.cs
+1
-6
src/Workspaces/Core/Portable/Workspace/Host/Mef/ExportWorkspaceServiceAttribute.cs
...ble/Workspace/Host/Mef/ExportWorkspaceServiceAttribute.cs
+1
-6
src/Workspaces/Core/Portable/Workspace/Host/Mef/ExportWorkspaceServiceFactoryAttribute.cs
...kspace/Host/Mef/ExportWorkspaceServiceFactoryAttribute.cs
+1
-6
src/Workspaces/Core/Portable/Workspace/Host/Metadata/MetadataReferenceCache.cs
...ortable/Workspace/Host/Metadata/MetadataReferenceCache.cs
+1
-6
src/Workspaces/Core/Portable/Workspace/Solution/AdditionalTextDocument.cs
...ore/Portable/Workspace/Solution/AdditionalTextDocument.cs
+1
-6
src/Workspaces/Core/Portable/Workspace/Solution/DocumentInfo.cs
...rkspaces/Core/Portable/Workspace/Solution/DocumentInfo.cs
+2
-12
src/Workspaces/Core/Portable/Workspace/Solution/ProjectInfo.cs
...orkspaces/Core/Portable/Workspace/Solution/ProjectInfo.cs
+4
-24
src/Workspaces/Core/Portable/Workspace/Solution/SolutionInfo.cs
...rkspaces/Core/Portable/Workspace/Solution/SolutionInfo.cs
+1
-6
未找到文件。
src/EditorFeatures/Core/CommandArgs.cs
浏览文件 @
7a105a46
...
...
@@ -23,18 +23,8 @@ internal abstract class CommandArgs
public
CommandArgs
(
ITextView
textView
,
ITextBuffer
subjectBuffer
)
{
if
(
textView
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
textView
));
}
if
(
subjectBuffer
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
subjectBuffer
));
}
this
.
TextView
=
textView
;
this
.
SubjectBuffer
=
subjectBuffer
;
this
.
TextView
=
textView
??
throw
new
ArgumentNullException
(
nameof
(
textView
));
this
.
SubjectBuffer
=
subjectBuffer
??
throw
new
ArgumentNullException
(
nameof
(
subjectBuffer
));
}
}
}
}
\ No newline at end of file
src/EditorFeatures/Core/ExportContentTypeLanguageServiceAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -18,12 +18,7 @@ internal class ExportContentTypeLanguageServiceAttribute : ExportLanguageService
public
ExportContentTypeLanguageServiceAttribute
(
string
defaultContentType
,
string
language
,
string
layer
=
ServiceLayer
.
Default
)
:
base
(
typeof
(
IContentTypeLanguageService
),
language
,
layer
)
{
if
(
defaultContentType
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
defaultContentType
));
}
this
.
DefaultContentType
=
defaultContentType
;
this
.
DefaultContentType
=
defaultContentType
??
throw
new
ArgumentNullException
(
nameof
(
defaultContentType
));
}
}
}
src/EditorFeatures/Core/Extensibility/BraceMatching/ExportBraceMatcherAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -14,12 +14,7 @@ internal class ExportBraceMatcherAttribute : ExportAttribute
public
ExportBraceMatcherAttribute
(
string
language
)
:
base
(
typeof
(
IBraceMatcher
))
{
if
(
language
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
language
));
}
this
.
Language
=
language
;
this
.
Language
=
language
??
throw
new
ArgumentNullException
(
nameof
(
language
));
}
}
}
src/EditorFeatures/Core/Extensibility/Completion/ExportCompletionProviderAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -16,18 +16,8 @@ internal class ExportCompletionProviderMef1Attribute : ExportAttribute
public
ExportCompletionProviderMef1Attribute
(
string
name
,
string
language
)
:
base
(
typeof
(
CompletionProvider
))
{
if
(
name
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
name
));
}
if
(
language
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
language
));
}
this
.
Name
=
name
;
this
.
Language
=
language
;
this
.
Name
=
name
??
throw
new
ArgumentNullException
(
nameof
(
name
));
this
.
Language
=
language
??
throw
new
ArgumentNullException
(
nameof
(
language
));
}
}
}
src/EditorFeatures/Core/Extensibility/Highlighting/ExportHighlighterAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -16,12 +16,7 @@ internal class ExportHighlighterAttribute : ExportAttribute
public
ExportHighlighterAttribute
(
string
language
)
:
base
(
typeof
(
IHighlighter
))
{
if
(
language
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
language
));
}
this
.
Language
=
language
;
this
.
Language
=
language
??
throw
new
ArgumentNullException
(
nameof
(
language
));
}
}
}
}
\ No newline at end of file
src/EditorFeatures/Core/Extensibility/QuickInfo/ExportQuickInfoProviderAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -15,18 +15,8 @@ internal class ExportQuickInfoProviderAttribute : ExportAttribute
public
ExportQuickInfoProviderAttribute
(
string
name
,
string
language
)
:
base
(
typeof
(
IQuickInfoProvider
))
{
if
(
name
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
name
));
}
if
(
language
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
language
));
}
this
.
Name
=
name
;
this
.
Language
=
language
;
this
.
Name
=
name
??
throw
new
ArgumentNullException
(
nameof
(
name
));
this
.
Language
=
language
??
throw
new
ArgumentNullException
(
nameof
(
language
));
}
}
}
src/EditorFeatures/Core/Implementation/AutomaticCompletion/Extensions.cs
浏览文件 @
7a105a46
...
...
@@ -32,10 +32,10 @@ public static void Format(this ITextBuffer buffer, TextSpan span, IEnumerable<IF
public
static
CaretPreservingEditTransaction
CreateEditTransaction
(
this
ITextView
view
,
string
description
,
ITextUndoHistoryRegistry
registry
,
IEditorOperationsFactoryService
service
)
{
var
transaction
=
new
CaretPreservingEditTransaction
(
description
,
view
,
registry
,
service
);
transaction
.
MergePolicy
=
AutomaticCodeChangeMergePolicy
.
Instance
;
return
transaction
;
return
new
CaretPreservingEditTransaction
(
description
,
view
,
registry
,
service
)
{
MergePolicy
=
AutomaticCodeChangeMergePolicy
.
Instance
}
;
}
public
static
SyntaxToken
FindToken
(
this
ITextSnapshot
snapshot
,
int
position
,
CancellationToken
cancellationToken
)
...
...
src/EditorFeatures/Core/Implementation/InlineRename/Dashboard/Dashboard.xaml.cs
浏览文件 @
7a105a46
...
...
@@ -114,12 +114,7 @@ private void OnPresentationSourceChanged(object sender, SourceChangedEventArgs a
private
void
ConnectToPresentationSource
(
PresentationSource
presentationSource
)
{
if
(
presentationSource
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
presentationSource
));
}
_presentationSource
=
presentationSource
;
_presentationSource
=
presentationSource
??
throw
new
ArgumentNullException
(
nameof
(
presentationSource
));
if
(
Application
.
Current
!=
null
&&
Application
.
Current
.
MainWindow
!=
null
)
{
...
...
src/EditorFeatures/Core/Implementation/LineSeparators/LineSeparatorTag.cs
浏览文件 @
7a105a46
...
...
@@ -34,12 +34,13 @@ public override GraphicsResult GetGraphics(IWpfTextView view, Geometry bounds)
{
Initialize
(
view
);
var
border
=
new
Border
();
border
.
BorderBrush
=
_graphicsTagBrush
;
border
.
BorderThickness
=
new
Thickness
(
0
,
0
,
0
,
bottom
:
1
);
border
.
Height
=
1
;
border
.
Width
=
view
.
ViewportWidth
;
var
border
=
new
Border
()
{
BorderBrush
=
_graphicsTagBrush
,
BorderThickness
=
new
Thickness
(
0
,
0
,
0
,
bottom
:
1
),
Height
=
1
,
Width
=
view
.
ViewportWidth
};
EventHandler
viewportWidthChangedHandler
=
(
s
,
e
)
=>
{
border
.
Width
=
view
.
ViewportWidth
;
...
...
src/EditorFeatures/Core/Implementation/NavigateTo/NavigateToItemProviderFactory.cs
浏览文件 @
7a105a46
...
...
@@ -23,17 +23,12 @@ internal class NavigateToItemProviderFactory : INavigateToItemProviderFactory
[
ImportMany
]
IEnumerable
<
Lazy
<
INavigateToHostVersionService
,
VisualStudioVersionMetadata
>>
hostServices
,
[
ImportMany
]
IEnumerable
<
Lazy
<
IAsynchronousOperationListener
,
FeatureMetadata
>>
asyncListeners
)
{
if
(
glyphService
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
glyphService
));
}
if
(
asyncListeners
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
asyncListeners
));
}
_glyphService
=
glyphService
;
_glyphService
=
glyphService
??
throw
new
ArgumentNullException
(
nameof
(
glyphService
))
;
_hostServices
=
hostServices
;
_asyncListener
=
new
AggregateAsynchronousOperationListener
(
asyncListeners
,
FeatureAttribute
.
NavigateTo
);
}
...
...
src/EditorFeatures/Core/Implementation/NavigationBar/NavigationBarController.cs
浏览文件 @
7a105a46
...
...
@@ -312,15 +312,19 @@ private void PushSelectedItemsToPresenter(NavigationBarSelectedTypeAndMember sel
if
(
oldRight
!=
null
)
{
newRight
=
new
NavigationBarPresentedItem
(
oldRight
.
Text
,
oldRight
.
Glyph
,
oldRight
.
Spans
,
oldRight
.
ChildItems
,
oldRight
.
Bolded
,
oldRight
.
Grayed
||
selectedItems
.
ShowMemberItemGrayed
);
newRight
.
TrackingSpans
=
oldRight
.
TrackingSpans
;
newRight
=
new
NavigationBarPresentedItem
(
oldRight
.
Text
,
oldRight
.
Glyph
,
oldRight
.
Spans
,
oldRight
.
ChildItems
,
oldRight
.
Bolded
,
oldRight
.
Grayed
||
selectedItems
.
ShowMemberItemGrayed
)
{
TrackingSpans
=
oldRight
.
TrackingSpans
};
listOfRight
.
Add
(
newRight
);
}
if
(
oldLeft
!=
null
)
{
newLeft
=
new
NavigationBarPresentedItem
(
oldLeft
.
Text
,
oldLeft
.
Glyph
,
oldLeft
.
Spans
,
listOfRight
,
oldLeft
.
Bolded
,
oldLeft
.
Grayed
||
selectedItems
.
ShowTypeItemGrayed
);
newLeft
.
TrackingSpans
=
oldLeft
.
TrackingSpans
;
newLeft
=
new
NavigationBarPresentedItem
(
oldLeft
.
Text
,
oldLeft
.
Glyph
,
oldLeft
.
Spans
,
listOfRight
,
oldLeft
.
Bolded
,
oldLeft
.
Grayed
||
selectedItems
.
ShowTypeItemGrayed
)
{
TrackingSpans
=
oldLeft
.
TrackingSpans
};
listOfLeft
.
Add
(
newLeft
);
}
...
...
src/EditorFeatures/Core/Implementation/ReferenceHighlighting/NagivateToHighlightReferenceCommandHandler.cs
浏览文件 @
7a105a46
...
...
@@ -29,18 +29,8 @@ internal partial class NavigateToHighlightReferenceCommandHandler :
IOutliningManagerService
outliningManagerService
,
IViewTagAggregatorFactoryService
tagAggregatorFactory
)
{
if
(
outliningManagerService
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
outliningManagerService
));
}
if
(
tagAggregatorFactory
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
tagAggregatorFactory
));
}
_outliningManagerService
=
outliningManagerService
;
_tagAggregatorFactory
=
tagAggregatorFactory
;
_outliningManagerService
=
outliningManagerService
??
throw
new
ArgumentNullException
(
nameof
(
outliningManagerService
));
_tagAggregatorFactory
=
tagAggregatorFactory
??
throw
new
ArgumentNullException
(
nameof
(
tagAggregatorFactory
));
}
public
CommandState
GetCommandState
(
NavigateToHighlightedReferenceCommandArgs
args
,
Func
<
CommandState
>
nextHandler
)
...
...
src/EditorFeatures/Core/Implementation/SmartIndent/SmartIndent.cs
浏览文件 @
7a105a46
...
...
@@ -18,12 +18,7 @@ internal partial class SmartIndent : ISmartIndent
public
SmartIndent
(
ITextView
textView
)
{
if
(
textView
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
textView
));
}
_textView
=
textView
;
_textView
=
textView
??
throw
new
ArgumentNullException
(
nameof
(
textView
));
}
public
int
?
GetDesiredIndentation
(
ITextSnapshotLine
line
)
...
...
src/EditorFeatures/Core/Shared/Utilities/SynchronizationContextTaskScheduler.cs
浏览文件 @
7a105a46
...
...
@@ -15,11 +15,8 @@ internal class SynchronizationContextTaskScheduler : TaskScheduler
internal
SynchronizationContextTaskScheduler
(
SynchronizationContext
synchronizationContext
)
{
if
(
synchronizationContext
==
null
)
throw
new
ArgumentNullException
(
nameof
(
synchronizationContext
));
_postCallback
=
new
SendOrPostCallback
(
PostCallback
);
_synchronizationContext
=
synchronizationContext
;
_synchronizationContext
=
synchronizationContext
??
throw
new
ArgumentNullException
(
nameof
(
synchronizationContext
))
;
}
public
override
Int32
MaximumConcurrencyLevel
...
...
src/EditorFeatures/Core/Tagging/TaggerContext.cs
浏览文件 @
7a105a46
...
...
@@ -83,12 +83,7 @@ public void AddTag(ITagSpan<TTag> tag)
/// </summary>
public
void
SetSpansTagged
(
IEnumerable
<
DocumentSnapshotSpan
>
spansTagged
)
{
if
(
spansTagged
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
spansTagged
));
}
this
.
_spansTagged
=
spansTagged
;
this
.
_spansTagged
=
spansTagged
??
throw
new
ArgumentNullException
(
nameof
(
spansTagged
));
}
public
IEnumerable
<
ITagSpan
<
TTag
>>
GetExistingTags
(
SnapshotSpan
span
)
...
...
src/Features/Core/Portable/CodeFixes/Suppression/ExportSuppressionFixProviderAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -27,23 +27,13 @@ internal class ExportSuppressionFixProviderAttribute : ExportAttribute
params
string
[]
languages
)
:
base
(
typeof
(
ISuppressionFixProvider
))
{
if
(
name
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
name
));
}
if
(
languages
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
languages
));
}
if
(
languages
.
Length
==
0
)
{
throw
new
ArgumentException
(
"languages"
);
}
this
.
Name
=
name
;
this
.
Languages
=
languages
;
this
.
Name
=
name
??
throw
new
ArgumentNullException
(
nameof
(
name
))
;
this
.
Languages
=
languages
??
throw
new
ArgumentNullException
(
nameof
(
languages
))
;
}
}
}
src/Features/Core/Portable/Common/NavigationOperation.cs
浏览文件 @
7a105a46
...
...
@@ -21,12 +21,7 @@ public class DocumentNavigationOperation : CodeActionOperation
public
DocumentNavigationOperation
(
DocumentId
documentId
,
int
position
=
0
)
{
if
(
documentId
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
documentId
));
}
_documentId
=
documentId
;
_documentId
=
documentId
??
throw
new
ArgumentNullException
(
nameof
(
documentId
));
_position
=
position
;
}
...
...
src/Features/Core/Portable/Common/TaggedText.cs
浏览文件 @
7a105a46
...
...
@@ -32,18 +32,8 @@ public struct TaggedText
/// <param name="text">The actual text to be displayed.</param>
public
TaggedText
(
string
tag
,
string
text
)
{
if
(
tag
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
tag
));
}
if
(
text
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
text
));
}
Tag
=
tag
;
Text
=
text
;
Tag
=
tag
??
throw
new
ArgumentNullException
(
nameof
(
tag
));
Text
=
text
??
throw
new
ArgumentNullException
(
nameof
(
text
));
}
public
override
string
ToString
()
...
...
src/Features/Core/Portable/Completion/CompletionContext.cs
浏览文件 @
7a105a46
...
...
@@ -85,27 +85,12 @@ internal IReadOnlyList<CompletionItem> Items
OptionSet
options
,
CancellationToken
cancellationToken
)
{
if
(
provider
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
provider
));
}
if
(
document
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
document
));
}
if
(
options
==
null
)
{
throw
new
ArgumentException
(
nameof
(
options
));
}
this
.
Provider
=
provider
;
this
.
Document
=
document
;
this
.
Provider
=
provider
??
throw
new
ArgumentNullException
(
nameof
(
provider
));
this
.
Document
=
document
??
throw
new
ArgumentNullException
(
nameof
(
document
));
this
.
Position
=
position
;
this
.
CompletionListSpan
=
defaultSpan
;
this
.
Trigger
=
trigger
;
this
.
Options
=
options
;
this
.
Options
=
options
??
throw
new
ArgumentException
(
nameof
(
options
))
;
this
.
CancellationToken
=
cancellationToken
;
_items
=
new
List
<
CompletionItem
>();
}
...
...
src/Features/Core/Portable/Completion/ExportCompletionProviderAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -20,18 +20,8 @@ public sealed class ExportCompletionProviderAttribute : ExportAttribute
public
ExportCompletionProviderAttribute
(
string
name
,
string
language
)
:
base
(
typeof
(
CompletionProvider
))
{
if
(
name
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
name
));
}
if
(
language
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
language
));
}
this
.
Name
=
name
;
this
.
Language
=
language
;
this
.
Name
=
name
??
throw
new
ArgumentNullException
(
nameof
(
name
));
this
.
Language
=
language
??
throw
new
ArgumentNullException
(
nameof
(
language
));
}
}
}
src/Features/Core/Portable/Diagnostics/Analyzers/NamingStyles/Serialization/NamingStyle.cs
浏览文件 @
7a105a46
...
...
@@ -304,14 +304,15 @@ internal XElement CreateXElement()
internal
static
NamingStyle
FromXElement
(
XElement
namingStyleElement
)
{
var
result
=
new
NamingStyle
();
result
.
ID
=
Guid
.
Parse
(
namingStyleElement
.
Attribute
(
nameof
(
ID
)).
Value
);
result
.
Name
=
namingStyleElement
.
Attribute
(
nameof
(
Name
)).
Value
;
result
.
Prefix
=
namingStyleElement
.
Attribute
(
nameof
(
Prefix
)).
Value
;
result
.
Suffix
=
namingStyleElement
.
Attribute
(
nameof
(
Suffix
)).
Value
;
result
.
WordSeparator
=
namingStyleElement
.
Attribute
(
nameof
(
WordSeparator
)).
Value
;
result
.
CapitalizationScheme
=
(
Capitalization
)
Enum
.
Parse
(
typeof
(
Capitalization
),
namingStyleElement
.
Attribute
(
nameof
(
CapitalizationScheme
)).
Value
);
return
result
;
return
new
NamingStyle
()
{
ID
=
Guid
.
Parse
(
namingStyleElement
.
Attribute
(
nameof
(
ID
)).
Value
),
Name
=
namingStyleElement
.
Attribute
(
nameof
(
Name
)).
Value
,
Prefix
=
namingStyleElement
.
Attribute
(
nameof
(
Prefix
)).
Value
,
Suffix
=
namingStyleElement
.
Attribute
(
nameof
(
Suffix
)).
Value
,
WordSeparator
=
namingStyleElement
.
Attribute
(
nameof
(
WordSeparator
)).
Value
,
CapitalizationScheme
=
(
Capitalization
)
Enum
.
Parse
(
typeof
(
Capitalization
),
namingStyleElement
.
Attribute
(
nameof
(
CapitalizationScheme
)).
Value
)
};
}
}
}
\ No newline at end of file
src/Features/Core/Portable/Diagnostics/Analyzers/NamingStyles/Serialization/SerializableNamingRule.cs
浏览文件 @
7a105a46
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Immutable
;
using
System.Linq
;
using
System.Xml.Linq
;
namespace
Microsoft.CodeAnalysis.Diagnostics.Analyzers.NamingStyles
...
...
@@ -34,11 +31,12 @@ internal XElement CreateXElement()
internal
static
SerializableNamingRule
FromXElement
(
XElement
namingRuleElement
)
{
var
result
=
new
SerializableNamingRule
();
result
.
EnforcementLevel
=
(
DiagnosticSeverity
)
Enum
.
Parse
(
typeof
(
DiagnosticSeverity
),
namingRuleElement
.
Attribute
(
nameof
(
EnforcementLevel
)).
Value
);
result
.
NamingStyleID
=
Guid
.
Parse
(
namingRuleElement
.
Attribute
(
nameof
(
NamingStyleID
)).
Value
);
result
.
SymbolSpecificationID
=
Guid
.
Parse
(
namingRuleElement
.
Attribute
(
nameof
(
SymbolSpecificationID
)).
Value
);
return
result
;
return
new
SerializableNamingRule
()
{
EnforcementLevel
=
(
DiagnosticSeverity
)
Enum
.
Parse
(
typeof
(
DiagnosticSeverity
),
namingRuleElement
.
Attribute
(
nameof
(
EnforcementLevel
)).
Value
),
NamingStyleID
=
Guid
.
Parse
(
namingRuleElement
.
Attribute
(
nameof
(
NamingStyleID
)).
Value
),
SymbolSpecificationID
=
Guid
.
Parse
(
namingRuleElement
.
Attribute
(
nameof
(
SymbolSpecificationID
)).
Value
)
};
}
}
}
}
\ No newline at end of file
src/Features/Core/Portable/Diagnostics/Analyzers/NamingStyles/Serialization/SerializableNamingStylePreferencesInfo.cs
浏览文件 @
7a105a46
...
...
@@ -20,7 +20,7 @@ internal class SerializableNamingStylePreferencesInfo
public
List
<
SymbolSpecification
>
SymbolSpecifications
;
public
List
<
NamingStyle
>
NamingStyles
;
public
List
<
SerializableNamingRule
>
NamingRules
;
private
readonly
static
int
_serializationVersion
=
3
;
private
readonly
static
int
s
_serializationVersion
=
3
;
internal
SerializableNamingStylePreferencesInfo
()
{
...
...
@@ -47,7 +47,7 @@ public NamingStylePreferencesInfo GetPreferencesInfo()
internal
XElement
CreateXElement
()
{
return
new
XElement
(
"NamingPreferencesInfo"
,
new
XAttribute
(
"SerializationVersion"
,
_serializationVersion
),
new
XAttribute
(
"SerializationVersion"
,
s
_serializationVersion
),
CreateSymbolSpecificationListXElement
(),
CreateNamingStyleListXElement
(),
CreateNamingRuleTreeXElement
());
...
...
@@ -94,7 +94,7 @@ internal static SerializableNamingStylePreferencesInfo FromXElement(XElement nam
var
namingPreferencesInfo
=
new
SerializableNamingStylePreferencesInfo
();
var
serializationVersion
=
int
.
Parse
(
namingPreferencesInfoElement
.
Attribute
(
"SerializationVersion"
).
Value
);
if
(
serializationVersion
!=
_serializationVersion
)
if
(
serializationVersion
!=
s
_serializationVersion
)
{
namingPreferencesInfoElement
=
XElement
.
Parse
(
SimplificationOptions
.
NamingPreferences
.
DefaultValue
);
}
...
...
src/Features/Core/Portable/Diagnostics/Analyzers/NamingStyles/Serialization/SymbolSpecification.cs
浏览文件 @
7a105a46
...
...
@@ -133,10 +133,11 @@ private XElement CreateModifiersXElement()
internal
static
SymbolSpecification
FromXElement
(
XElement
symbolSpecificationElement
)
{
var
result
=
new
SymbolSpecification
();
result
.
ID
=
Guid
.
Parse
(
symbolSpecificationElement
.
Attribute
(
nameof
(
ID
)).
Value
);
result
.
Name
=
symbolSpecificationElement
.
Attribute
(
nameof
(
Name
)).
Value
;
var
result
=
new
SymbolSpecification
()
{
ID
=
Guid
.
Parse
(
symbolSpecificationElement
.
Attribute
(
nameof
(
ID
)).
Value
),
Name
=
symbolSpecificationElement
.
Attribute
(
nameof
(
Name
)).
Value
};
result
.
PopulateSymbolKindListFromXElement
(
symbolSpecificationElement
.
Element
(
nameof
(
ApplicableSymbolKindList
)));
result
.
PopulateAccessibilityListFromXElement
(
symbolSpecificationElement
.
Element
(
nameof
(
ApplicableAccessibilityList
)));
result
.
PopulateModifierListFromXElement
(
symbolSpecificationElement
.
Element
(
nameof
(
RequiredModifierList
)));
...
...
src/Features/Core/Portable/NavigateTo/AbstractNavigateToSearchService.InProcess.cs
浏览文件 @
7a105a46
...
...
@@ -19,18 +19,18 @@ internal abstract partial class AbstractNavigateToSearchService
public
static
Task
<
ImmutableArray
<
INavigateToSearchResult
>>
SearchProjectInCurrentProcessAsync
(
Project
project
,
string
searchPattern
,
CancellationToken
cancellationToken
)
{
return
FindNavigableDeclaredSymbolInfos
(
return
FindNavigableDeclaredSymbolInfos
Async
(
project
,
searchDocument
:
null
,
pattern
:
searchPattern
,
cancellationToken
:
cancellationToken
);
}
public
static
Task
<
ImmutableArray
<
INavigateToSearchResult
>>
SearchDocumentInCurrentProcessAsync
(
Document
document
,
string
searchPattern
,
CancellationToken
cancellationToken
)
{
return
FindNavigableDeclaredSymbolInfos
(
return
FindNavigableDeclaredSymbolInfos
Async
(
document
.
Project
,
document
,
searchPattern
,
cancellationToken
);
}
private
static
async
Task
<
ImmutableArray
<
INavigateToSearchResult
>>
FindNavigableDeclaredSymbolInfos
(
private
static
async
Task
<
ImmutableArray
<
INavigateToSearchResult
>>
FindNavigableDeclaredSymbolInfos
Async
(
Project
project
,
Document
searchDocument
,
string
pattern
,
CancellationToken
cancellationToken
)
{
var
containsDots
=
pattern
.
IndexOf
(
'.'
)
>=
0
;
...
...
src/Features/Core/Portable/SignatureHelp/ExportSignatureHelpProviderAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -15,18 +15,8 @@ internal class ExportSignatureHelpProviderAttribute : ExportAttribute
public
ExportSignatureHelpProviderAttribute
(
string
name
,
string
language
)
:
base
(
typeof
(
ISignatureHelpProvider
))
{
if
(
name
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
name
));
}
if
(
language
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
language
));
}
this
.
Name
=
name
;
this
.
Language
=
language
;
this
.
Name
=
name
??
throw
new
ArgumentNullException
(
nameof
(
name
));
this
.
Language
=
language
??
throw
new
ArgumentNullException
(
nameof
(
language
));
}
}
}
src/Features/Core/Portable/SolutionCrawler/Extensibility/ExportPerLanguageIncrementalAnalyzerProviderAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -15,18 +15,8 @@ internal class ExportPerLanguageIncrementalAnalyzerProviderAttribute : ExportAtt
public
ExportPerLanguageIncrementalAnalyzerProviderAttribute
(
string
name
,
string
language
)
:
base
(
typeof
(
IPerLanguageIncrementalAnalyzerProvider
))
{
if
(
name
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
name
));
}
if
(
language
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
language
));
}
this
.
Name
=
name
;
this
.
Language
=
language
;
this
.
Name
=
name
??
throw
new
ArgumentNullException
(
nameof
(
name
));
this
.
Language
=
language
??
throw
new
ArgumentNullException
(
nameof
(
language
));
}
}
}
src/VisualStudio/Core/Def/Implementation/AbstractEditorFactory.cs
浏览文件 @
7a105a46
...
...
@@ -36,12 +36,7 @@ internal abstract partial class AbstractEditorFactory : IVsEditorFactory, IVsEdi
protected
AbstractEditorFactory
(
Package
package
)
{
if
(
package
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
package
));
}
_package
=
package
;
_package
=
package
??
throw
new
ArgumentNullException
(
nameof
(
package
));
_componentModel
=
(
IComponentModel
)
ServiceProvider
.
GetService
(
typeof
(
SComponentModel
));
_editorAdaptersFactoryService
=
_componentModel
.
GetService
<
IVsEditorAdaptersFactoryService
>();
...
...
src/VisualStudio/Core/Def/Implementation/ProvideAutomationPropertiesAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -21,19 +21,9 @@ internal sealed class ProvideAutomationPropertiesAttribute : RegistrationAttribu
public
ProvideAutomationPropertiesAttribute
(
string
category
,
string
page
,
string
packageGuid
,
int
profileNodeLabelId
,
int
profileNodeDescriptionId
,
string
resourcePackageGuid
=
null
)
{
if
(
category
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
category
));
}
if
(
page
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
page
));
}
this
.
PackageGuid
=
Guid
.
Parse
(
packageGuid
);
this
.
Category
=
category
;
this
.
Page
=
page
;
this
.
Category
=
category
??
throw
new
ArgumentNullException
(
nameof
(
category
))
;
this
.
Page
=
page
??
throw
new
ArgumentNullException
(
nameof
(
page
))
;
this
.
ProfileNodeLabelId
=
profileNodeLabelId
;
this
.
ProfileNodeDescriptionId
=
profileNodeDescriptionId
;
...
...
src/VisualStudio/Core/Def/Implementation/Venus/AbstractContainedLanguage.cs
浏览文件 @
7a105a46
...
...
@@ -40,12 +40,7 @@ internal abstract class AbstractContainedLanguage : IDisposable
public
AbstractContainedLanguage
(
AbstractProject
project
)
{
if
(
project
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
project
));
}
this
.
Project
=
project
;
this
.
Project
=
project
??
throw
new
ArgumentNullException
(
nameof
(
project
));
}
/// <summary>
...
...
@@ -54,12 +49,7 @@ internal abstract class AbstractContainedLanguage : IDisposable
/// <param name="subjectBuffer"></param>
protected
void
SetSubjectBuffer
(
ITextBuffer
subjectBuffer
)
{
if
(
subjectBuffer
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
subjectBuffer
));
}
this
.
SubjectBuffer
=
subjectBuffer
;
this
.
SubjectBuffer
=
subjectBuffer
??
throw
new
ArgumentNullException
(
nameof
(
subjectBuffer
));
}
/// <summary>
...
...
@@ -67,12 +57,7 @@ protected void SetSubjectBuffer(ITextBuffer subjectBuffer)
/// </summary>
protected
void
SetDataBuffer
(
ITextBuffer
dataBuffer
)
{
if
(
dataBuffer
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
dataBuffer
));
}
this
.
DataBuffer
=
dataBuffer
;
this
.
DataBuffer
=
dataBuffer
??
throw
new
ArgumentNullException
(
nameof
(
dataBuffer
));
}
public
abstract
void
Dispose
();
...
...
src/Workspaces/Core/Portable/CodeActions/Operations/ApplyChangesOperation.cs
浏览文件 @
7a105a46
...
...
@@ -28,12 +28,7 @@ public sealed class ApplyChangesOperation : CodeActionOperation
public
ApplyChangesOperation
(
Solution
changedSolution
)
{
if
(
changedSolution
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
changedSolution
));
}
ChangedSolution
=
changedSolution
;
ChangedSolution
=
changedSolution
??
throw
new
ArgumentNullException
(
nameof
(
changedSolution
));
}
internal
override
bool
ApplyDuringTests
=>
true
;
...
...
src/Workspaces/Core/Portable/CodeActions/Operations/OpenDocumentOperation.cs
浏览文件 @
7a105a46
...
...
@@ -15,12 +15,7 @@ public sealed class OpenDocumentOperation : CodeActionOperation
public
OpenDocumentOperation
(
DocumentId
documentId
,
bool
activateIfAlreadyOpen
=
false
)
{
if
(
documentId
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
documentId
));
}
_documentId
=
documentId
;
_documentId
=
documentId
??
throw
new
ArgumentNullException
(
nameof
(
documentId
));
_activate
=
activateIfAlreadyOpen
;
}
...
...
src/Workspaces/Core/Portable/CodeCleanup/Providers/ExportCodeCleanupProvider.cs
浏览文件 @
7a105a46
...
...
@@ -19,18 +19,13 @@ internal class ExportCodeCleanupProvider : ExportAttribute
public
ExportCodeCleanupProvider
(
string
name
,
params
string
[]
languages
)
:
base
(
typeof
(
ICodeCleanupProvider
))
{
if
(
languages
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
languages
));
}
if
(
languages
.
Length
==
0
)
{
throw
new
ArgumentException
(
"languages"
);
}
this
.
Name
=
name
;
this
.
Languages
=
languages
;
this
.
Languages
=
languages
??
throw
new
ArgumentNullException
(
nameof
(
languages
))
;
}
}
}
src/Workspaces/Core/Portable/CodeFixes/ExportCodeFixProviderAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -32,11 +32,6 @@ public sealed class ExportCodeFixProviderAttribute : ExportAttribute
params
string
[]
additionalLanguages
)
:
base
(
typeof
(
CodeFixProvider
))
{
if
(
firstLanguage
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
firstLanguage
));
}
if
(
additionalLanguages
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
additionalLanguages
));
...
...
@@ -45,7 +40,7 @@ public sealed class ExportCodeFixProviderAttribute : ExportAttribute
this
.
Name
=
null
;
string
[]
languages
=
new
string
[
additionalLanguages
.
Length
+
1
];
languages
[
0
]
=
firstLanguage
;
languages
[
0
]
=
firstLanguage
??
throw
new
ArgumentNullException
(
nameof
(
firstLanguage
))
;
for
(
int
index
=
0
;
index
<
additionalLanguages
.
Length
;
index
++)
{
languages
[
index
+
1
]
=
additionalLanguages
[
index
];
...
...
src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/FixAllState.cs
浏览文件 @
7a105a46
...
...
@@ -65,12 +65,6 @@ internal partial class FixAllState
FixAllContext
.
DiagnosticProvider
fixAllDiagnosticProvider
)
{
Contract
.
ThrowIfNull
(
project
);
if
(
codeFixProvider
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
codeFixProvider
));
}
if
(
diagnosticIds
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
diagnosticIds
));
...
...
@@ -81,19 +75,14 @@ internal partial class FixAllState
throw
new
ArgumentException
(
WorkspacesResources
.
Supplied_diagnostic_cannot_be_null
,
nameof
(
diagnosticIds
));
}
if
(
fixAllDiagnosticProvider
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
fixAllDiagnosticProvider
));
}
this
.
FixAllProvider
=
fixAllProvider
;
this
.
Document
=
document
;
this
.
Project
=
project
;
this
.
CodeFixProvider
=
codeFixProvider
;
this
.
CodeFixProvider
=
codeFixProvider
??
throw
new
ArgumentNullException
(
nameof
(
codeFixProvider
))
;
this
.
Scope
=
scope
;
this
.
CodeActionEquivalenceKey
=
codeActionEquivalenceKey
;
this
.
DiagnosticIds
=
ImmutableHashSet
.
CreateRange
(
diagnosticIds
);
this
.
DiagnosticProvider
=
fixAllDiagnosticProvider
;
this
.
DiagnosticProvider
=
fixAllDiagnosticProvider
??
throw
new
ArgumentNullException
(
nameof
(
fixAllDiagnosticProvider
))
;
}
internal
bool
IsFixMultiple
=>
this
.
DiagnosticProvider
.
IsFixMultiple
;
...
...
src/Workspaces/Core/Portable/CodeRefactorings/CodeRefactoringContext.cs
浏览文件 @
7a105a46
...
...
@@ -38,19 +38,9 @@ public struct CodeRefactoringContext
Action
<
CodeAction
>
registerRefactoring
,
CancellationToken
cancellationToken
)
{
if
(
document
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
document
));
}
if
(
registerRefactoring
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
registerRefactoring
));
}
Document
=
document
;
Document
=
document
??
throw
new
ArgumentNullException
(
nameof
(
document
));
Span
=
span
;
_registerRefactoring
=
registerRefactoring
;
_registerRefactoring
=
registerRefactoring
??
throw
new
ArgumentNullException
(
nameof
(
registerRefactoring
))
;
CancellationToken
=
cancellationToken
;
}
...
...
src/Workspaces/Core/Portable/CodeRefactorings/ExportCodeRefactoringProviderAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -30,11 +30,6 @@ public sealed class ExportCodeRefactoringProviderAttribute : ExportAttribute
public
ExportCodeRefactoringProviderAttribute
(
string
firstLanguage
,
params
string
[]
additionalLanguages
)
:
base
(
typeof
(
CodeRefactoringProvider
))
{
if
(
firstLanguage
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
firstLanguage
));
}
if
(
additionalLanguages
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
additionalLanguages
));
...
...
@@ -43,7 +38,7 @@ public ExportCodeRefactoringProviderAttribute(string firstLanguage, params strin
this
.
Name
=
null
;
string
[]
languages
=
new
string
[
additionalLanguages
.
Length
+
1
];
languages
[
0
]
=
firstLanguage
;
languages
[
0
]
=
firstLanguage
??
throw
new
ArgumentNullException
(
nameof
(
firstLanguage
))
;
for
(
int
index
=
0
;
index
<
additionalLanguages
.
Length
;
index
++)
{
languages
[
index
+
1
]
=
additionalLanguages
[
index
];
...
...
src/Workspaces/Core/Portable/Editing/SyntaxEditor.cs
浏览文件 @
7a105a46
...
...
@@ -20,17 +20,12 @@ public class SyntaxEditor
/// </summary>
public
SyntaxEditor
(
SyntaxNode
root
,
Workspace
workspace
)
{
if
(
root
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
root
));
}
if
(
workspace
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
workspace
));
}
_root
=
root
;
_root
=
root
??
throw
new
ArgumentNullException
(
nameof
(
root
))
;
_generator
=
SyntaxGenerator
.
GetGenerator
(
workspace
,
root
.
Language
);
_changes
=
new
List
<
Change
>();
}
...
...
src/Workspaces/Core/Portable/FindSymbols/SymbolFinder_Declarations.cs
浏览文件 @
7a105a46
...
...
@@ -54,12 +54,7 @@ internal class SearchQuery
private
SearchQuery
(
string
name
,
SearchKind
kind
)
{
if
(
name
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
name
));
}
Name
=
name
;
Name
=
name
??
throw
new
ArgumentNullException
(
nameof
(
name
));
Kind
=
kind
;
switch
(
kind
)
...
...
@@ -83,13 +78,8 @@ private SearchQuery(string name, SearchKind kind)
private
SearchQuery
(
Func
<
string
,
bool
>
predicate
)
{
if
(
predicate
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
predicate
));
}
Kind
=
SearchKind
.
Custom
;
_predicate
=
predicate
;
_predicate
=
predicate
??
throw
new
ArgumentNullException
(
nameof
(
predicate
))
;
}
public
static
SearchQuery
Create
(
string
name
,
bool
ignoreCase
)
...
...
src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeIdentifierInfo.cs
浏览文件 @
7a105a46
...
...
@@ -32,19 +32,9 @@ internal partial class SyntaxTreeIdentifierInfo : AbstractSyntaxTreeInfo
BloomFilter
escapedIdentifierFilter
)
:
base
(
version
)
{
if
(
identifierFilter
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
identifierFilter
));
}
if
(
escapedIdentifierFilter
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
escapedIdentifierFilter
));
}
_version
=
version
;
_identifierFilter
=
identifierFilter
;
_escapedIdentifierFilter
=
escapedIdentifierFilter
;
_identifierFilter
=
identifierFilter
??
throw
new
ArgumentNullException
(
nameof
(
identifierFilter
))
;
_escapedIdentifierFilter
=
escapedIdentifierFilter
??
throw
new
ArgumentNullException
(
nameof
(
escapedIdentifierFilter
))
;
}
/// <summary>
...
...
src/Workspaces/Core/Portable/Formatting/Rules/ExportFormattingRule.cs
浏览文件 @
7a105a46
...
...
@@ -18,13 +18,8 @@ internal class ExportFormattingRule : ExportAttribute
public
ExportFormattingRule
(
string
name
,
string
language
)
:
base
(
typeof
(
IFormattingRule
))
{
if
(
language
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
language
));
}
this
.
Name
=
name
;
this
.
Language
=
language
;
this
.
Language
=
language
??
throw
new
ArgumentNullException
(
nameof
(
language
))
;
}
}
}
src/Workspaces/Core/Portable/Options/OptionKey.cs
浏览文件 @
7a105a46
...
...
@@ -12,11 +12,6 @@ public struct OptionKey : IEquatable<OptionKey>
public
OptionKey
(
IOption
option
,
string
language
=
null
)
{
if
(
option
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
option
));
}
if
(
language
!=
null
&&
!
option
.
IsPerLanguage
)
{
throw
new
ArgumentException
(
WorkspacesResources
.
A_language_name_cannot_be_specified_for_this_option
);
...
...
@@ -26,7 +21,7 @@ public OptionKey(IOption option, string language = null)
throw
new
ArgumentNullException
(
WorkspacesResources
.
A_language_name_must_be_specified_for_this_option
);
}
this
.
Option
=
option
;
this
.
Option
=
option
??
throw
new
ArgumentNullException
(
nameof
(
option
))
;
this
.
Language
=
language
;
}
...
...
src/Workspaces/Core/Portable/Shared/Utilities/BloomFilter.cs
浏览文件 @
7a105a46
...
...
@@ -47,12 +47,7 @@ public BloomFilter(double falsePositiveProbability, bool isCaseSensitive, IColle
private
BloomFilter
(
BitArray
bitArray
,
int
hashFunctionCount
,
bool
isCaseSensitive
)
{
if
(
bitArray
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
bitArray
));
}
_bitArray
=
bitArray
;
_bitArray
=
bitArray
??
throw
new
ArgumentNullException
(
nameof
(
bitArray
));
_hashFunctionCount
=
hashFunctionCount
;
_isCaseSensitive
=
isCaseSensitive
;
}
...
...
src/Workspaces/Core/Portable/SolutionCrawler/ExportIncrementalAnalyzerProviderAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -16,13 +16,9 @@ internal class ExportIncrementalAnalyzerProviderAttribute : ExportAttribute
public
ExportIncrementalAnalyzerProviderAttribute
(
params
string
[]
workspaceKinds
)
:
base
(
typeof
(
IIncrementalAnalyzerProvider
))
{
if
(
workspaceKinds
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
workspaceKinds
));
}
// TODO: this will be removed once closed side changes are in.
this
.
WorkspaceKinds
=
workspaceKinds
;
this
.
WorkspaceKinds
=
workspaceKinds
??
throw
new
ArgumentNullException
(
nameof
(
workspaceKinds
))
;
this
.
Name
=
"Unknown"
;
this
.
HighPriorityForActiveFile
=
false
;
}
...
...
@@ -30,13 +26,8 @@ public ExportIncrementalAnalyzerProviderAttribute(params string[] workspaceKinds
public
ExportIncrementalAnalyzerProviderAttribute
(
string
name
,
string
[]
workspaceKinds
)
:
base
(
typeof
(
IIncrementalAnalyzerProvider
))
{
if
(
name
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
name
));
}
this
.
WorkspaceKinds
=
workspaceKinds
;
this
.
Name
=
name
;
this
.
Name
=
name
??
throw
new
ArgumentNullException
(
nameof
(
name
))
;
this
.
HighPriorityForActiveFile
=
false
;
}
...
...
src/Workspaces/Core/Portable/SymbolKey/SymbolKey.cs
浏览文件 @
7a105a46
...
...
@@ -84,12 +84,7 @@ internal partial struct SymbolKey
public
SymbolKey
(
string
symbolKeyData
)
{
if
(
symbolKeyData
==
null
)
{
throw
new
ArgumentNullException
();
}
_symbolKeyData
=
symbolKeyData
;
_symbolKeyData
=
symbolKeyData
??
throw
new
ArgumentNullException
();
}
public
static
IEqualityComparer
<
SymbolKey
>
GetComparer
(
bool
ignoreCase
,
bool
ignoreAssemblyKeys
)
...
...
src/Workspaces/Core/Portable/Utilities/EditDistance.cs
浏览文件 @
7a105a46
...
...
@@ -48,12 +48,7 @@ internal class EditDistance : IDisposable
public
EditDistance
(
string
text
)
{
if
(
text
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
text
));
}
_source
=
text
;
_source
=
text
??
throw
new
ArgumentNullException
(
nameof
(
text
));
_sourceLowerCaseCharacters
=
ConvertToLowercaseArray
(
text
);
}
...
...
src/Workspaces/Core/Portable/Utilities/SpellChecker.cs
浏览文件 @
7a105a46
...
...
@@ -108,12 +108,7 @@ public CacheResult(string candidate, bool areSimilar, double similarityWeight)
public
WordSimilarityChecker
(
string
text
,
bool
substringsAreSimilar
)
{
if
(
text
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
text
));
}
_source
=
text
;
_source
=
text
??
throw
new
ArgumentNullException
(
nameof
(
text
));
_threshold
=
GetThreshold
(
_source
);
_editDistance
=
new
EditDistance
(
text
);
_substringsAreSimilar
=
substringsAreSimilar
;
...
...
src/Workspaces/Core/Portable/Workspace/Host/Mef/ExportLanguageServiceAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -41,13 +41,8 @@ public ExportLanguageServiceAttribute(Type type, string language, string layer =
throw
new
ArgumentNullException
(
nameof
(
type
));
}
if
(
language
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
language
));
}
this
.
ServiceType
=
type
.
AssemblyQualifiedName
;
this
.
Language
=
language
;
this
.
Language
=
language
??
throw
new
ArgumentNullException
(
nameof
(
language
))
;
this
.
Layer
=
layer
;
}
}
...
...
src/Workspaces/Core/Portable/Workspace/Host/Mef/ExportLanguageServiceFactoryAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -41,13 +41,8 @@ public ExportLanguageServiceFactoryAttribute(Type type, string language, string
throw
new
ArgumentNullException
(
nameof
(
type
));
}
if
(
language
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
language
));
}
this
.
ServiceType
=
type
.
AssemblyQualifiedName
;
this
.
Language
=
language
;
this
.
Language
=
language
??
throw
new
ArgumentNullException
(
nameof
(
language
))
;
this
.
Layer
=
layer
;
}
}
...
...
src/Workspaces/Core/Portable/Workspace/Host/Mef/ExportWorkspaceServiceAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -35,13 +35,8 @@ public ExportWorkspaceServiceAttribute(Type serviceType, string layer = ServiceL
throw
new
ArgumentNullException
(
nameof
(
serviceType
));
}
if
(
layer
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
layer
));
}
this
.
ServiceType
=
serviceType
.
AssemblyQualifiedName
;
this
.
Layer
=
layer
;
this
.
Layer
=
layer
??
throw
new
ArgumentNullException
(
nameof
(
layer
))
;
}
}
}
src/Workspaces/Core/Portable/Workspace/Host/Mef/ExportWorkspaceServiceFactoryAttribute.cs
浏览文件 @
7a105a46
...
...
@@ -35,13 +35,8 @@ public ExportWorkspaceServiceFactoryAttribute(Type serviceType, string layer = S
throw
new
ArgumentNullException
(
nameof
(
serviceType
));
}
if
(
layer
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
layer
));
}
this
.
ServiceType
=
serviceType
.
AssemblyQualifiedName
;
this
.
Layer
=
layer
;
this
.
Layer
=
layer
??
throw
new
ArgumentNullException
(
nameof
(
layer
))
;
}
}
}
src/Workspaces/Core/Portable/Workspace/Host/Metadata/MetadataReferenceCache.cs
浏览文件 @
7a105a46
...
...
@@ -19,12 +19,7 @@ internal class MetadataReferenceCache
public
MetadataReferenceCache
(
Func
<
string
,
MetadataReferenceProperties
,
MetadataReference
>
createReference
)
{
if
(
createReference
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
createReference
));
}
_createReference
=
createReference
;
_createReference
=
createReference
??
throw
new
ArgumentNullException
(
nameof
(
createReference
));
}
public
MetadataReference
GetReference
(
string
path
,
MetadataReferenceProperties
properties
)
...
...
src/Workspaces/Core/Portable/Workspace/Solution/AdditionalTextDocument.cs
浏览文件 @
7a105a46
...
...
@@ -18,12 +18,7 @@ internal sealed class AdditionalTextDocument : AdditionalText
/// </summary>
public
AdditionalTextDocument
(
TextDocumentState
document
)
{
if
(
document
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
document
));
}
_document
=
document
;
_document
=
document
??
throw
new
ArgumentNullException
(
nameof
(
document
));
}
/// <summary>
...
...
src/Workspaces/Core/Portable/Workspace/Solution/DocumentInfo.cs
浏览文件 @
7a105a46
...
...
@@ -167,18 +167,8 @@ internal class DocumentAttributes : IChecksummedObject, IObjectWritable
string
filePath
,
bool
isGenerated
)
{
if
(
id
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
id
));
}
if
(
name
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
name
));
}
Id
=
id
;
Name
=
name
;
Id
=
id
??
throw
new
ArgumentNullException
(
nameof
(
id
));
Name
=
name
??
throw
new
ArgumentNullException
(
nameof
(
name
));
Folders
=
folders
.
ToImmutableReadOnlyListOrEmpty
();
SourceCodeKind
=
sourceCodeKind
;
FilePath
=
filePath
;
...
...
src/Workspaces/Core/Portable/Workspace/Solution/ProjectInfo.cs
浏览文件 @
7a105a46
...
...
@@ -377,30 +377,10 @@ internal class ProjectAttributes : IChecksummedObject, IObjectWritable
bool
isSubmission
,
bool
hasAllInformation
)
{
if
(
id
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
id
));
}
if
(
name
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
name
));
}
if
(
language
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
language
));
}
if
(
assemblyName
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
assemblyName
));
}
Id
=
id
;
Name
=
name
;
Language
=
language
;
AssemblyName
=
assemblyName
;
Id
=
id
??
throw
new
ArgumentNullException
(
nameof
(
id
));
Name
=
name
??
throw
new
ArgumentNullException
(
nameof
(
name
));
Language
=
language
??
throw
new
ArgumentNullException
(
nameof
(
language
));
AssemblyName
=
assemblyName
??
throw
new
ArgumentNullException
(
nameof
(
assemblyName
));
Version
=
version
;
FilePath
=
filePath
;
...
...
src/Workspaces/Core/Portable/Workspace/Solution/SolutionInfo.cs
浏览文件 @
7a105a46
...
...
@@ -106,12 +106,7 @@ internal class SolutionAttributes : IChecksummedObject, IObjectWritable
public
SolutionAttributes
(
SolutionId
id
,
VersionStamp
version
,
string
filePath
)
{
if
(
id
==
null
)
{
throw
new
ArgumentNullException
(
nameof
(
id
));
}
Id
=
id
;
Id
=
id
??
throw
new
ArgumentNullException
(
nameof
(
id
));
Version
=
version
;
FilePath
=
filePath
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录