Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
51a6eda6
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,发现更多精彩内容 >>
提交
51a6eda6
编写于
2月 28, 2020
作者:
M
Manish Vasani
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/master' into ShareSyntaxFacts
上级
dd233ac3
0d63ed38
变更
51
隐藏空白更改
内联
并排
Showing
51 changed file
with
570 addition
and
107 deletion
+570
-107
eng/Version.Details.xml
eng/Version.Details.xml
+2
-2
eng/common/dotnet-install.sh
eng/common/dotnet-install.sh
+1
-1
eng/common/init-tools-native.sh
eng/common/init-tools-native.sh
+40
-9
global.json
global.json
+1
-1
src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
+1
-0
src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
+1
-0
src/Analyzers/Core/Analyzers/Analyzers.projitems
src/Analyzers/Core/Analyzers/Analyzers.projitems
+1
-0
src/Analyzers/Core/CodeFixes/CodeFixes.projitems
src/Analyzers/Core/CodeFixes/CodeFixes.projitems
+1
-0
src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems
...zers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems
+1
-0
src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems
...zers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems
+1
-0
src/Compilers/CSharp/Portable/CSharpResources.resx
src/Compilers/CSharp/Portable/CSharpResources.resx
+9
-0
src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs
src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs
+8
-1
src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
+4
-0
src/Compilers/CSharp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.cs
...harp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.cs
+42
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
+15
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf
+15
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf
+15
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf
+15
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf
+15
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf
+15
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf
+15
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf
+15
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf
+15
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf
+15
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf
src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf
+15
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf
...Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf
+15
-0
src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf
...Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf
+15
-0
src/Compilers/CSharp/Test/Emit/CodeGen/IndexAndRangeTests.cs
src/Compilers/CSharp/Test/Emit/CodeGen/IndexAndRangeTests.cs
+146
-0
src/Features/CSharp/Portable/ConflictMarkerResolution/CSharpResolveConflictMarkerCodeFixProvider.cs
...rResolution/CSharpResolveConflictMarkerCodeFixProvider.cs
+1
-1
src/Features/CSharp/Portable/ConvertAnonymousTypeToTuple/CSharpConvertAnonymousTypeToTupleDiagnosticAnalyzer.cs
...le/CSharpConvertAnonymousTypeToTupleDiagnosticAnalyzer.cs
+1
-1
src/Features/Core/Portable/ConflictMarkerResolution/AbstractConflictMarkerCodeFixProvider.cs
...MarkerResolution/AbstractConflictMarkerCodeFixProvider.cs
+2
-2
src/Features/Core/Portable/ConvertAnonymousTypeToTuple/AbstractConvertAnonymousTypeToTupleDiagnosticAnalyzer.cs
.../AbstractConvertAnonymousTypeToTupleDiagnosticAnalyzer.cs
+2
-2
src/Features/VisualBasic/Portable/ConflictMarkerResolution/VisualBasicResolveConflictMarkerCodeFixProvider.vb
...lution/VisualBasicResolveConflictMarkerCodeFixProvider.vb
+1
-1
src/Features/VisualBasic/Portable/ConvertAnonymousTypeToTuple/VisualBasicConvertAnonymousTypeToTupleDiagnosticAnalyzer.vb
...sualBasicConvertAnonymousTypeToTupleDiagnosticAnalyzer.vb
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems
...nsions/Compiler/CSharp/CSharpCompilerExtensions.projitems
+2
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs
...Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxKinds.cs
...Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxKinds.cs
+3
-3
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensions.projitems
...sAndExtensions/Compiler/Core/CompilerExtensions.projitems
+2
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/AbstractSyntaxFacts.cs
...Compiler/Core/Services/SyntaxFacts/AbstractSyntaxFacts.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs
...nsions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxKinds.cs
...nsions/Compiler/Core/Services/SyntaxFacts/ISyntaxKinds.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb
...isualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxKinds.vb
...isualBasic/Services/SyntaxFacts/VisualBasicSyntaxKinds.vb
+71
-71
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/VisualBasicCompilerExtensions.projitems
...piler/VisualBasic/VisualBasicCompilerExtensions.projitems
+2
-1
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems
...ions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems
+2
-0
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpSyntaxKindsServiceFactory.cs
...Sharp/LanguageServices/CSharpSyntaxKindsServiceFactory.cs
+6
-0
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/SyntaxFactsService/ISyntaxKindsService.cs
...anguageServices/SyntaxFactsService/ISyntaxKindsService.cs
+2
-2
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems
...ndExtensions/Workspace/Core/WorkspaceExtensions.projitems
+2
-0
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicSyntaxKindsServiceFactory.vb
.../LanguageServices/VisualBasicSyntaxKindsServiceFactory.vb
+8
-0
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/VisualBasicWorkspaceExtensions.projitems
...pace/VisualBasic/VisualBasicWorkspaceExtensions.projitems
+2
-0
src/Workspaces/VisualBasic/Portable/Microsoft.CodeAnalysis.VisualBasic.Workspaces.vbproj
...able/Microsoft.CodeAnalysis.VisualBasic.Workspaces.vbproj
+1
-1
未找到文件。
eng/Version.Details.xml
浏览文件 @
51a6eda6
...
...
@@ -3,9 +3,9 @@
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
<Dependency
Name=
"Microsoft.DotNet.Arcade.Sdk"
Version=
"5.0.0-beta.2012
6.7
"
>
<Dependency
Name=
"Microsoft.DotNet.Arcade.Sdk"
Version=
"5.0.0-beta.2012
7.9
"
>
<Uri>
https://github.com/dotnet/arcade
</Uri>
<Sha>
cd4164e1f3f7daf2a6f8dbd012210c93521bd82f
</Sha>
<Sha>
9c66925c608f3c0ee3e1f66c05943865b64590e1
</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
eng/common/dotnet-install.sh
浏览文件 @
51a6eda6
...
...
@@ -63,7 +63,7 @@ case $cpuname in
amd64|x86_64
)
buildarch
=
x64
;;
armv
7
l
)
armv
*
l
)
buildarch
=
arm
;;
i686
)
...
...
eng/common/init-tools-native.sh
浏览文件 @
51a6eda6
...
...
@@ -34,6 +34,14 @@ while (($# > 0)); do
force
=
true
shift
1
;;
--donotabortonfailure
)
donotabortonfailure
=
true
shift
1
;;
--donotdisplaywarnings
)
donotdisplaywarnings
=
true
shift
1
;;
--downloadretries
)
download_retries
=
$2
shift
2
...
...
@@ -52,6 +60,8 @@ while (($# > 0)); do
echo
" - (default) %USERPROFILE%/.netcoreeng/native"
echo
""
echo
" --clean Switch specifying not to install anything, but cleanup native asset folders"
echo
" --donotabortonfailure Switch specifiying whether to abort native tools installation on failure"
echo
" --donotdisplaywarnings Switch specifiying whether to display warnings during native tools installation on failure"
echo
" --force Clean and then install tools"
echo
" --help Print help and exit"
echo
""
...
...
@@ -92,6 +102,7 @@ if [[ -z $install_directory ]]; then
fi
install_bin="
${
native_base_dir
}
/bin
"
installed_any=false
ReadGlobalJsonNativeTools
...
...
@@ -103,8 +114,8 @@ else
for tool in "
${
!native_assets[@]
}
"
do
tool_version=
${
native_assets
[
$tool
]
}
installer_
name="
install
-
$tool
.sh
"
installer_command="
$
native_installer_dir
/
$installer_name
"
installer_
path="
$native_installer_dir
/
install-
$tool
.sh
"
installer_command="
$
installer_path
"
installer_command+="
--baseuri
$base_uri
"
installer_command+="
--installpath
$install_bin
"
installer_command+="
--version
$tool_version
"
...
...
@@ -118,11 +129,29 @@ else
installer_command+="
--clean
"
fi
$installer_command
if [[
$?
!= 0 ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "
Execution
Failed
"
exit 1
if [[ -a
$installer_path
]]; then
$installer_command
if [[
$?
!= 0 ]]; then
if [[
$donotabortonfailure
= true ]]; then
if [[
$donotdisplaywarnings
!= true ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "
Execution
Failed
"
fi
else
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "
Execution
Failed
"
exit 1
fi
else
$installed_any
= true
fi
else
if [[
$donotabortonfailure
== true ]]; then
if [[
$donotdisplaywarnings
!= true ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "
Execution
Failed
:
no install script
"
fi
else
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "
Execution
Failed
:
no install script
"
exit 1
fi
fi
done
fi
...
...
@@ -135,8 +164,10 @@ if [[ -d $install_bin ]]; then
echo "
Native
tools are available from
$install_bin
"
echo "
##vso[task.prependpath]
$install_bin
"
else
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "
Native
tools install directory does not exist, installation failed
"
exit 1
if [[
$installed_any
= true ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "
Native
tools install directory does not exist, installation failed
"
exit 1
fi
fi
exit 0
global.json
浏览文件 @
51a6eda6
...
...
@@ -7,6 +7,6 @@
"xcopy-msbuild"
:
"16.4.0-alpha"
},
"msbuild-sdks"
:
{
"Microsoft.DotNet.Arcade.Sdk"
:
"5.0.0-beta.2012
6.7
"
"Microsoft.DotNet.Arcade.Sdk"
:
"5.0.0-beta.2012
7.9
"
}
}
src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
浏览文件 @
51a6eda6
...
...
@@ -10,5 +10,6 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource
Include=
"$(MSBuildThisFileDirectory)CSharpAnalyzersResources.resx"
GenerateSource=
"true"
Link=
"CSharpAnalyzersResources.resx"
/>
<None
Include=
"$(MSBuildThisFileDirectory)CSharpAnalyzersResources.resx"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
浏览文件 @
51a6eda6
...
...
@@ -10,5 +10,6 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource
Include=
"$(MSBuildThisFileDirectory)CSharpCodeFixesResources.resx"
GenerateSource=
"true"
Link=
"CSharpCodeFixesResources.resx"
/>
<None
Include=
"$(MSBuildThisFileDirectory)CSharpCodeFixesResources.resx"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/Analyzers/Core/Analyzers/Analyzers.projitems
浏览文件 @
51a6eda6
...
...
@@ -10,6 +10,7 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource
Include=
"$(MSBuildThisFileDirectory)AnalyzersResources.resx"
GenerateSource=
"true"
Link=
"AnalyzersResources.resx"
/>
<None
Include=
"$(MSBuildThisFileDirectory)AnalyzersResources.resx"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"$(MSBuildThisFileDirectory)AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs"
/>
...
...
src/Analyzers/Core/CodeFixes/CodeFixes.projitems
浏览文件 @
51a6eda6
...
...
@@ -10,6 +10,7 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource
Include=
"$(MSBuildThisFileDirectory)CodeFixesResources.resx"
GenerateSource=
"true"
Link=
"CodeFixesResources.resx"
/>
<None
Include=
"$(MSBuildThisFileDirectory)CodeFixesResources.resx"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"$(MSBuildThisFileDirectory)PredefinedCodeFixProviderNames.cs"
/>
...
...
src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems
浏览文件 @
51a6eda6
...
...
@@ -10,5 +10,6 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource
Include=
"$(MSBuildThisFileDirectory)VisualBasicAnalyzersResources.resx"
GenerateSource=
"true"
Link=
"VisualBasicAnalyzersResources.resx"
/>
<None
Include=
"$(MSBuildThisFileDirectory)VisualBasicAnalyzersResources.resx"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems
浏览文件 @
51a6eda6
...
...
@@ -10,5 +10,6 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource
Include=
"$(MSBuildThisFileDirectory)VisualBasicCodeFixesResources.resx"
GenerateSource=
"true"
Link=
"VisualBasicCodeFixesResources.resx"
/>
<None
Include=
"$(MSBuildThisFileDirectory)VisualBasicCodeFixesResources.resx"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/Compilers/CSharp/Portable/CSharpResources.resx
浏览文件 @
51a6eda6
...
...
@@ -6007,4 +6007,13 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data
name=
"ERR_ImplicitRangeIndexerWithName"
xml:space=
"preserve"
>
<value>
Invocation of implicit Range Indexer cannot name the argument.
</value>
</data>
<data
name=
"ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer"
xml:space=
"preserve"
>
<value>
An expression tree may not contain a pattern System.Index or System.Range indexer access
</value>
</data>
<data
name=
"ERR_ExpressionTreeContainsFromEndIndexExpression"
xml:space=
"preserve"
>
<value>
An expression tree may not contain a from-end index ('^') expression.
</value>
</data>
<data
name=
"ERR_ExpressionTreeContainsRangeExpression"
xml:space=
"preserve"
>
<value>
An expression tree may not contain a range ('..') expression.
</value>
</data>
</root>
src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs
浏览文件 @
51a6eda6
...
...
@@ -2020,7 +2020,6 @@ private void EmitAssignmentExpression(BoundAssignmentOperator assignmentOperator
{
if
(
TryEmitAssignmentInPlace
(
assignmentOperator
,
useKind
!=
UseKind
.
Unused
))
{
Debug
.
Assert
(!
assignmentOperator
.
IsRef
);
return
;
}
...
...
@@ -2087,6 +2086,14 @@ private void EmitAssignmentExpression(BoundAssignmentOperator assignmentOperator
// i.e. target must not be on the heap and we should not be in a try block.
private
bool
TryEmitAssignmentInPlace
(
BoundAssignmentOperator
assignmentOperator
,
bool
used
)
{
// If the left hand is itself a ref, then we can't use in-place assignment
// because we need to spill the creation. This code can't be written in C#, but
// can be produced by lowering.
if
(
assignmentOperator
.
IsRef
)
{
return
false
;
}
var
left
=
assignmentOperator
.
Left
;
// if result is used, and lives on heap, we must keep RHS value on the stack.
...
...
src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
浏览文件 @
51a6eda6
...
...
@@ -1761,6 +1761,10 @@ internal enum ErrorCode
ERR_ConditionalOnLocalFunction
=
8783
,
ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer
=
8790
,
ERR_ExpressionTreeContainsFromEndIndexExpression
=
8791
,
ERR_ExpressionTreeContainsRangeExpression
=
8792
,
// Note: you will need to re-generate compiler code after adding warnings (eng\generate-compiler-code.cmd)
}
}
src/Compilers/CSharp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.cs
浏览文件 @
51a6eda6
...
...
@@ -79,6 +79,48 @@ public override BoundNode VisitArrayCreation(BoundArrayCreation node)
return
base
.
VisitArrayCreation
(
node
);
}
public
override
BoundNode
VisitArrayAccess
(
BoundArrayAccess
node
)
{
if
(
_inExpressionLambda
&&
node
.
Indices
.
Length
==
1
&&
node
.
Indices
[
0
].
Type
!.
SpecialType
==
SpecialType
.
None
)
{
Error
(
ErrorCode
.
ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer
,
node
);
}
return
base
.
VisitArrayAccess
(
node
);
}
public
override
BoundNode
VisitIndexOrRangePatternIndexerAccess
(
BoundIndexOrRangePatternIndexerAccess
node
)
{
if
(
_inExpressionLambda
)
{
Error
(
ErrorCode
.
ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer
,
node
);
}
return
base
.
VisitIndexOrRangePatternIndexerAccess
(
node
);
}
public
override
BoundNode
VisitFromEndIndexExpression
(
BoundFromEndIndexExpression
node
)
{
if
(
_inExpressionLambda
)
{
Error
(
ErrorCode
.
ERR_ExpressionTreeContainsFromEndIndexExpression
,
node
);
}
return
base
.
VisitFromEndIndexExpression
(
node
);
}
public
override
BoundNode
VisitRangeExpression
(
BoundRangeExpression
node
)
{
if
(
_inExpressionLambda
)
{
Error
(
ErrorCode
.
ERR_ExpressionTreeContainsRangeExpression
,
node
);
}
return
base
.
VisitRangeExpression
(
node
);
}
public
override
BoundNode
VisitSizeOfOperator
(
BoundSizeOfOperator
node
)
{
if
(
_inExpressionLambda
&&
node
.
ConstantValue
==
null
)
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target state="translated">Strom výrazu nemůže obsahovat hodnotu struktury REF ani zakázaný typ {0}.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsFromEndIndexExpression">
<source>An expression tree may not contain a from-end index ('^') expression.</source>
<target state="new">An expression tree may not contain a from-end index ('^') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer">
<source>An expression tree may not contain a pattern System.Index or System.Range indexer access</source>
<target state="new">An expression tree may not contain a pattern System.Index or System.Range indexer access</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsRangeExpression">
<source>An expression tree may not contain a range ('..') expression.</source>
<target state="new">An expression tree may not contain a range ('..') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsSwitchExpression">
<source>An expression tree may not contain a switch expression.</source>
<target state="translated">Strom výrazů nesmí obsahovat výraz switch.</target>
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target state="translated">Eine Ausdrucksstruktur darf keinen Wert vom Typ "ref struct" oder vom eingeschränkten Typ "{0}" enthalten.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsFromEndIndexExpression">
<source>An expression tree may not contain a from-end index ('^') expression.</source>
<target state="new">An expression tree may not contain a from-end index ('^') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer">
<source>An expression tree may not contain a pattern System.Index or System.Range indexer access</source>
<target state="new">An expression tree may not contain a pattern System.Index or System.Range indexer access</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsRangeExpression">
<source>An expression tree may not contain a range ('..') expression.</source>
<target state="new">An expression tree may not contain a range ('..') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsSwitchExpression">
<source>An expression tree may not contain a switch expression.</source>
<target state="translated">Eine Ausdrucksstruktur darf keinen switch-Ausdruck enthalten.</target>
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target state="translated">Un árbol de expresión no puede contener un valor de estructura ref ni el tipo restringido “{0}”.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsFromEndIndexExpression">
<source>An expression tree may not contain a from-end index ('^') expression.</source>
<target state="new">An expression tree may not contain a from-end index ('^') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer">
<source>An expression tree may not contain a pattern System.Index or System.Range indexer access</source>
<target state="new">An expression tree may not contain a pattern System.Index or System.Range indexer access</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsRangeExpression">
<source>An expression tree may not contain a range ('..') expression.</source>
<target state="new">An expression tree may not contain a range ('..') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsSwitchExpression">
<source>An expression tree may not contain a switch expression.</source>
<target state="translated">Un árbol de expresión no puede contener una expresión switch.</target>
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target state="translated">Une arborescence de l'expression ne peut pas contenir de valeur de struct par référence ou de type restreint '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsFromEndIndexExpression">
<source>An expression tree may not contain a from-end index ('^') expression.</source>
<target state="new">An expression tree may not contain a from-end index ('^') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer">
<source>An expression tree may not contain a pattern System.Index or System.Range indexer access</source>
<target state="new">An expression tree may not contain a pattern System.Index or System.Range indexer access</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsRangeExpression">
<source>An expression tree may not contain a range ('..') expression.</source>
<target state="new">An expression tree may not contain a range ('..') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsSwitchExpression">
<source>An expression tree may not contain a switch expression.</source>
<target state="translated">Une arborescence de l'expression ne peut pas contenir d'expression switch.</target>
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target state="translated">L'albero delle espressioni non può contenere il valore '{0}' per lo struct ref o il tipo limitato.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsFromEndIndexExpression">
<source>An expression tree may not contain a from-end index ('^') expression.</source>
<target state="new">An expression tree may not contain a from-end index ('^') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer">
<source>An expression tree may not contain a pattern System.Index or System.Range indexer access</source>
<target state="new">An expression tree may not contain a pattern System.Index or System.Range indexer access</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsRangeExpression">
<source>An expression tree may not contain a range ('..') expression.</source>
<target state="new">An expression tree may not contain a range ('..') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsSwitchExpression">
<source>An expression tree may not contain a switch expression.</source>
<target state="translated">Un albero delle espressioni non può contenere un'espressione switch.</target>
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target state="translated">式ツリーに ref 構造体または制限がある型 '{0}' の値を含めることはできません。</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsFromEndIndexExpression">
<source>An expression tree may not contain a from-end index ('^') expression.</source>
<target state="new">An expression tree may not contain a from-end index ('^') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer">
<source>An expression tree may not contain a pattern System.Index or System.Range indexer access</source>
<target state="new">An expression tree may not contain a pattern System.Index or System.Range indexer access</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsRangeExpression">
<source>An expression tree may not contain a range ('..') expression.</source>
<target state="new">An expression tree may not contain a range ('..') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsSwitchExpression">
<source>An expression tree may not contain a switch expression.</source>
<target state="translated">式ツリーに switch 式を含めることはできません。</target>
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target state="translated">식 트리에는 ref struct 값 또는 제한된 형식 '{0}'을(를) 사용할 수 없습니다.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsFromEndIndexExpression">
<source>An expression tree may not contain a from-end index ('^') expression.</source>
<target state="new">An expression tree may not contain a from-end index ('^') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer">
<source>An expression tree may not contain a pattern System.Index or System.Range indexer access</source>
<target state="new">An expression tree may not contain a pattern System.Index or System.Range indexer access</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsRangeExpression">
<source>An expression tree may not contain a range ('..') expression.</source>
<target state="new">An expression tree may not contain a range ('..') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsSwitchExpression">
<source>An expression tree may not contain a switch expression.</source>
<target state="translated">식 트리에는 switch 식이 포함될 수 없습니다.</target>
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target state="translated">Drzewo wyrażeń nie może zawierać wartości elementu ref struct ani typu ograniczonego „{0}”.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsFromEndIndexExpression">
<source>An expression tree may not contain a from-end index ('^') expression.</source>
<target state="new">An expression tree may not contain a from-end index ('^') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer">
<source>An expression tree may not contain a pattern System.Index or System.Range indexer access</source>
<target state="new">An expression tree may not contain a pattern System.Index or System.Range indexer access</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsRangeExpression">
<source>An expression tree may not contain a range ('..') expression.</source>
<target state="new">An expression tree may not contain a range ('..') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsSwitchExpression">
<source>An expression tree may not contain a switch expression.</source>
<target state="translated">Drzewo wyrażeń nie może zawierać wyrażenia switch.</target>
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target state="translated">A árvore de expressão não pode conter um valor de struct de referência ou o tipo restrito '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsFromEndIndexExpression">
<source>An expression tree may not contain a from-end index ('^') expression.</source>
<target state="new">An expression tree may not contain a from-end index ('^') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer">
<source>An expression tree may not contain a pattern System.Index or System.Range indexer access</source>
<target state="new">An expression tree may not contain a pattern System.Index or System.Range indexer access</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsRangeExpression">
<source>An expression tree may not contain a range ('..') expression.</source>
<target state="new">An expression tree may not contain a range ('..') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsSwitchExpression">
<source>An expression tree may not contain a switch expression.</source>
<target state="translated">Uma árvore de expressão não pode conter uma expressão switch.</target>
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target state="translated">Дерево выражений не может содержать значение ref struct или ограниченный тип "{0}".</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsFromEndIndexExpression">
<source>An expression tree may not contain a from-end index ('^') expression.</source>
<target state="new">An expression tree may not contain a from-end index ('^') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer">
<source>An expression tree may not contain a pattern System.Index or System.Range indexer access</source>
<target state="new">An expression tree may not contain a pattern System.Index or System.Range indexer access</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsRangeExpression">
<source>An expression tree may not contain a range ('..') expression.</source>
<target state="new">An expression tree may not contain a range ('..') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsSwitchExpression">
<source>An expression tree may not contain a switch expression.</source>
<target state="translated">Дерево выражений не может содержать выражение switch.</target>
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target state="translated">İfade ağacı, ref yapısında veya kısıtlanmış '{0}' türünde değer içeremez.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsFromEndIndexExpression">
<source>An expression tree may not contain a from-end index ('^') expression.</source>
<target state="new">An expression tree may not contain a from-end index ('^') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer">
<source>An expression tree may not contain a pattern System.Index or System.Range indexer access</source>
<target state="new">An expression tree may not contain a pattern System.Index or System.Range indexer access</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsRangeExpression">
<source>An expression tree may not contain a range ('..') expression.</source>
<target state="new">An expression tree may not contain a range ('..') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsSwitchExpression">
<source>An expression tree may not contain a switch expression.</source>
<target state="translated">İfade ağacı, switch ifadesi içeremez.</target>
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target
state=
"translated"
>
表达式树不能包含 ref 结构或受限类型“{0}”的值。
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"ERR_ExpressionTreeContainsFromEndIndexExpression"
>
<source>
An expression tree may not contain a from-end index ('^') expression.
</source>
<target
state=
"new"
>
An expression tree may not contain a from-end index ('^') expression.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer"
>
<source>
An expression tree may not contain a pattern System.Index or System.Range indexer access
</source>
<target
state=
"new"
>
An expression tree may not contain a pattern System.Index or System.Range indexer access
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"ERR_ExpressionTreeContainsRangeExpression"
>
<source>
An expression tree may not contain a range ('..') expression.
</source>
<target
state=
"new"
>
An expression tree may not contain a range ('..') expression.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"ERR_ExpressionTreeContainsSwitchExpression"
>
<source>
An expression tree may not contain a switch expression.
</source>
<target
state=
"translated"
>
表达式树不能包含 switch 表达式。
</target>
...
...
src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf
浏览文件 @
51a6eda6
...
...
@@ -177,6 +177,21 @@
<target state="translated">運算式樹狀架構不可包含 ref 結構或限制型別 '{0}' 的值。</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsFromEndIndexExpression">
<source>An expression tree may not contain a from-end index ('^') expression.</source>
<target state="new">An expression tree may not contain a from-end index ('^') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer">
<source>An expression tree may not contain a pattern System.Index or System.Range indexer access</source>
<target state="new">An expression tree may not contain a pattern System.Index or System.Range indexer access</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsRangeExpression">
<source>An expression tree may not contain a range ('..') expression.</source>
<target state="new">An expression tree may not contain a range ('..') expression.</target>
<note />
</trans-unit>
<trans-unit id="ERR_ExpressionTreeContainsSwitchExpression">
<source>An expression tree may not contain a switch expression.</source>
<target state="translated">運算式樹狀結構不可包含 switch 運算式。</target>
...
...
src/Compilers/CSharp/Test/Emit/CodeGen/IndexAndRangeTests.cs
浏览文件 @
51a6eda6
...
...
@@ -40,6 +40,76 @@ private static void VerifyIndexCall(IMethodSymbol symbol, string methodName, str
Assert
.
Equal
(
containingTypeName
,
symbol
.
ContainingType
.
Name
);
}
[
Fact
]
public
void
ExpressionTreePatternIndexAndRange
()
{
var
src
=
@"
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
struct S
{
public int Length => 0;
public S Slice(int start, int length) => default;
}
class Program
{
static void Main()
{
Expression<Func<int[], int>> e = (int[] a) => a[new Index(0, true)]; // 1
Expression<Func<List<int>, int>> e2 = (List<int> a) => a[new Index(0, true)]; // 2
Expression<Func<int[], int[]>> e3 = (int[] a) => a[new Range(0, 1)]; // 3
Expression<Func<S, S>> e4 = (S s) => s[new Range(0, 1)]; // 4
}
}"
;
var
comp
=
CreateCompilationWithIndexAndRange
(
new
[]
{
src
,
TestSources
.
GetSubArray
,
});
comp
.
VerifyEmitDiagnostics
(
// (16,55): error CS8790: An expression tree may not contain a pattern System.Index or System.Range indexer access
// Expression<Func<int[], int>> e = (int[] a) => a[new Index(0, true)]; // 1
Diagnostic
(
ErrorCode
.
ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer
,
"a[new Index(0, true)]"
).
WithLocation
(
16
,
55
),
// (17,64): error CS8790: An expression tree may not contain a pattern System.Index or System.Range indexer access
// Expression<Func<List<int>, int>> e2 = (List<int> a) => a[new Index(0, true)]; // 2
Diagnostic
(
ErrorCode
.
ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer
,
"a[new Index(0, true)]"
).
WithLocation
(
17
,
64
),
// (19,58): error CS8790: An expression tree may not contain a pattern System.Index or System.Range indexer access
// Expression<Func<int[], int[]>> e3 = (int[] a) => a[new Range(0, 1)]; // 3
Diagnostic
(
ErrorCode
.
ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer
,
"a[new Range(0, 1)]"
).
WithLocation
(
19
,
58
),
// (20,46): error CS8790: An expression tree may not contain a pattern System.Index or System.Range indexer access
// Expression<Func<S, S>> e4 = (S s) => s[new Range(0, 1)]; // 4
Diagnostic
(
ErrorCode
.
ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer
,
"s[new Range(0, 1)]"
).
WithLocation
(
20
,
46
)
);
}
[
Fact
]
public
void
ExpressionTreeFromEndIndexAndRange
()
{
var
src
=
@"
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
class Program
{
static void Main()
{
Expression<Func<Index>> e = () => ^1;
Expression<Func<Range>> e2 = () => 1..2;
}
}"
;
var
comp
=
CreateCompilationWithIndexAndRange
(
src
);
comp
.
VerifyEmitDiagnostics
(
// (10,43): error CS8791: An expression tree may not contain a from-end index ('^') expression.
// Expression<Func<Index>> e = () => ^1;
Diagnostic
(
ErrorCode
.
ERR_ExpressionTreeContainsFromEndIndexExpression
,
"^1"
).
WithLocation
(
10
,
43
),
// (11,44): error CS8792: An expression tree may not contain a range ('..') expression.
// Expression<Func<Range>> e2 = () => 1..2;
Diagnostic
(
ErrorCode
.
ERR_ExpressionTreeContainsRangeExpression
,
"1..2"
).
WithLocation
(
11
,
44
)
);
}
[
Fact
]
public
void
PatternIndexArray
()
{
...
...
@@ -1660,6 +1730,82 @@ .maxstack 3
}"
);
}
[
Fact
,
WorkItem
(
40776
,
"https://github.com/dotnet/roslyn/issues/40776"
)]
public
void
FakeIndexIndexerOnDefaultStruct
()
{
var
verifier
=
CompileAndVerifyWithIndexAndRange
(
@"
using System;
struct NotASpan
{
public int Length => 1;
public int this[int index] => 0;
}
class C
{
static int Repro() => default(NotASpan)[^0];
static void Main() => Repro();
}"
);
verifier
.
VerifyIL
(
"C.Repro"
,
@"
{
// Code size 25 (0x19)
.maxstack 3
.locals init (int V_0,
NotASpan V_1)
IL_0000: ldloca.s V_1
IL_0002: dup
IL_0003: initobj ""NotASpan""
IL_0009: dup
IL_000a: call ""int NotASpan.Length.get""
IL_000f: ldc.i4.0
IL_0010: sub
IL_0011: stloc.0
IL_0012: ldloc.0
IL_0013: call ""int NotASpan.this[int].get""
IL_0018: ret
}"
);
}
[
Fact
,
WorkItem
(
40776
,
"https://github.com/dotnet/roslyn/issues/40776"
)]
public
void
FakeIndexIndexerOnStructConstructor
()
{
var
comp
=
CreateCompilationWithIndexAndRangeAndSpan
(
@"
using System;
class C
{
static byte Repro() => new Span<byte>(new byte[] { })[^1];
}"
);
var
verifier
=
CompileAndVerify
(
comp
);
verifier
.
VerifyIL
(
"C.Repro"
,
@"
{
// Code size 31 (0x1f)
.maxstack 3
.locals init (int V_0,
System.Span<byte> V_1)
IL_0000: ldc.i4.0
IL_0001: newarr ""byte""
IL_0006: newobj ""System.Span<byte>..ctor(byte[])""
IL_000b: stloc.1
IL_000c: ldloca.s V_1
IL_000e: dup
IL_000f: call ""int System.Span<byte>.Length.get""
IL_0014: ldc.i4.1
IL_0015: sub
IL_0016: stloc.0
IL_0017: ldloc.0
IL_0018: call ""ref byte System.Span<byte>.this[int].get""
IL_001d: ldind.u1
IL_001e: ret
}"
);
}
[
Fact
]
public
void
FakeRangeIndexerStringOpenEnd
()
{
...
...
src/Features/CSharp/Portable/ConflictMarkerResolution/CSharpResolveConflictMarkerCodeFixProvider.cs
浏览文件 @
51a6eda6
...
...
@@ -17,7 +17,7 @@ internal class CSharpResolveConflictMarkerCodeFixProvider : AbstractResolveConfl
[
ImportingConstructor
]
public
CSharpResolveConflictMarkerCodeFixProvider
()
:
base
(
CSharpSyntaxKinds
Service
.
Instance
,
CS8300
)
:
base
(
CSharpSyntaxKinds
.
Instance
,
CS8300
)
{
}
}
...
...
src/Features/CSharp/Portable/ConvertAnonymousTypeToTuple/CSharpConvertAnonymousTypeToTupleDiagnosticAnalyzer.cs
浏览文件 @
51a6eda6
...
...
@@ -17,7 +17,7 @@ internal class CSharpConvertAnonymousTypeToTupleDiagnosticAnalyzer
AnonymousObjectCreationExpressionSyntax
>
{
public
CSharpConvertAnonymousTypeToTupleDiagnosticAnalyzer
()
:
base
(
CSharpSyntaxKinds
Service
.
Instance
)
:
base
(
CSharpSyntaxKinds
.
Instance
)
{
}
...
...
src/Features/Core/Portable/ConflictMarkerResolution/AbstractConflictMarkerCodeFixProvider.cs
浏览文件 @
51a6eda6
...
...
@@ -20,10 +20,10 @@ internal abstract class AbstractResolveConflictMarkerCodeFixProvider : CodeFixPr
{
private
static
readonly
int
s_mergeConflictLength
=
"<<<<<<<"
.
Length
;
private
readonly
ISyntaxKinds
Service
_syntaxKinds
;
private
readonly
ISyntaxKinds
_syntaxKinds
;
protected
AbstractResolveConflictMarkerCodeFixProvider
(
ISyntaxKinds
Service
syntaxKinds
,
string
diagnosticId
)
ISyntaxKinds
syntaxKinds
,
string
diagnosticId
)
{
FixableDiagnosticIds
=
ImmutableArray
.
Create
(
diagnosticId
);
_syntaxKinds
=
syntaxKinds
;
...
...
src/Features/Core/Portable/ConvertAnonymousTypeToTuple/AbstractConvertAnonymousTypeToTupleDiagnosticAnalyzer.cs
浏览文件 @
51a6eda6
...
...
@@ -17,9 +17,9 @@ internal abstract class AbstractConvertAnonymousTypeToTupleDiagnosticAnalyzer<
where
TSyntaxKind
:
struct
where
TAnonymousObjectCreationExpressionSyntax
:
SyntaxNode
{
private
readonly
ISyntaxKinds
Service
_syntaxKinds
;
private
readonly
ISyntaxKinds
_syntaxKinds
;
protected
AbstractConvertAnonymousTypeToTupleDiagnosticAnalyzer
(
ISyntaxKinds
Service
syntaxKinds
)
protected
AbstractConvertAnonymousTypeToTupleDiagnosticAnalyzer
(
ISyntaxKinds
syntaxKinds
)
:
base
(
IDEDiagnosticIds
.
ConvertAnonymousTypeToTupleDiagnosticId
,
option
:
null
,
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Convert_to_tuple
),
FeaturesResources
.
ResourceManager
,
typeof
(
FeaturesResources
)),
...
...
src/Features/VisualBasic/Portable/ConflictMarkerResolution/VisualBasicResolveConflictMarkerCodeFixProvider.vb
浏览文件 @
51a6eda6
...
...
@@ -15,7 +15,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ConflictMarkerResolution
<
ImportingConstructor
>
Public
Sub
New
()
MyBase
.
New
(
VisualBasicSyntaxKinds
Service
.
Instance
,
BC37284
)
MyBase
.
New
(
VisualBasicSyntaxKinds
.
Instance
,
BC37284
)
End
Sub
End
Class
End
Namespace
src/Features/VisualBasic/Portable/ConvertAnonymousTypeToTuple/VisualBasicConvertAnonymousTypeToTupleDiagnosticAnalyzer.vb
浏览文件 @
51a6eda6
...
...
@@ -13,7 +13,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ConvertAnonymousTypeToTuple
SyntaxKind
,
AnonymousObjectCreationExpressionSyntax
)
Public
Sub
New
()
MyBase
.
New
(
VisualBasicSyntaxKinds
Service
.
Instance
)
MyBase
.
New
(
VisualBasicSyntaxKinds
.
Instance
)
End
Sub
Protected
Overrides
Function
GetInitializerCount
(
anonymousType
As
AnonymousObjectCreationExpressionSyntax
)
As
Integer
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems
浏览文件 @
51a6eda6
...
...
@@ -71,9 +71,9 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)Formatting\Rules\TokenBasedFormattingRule.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Formatting\Rules\WrappingFormattingRule.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\CSharpSyntaxKinds.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\CSharpDocumentationCommentService.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\CSharpSyntaxFacts.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\CSharpSyntaxKindsService.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Utilities\FormattingRangeHelper.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Utilities\TypeStyle\CSharpTypeStyleHelper.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs"
/>
...
...
@@ -82,5 +82,6 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource
Include=
"$(MSBuildThisFileDirectory)CSharpCompilerExtensionsResources.resx"
GenerateSource=
"true"
Link=
"CSharpCompilerExtensionsResources.resx"
/>
<None
Include=
"$(MSBuildThisFileDirectory)CSharpCompilerExtensionsResources.resx"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs
浏览文件 @
51a6eda6
...
...
@@ -38,7 +38,7 @@ public SyntaxTrivia ElasticMarker
public
SyntaxTrivia
ElasticCarriageReturnLineFeed
=>
SyntaxFactory
.
ElasticCarriageReturnLineFeed
;
public
override
ISyntaxKinds
Service
SyntaxKinds
{
get
;
}
=
CSharpSyntaxKindsService
.
Instance
;
public
override
ISyntaxKinds
SyntaxKinds
{
get
;
}
=
CSharpSyntaxKinds
.
Instance
;
protected
override
IDocumentationCommentService
DocumentationCommentService
=>
CSharpDocumentationCommentService
.
Instance
;
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxKinds
Service
.cs
→
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxKinds.cs
浏览文件 @
51a6eda6
...
...
@@ -6,11 +6,11 @@
namespace
Microsoft.CodeAnalysis.CSharp
{
internal
sealed
class
CSharpSyntaxKindsService
:
ISyntaxKindsService
internal
class
CSharpSyntaxKinds
:
ISyntaxKinds
{
public
static
readonly
CSharpSyntaxKinds
Service
Instance
=
new
CSharpSyntaxKindsService
();
public
static
readonly
CSharpSyntaxKinds
Instance
=
new
CSharpSyntaxKinds
();
pr
ivate
CSharpSyntaxKindsService
()
pr
otected
CSharpSyntaxKinds
()
{
}
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensions.projitems
浏览文件 @
51a6eda6
...
...
@@ -276,7 +276,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\IDocumentationCommentService.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\ISyntaxFacts.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\ISyntaxFactsExtensions.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\ISyntaxKinds
Service
.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\ISyntaxKinds.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Simplification\AliasAnnotation.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Simplification\DoNotAddImportsAnnotation.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Simplification\DoNotAllowVarAnnotation.cs"
/>
...
...
@@ -404,5 +404,6 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource
Include=
"$(MSBuildThisFileDirectory)CompilerExtensionsResources.resx"
GenerateSource=
"true"
Link=
"CompilerExtensionsResources.resx"
/>
<None
Include=
"$(MSBuildThisFileDirectory)CompilerExtensionsResources.resx"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/AbstractSyntaxFacts.cs
浏览文件 @
51a6eda6
...
...
@@ -22,7 +22,7 @@ internal abstract class AbstractSyntaxFacts
private
readonly
static
ObjectPool
<
Stack
<(
SyntaxNodeOrToken
nodeOrToken
,
bool
leading
,
bool
trailing
)>>
s_stackPool
=
SharedPools
.
Default
<
Stack
<(
SyntaxNodeOrToken
nodeOrToken
,
bool
leading
,
bool
trailing
)>>();
public
abstract
ISyntaxKinds
Service
SyntaxKinds
{
get
;
}
public
abstract
ISyntaxKinds
SyntaxKinds
{
get
;
}
// Matches the following:
//
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs
浏览文件 @
51a6eda6
...
...
@@ -19,7 +19,7 @@ internal partial interface ISyntaxFacts
SyntaxTrivia
ElasticMarker
{
get
;
}
SyntaxTrivia
ElasticCarriageReturnLineFeed
{
get
;
}
ISyntaxKinds
Service
SyntaxKinds
{
get
;
}
ISyntaxKinds
SyntaxKinds
{
get
;
}
bool
SupportsIndexingInitializer
(
ParseOptions
options
);
bool
SupportsThrowExpression
(
ParseOptions
options
);
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxKinds
Service
.cs
→
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxKinds.cs
浏览文件 @
51a6eda6
...
...
@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis
/// Provides a uniform view of SyntaxKinds over C# and VB for constructs they have
/// in common.
/// </summary>
internal
partial
interface
ISyntaxKindsService
internal
interface
ISyntaxKinds
{
TSyntaxKind
Convert
<
TSyntaxKind
>(
int
kind
)
where
TSyntaxKind
:
struct
;
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb
浏览文件 @
51a6eda6
...
...
@@ -46,7 +46,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End
Get
End
Property
Public
Overrides
ReadOnly
Property
SyntaxKinds
As
ISyntaxKinds
Service
=
VisualBasicSyntaxKindsService
.
Instance
Implements
ISyntaxFacts
.
SyntaxKinds
Public
Overrides
ReadOnly
Property
SyntaxKinds
As
ISyntaxKinds
=
VisualBasicSyntaxKinds
.
Instance
Implements
ISyntaxFacts
.
SyntaxKinds
Protected
Overrides
ReadOnly
Property
DocumentationCommentService
As
IDocumentationCommentService
Get
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxKinds
Service
.vb
→
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxKinds.vb
浏览文件 @
51a6eda6
...
...
@@ -3,84 +3,84 @@
' See the LICENSE file in the project root for more information.
Namespace
Microsoft.CodeAnalysis.VisualBasic
Friend
NotInheritable
Class
VisualBasicSyntaxKindsService
Implements
ISyntaxKinds
Service
Friend
Class
VisualBasicSyntaxKinds
Implements
ISyntaxKinds
Public
Shared
ReadOnly
Instance
As
New
VisualBasicSyntaxKinds
Service
()
Public
Shared
ReadOnly
Instance
As
New
VisualBasicSyntaxKinds
()
Pr
ivate
Sub
New
()
Pr
otected
Sub
New
()
End
Sub
Public
Function
Convert
(
Of
TSyntaxKind
As
Structure
)(
kind
As
Integer
)
As
TSyntaxKind
Implements
ISyntaxKinds
Service
.
Convert
Public
Function
Convert
(
Of
TSyntaxKind
As
Structure
)(
kind
As
Integer
)
As
TSyntaxKind
Implements
ISyntaxKinds
.
Convert
' Boxing/Unboxing casts from Object to TSyntaxKind will be erased by jit.
Return
CType
(
CType
(
CType
(
kind
,
SyntaxKind
),
Object
),
TSyntaxKind
)
End
Function
Public
ReadOnly
Property
ConflictMarkerTrivia
As
Integer
=
SyntaxKind
.
ConflictMarkerTrivia
Implements
ISyntaxKinds
Service
.
ConflictMarkerTrivia
Public
ReadOnly
Property
DisabledTextTrivia
As
Integer
=
SyntaxKind
.
DisabledTextTrivia
Implements
ISyntaxKinds
Service
.
DisabledTextTrivia
Public
ReadOnly
Property
EndOfLineTrivia
As
Integer
=
SyntaxKind
.
EndOfLineTrivia
Implements
ISyntaxKinds
Service
.
EndOfLineTrivia
Public
ReadOnly
Property
SkippedTokensTrivia
As
Integer
=
SyntaxKind
.
SkippedTokensTrivia
Implements
ISyntaxKinds
Service
.
SkippedTokensTrivia
Public
ReadOnly
Property
WhitespaceTrivia
As
Integer
=
SyntaxKind
.
WhitespaceTrivia
Implements
ISyntaxKinds
Service
.
WhitespaceTrivia
Public
ReadOnly
Property
CharacterLiteralToken
As
Integer
=
SyntaxKind
.
CharacterLiteralToken
Implements
ISyntaxKinds
Service
.
CharacterLiteralToken
Public
ReadOnly
Property
DotToken
As
Integer
=
SyntaxKind
.
DotToken
Implements
ISyntaxKinds
Service
.
DotToken
Public
ReadOnly
Property
InterpolatedStringTextToken
As
Integer
=
SyntaxKind
.
InterpolatedStringTextToken
Implements
ISyntaxKinds
Service
.
InterpolatedStringTextToken
Public
ReadOnly
Property
QuestionToken
As
Integer
=
SyntaxKind
.
QuestionToken
Implements
ISyntaxKinds
Service
.
QuestionToken
Public
ReadOnly
Property
StringLiteralToken
As
Integer
=
SyntaxKind
.
StringLiteralToken
Implements
ISyntaxKinds
Service
.
StringLiteralToken
Public
ReadOnly
Property
IfKeyword
As
Integer
=
SyntaxKind
.
IfKeyword
Implements
ISyntaxKinds
Service
.
IfKeyword
Public
ReadOnly
Property
GenericName
As
Integer
=
SyntaxKind
.
GenericName
Implements
ISyntaxKinds
Service
.
GenericName
Public
ReadOnly
Property
IdentifierName
As
Integer
=
SyntaxKind
.
IdentifierName
Implements
ISyntaxKinds
Service
.
IdentifierName
Public
ReadOnly
Property
QualifiedName
As
Integer
=
SyntaxKind
.
QualifiedName
Implements
ISyntaxKinds
Service
.
QualifiedName
Public
ReadOnly
Property
TupleType
As
Integer
=
SyntaxKind
.
TupleType
Implements
ISyntaxKinds
Service
.
TupleType
Public
ReadOnly
Property
CharacterLiteralExpression
As
Integer
=
SyntaxKind
.
CharacterLiteralExpression
Implements
ISyntaxKinds
Service
.
CharacterLiteralExpression
Public
ReadOnly
Property
DefaultLiteralExpression
As
Integer
=
SyntaxKind
.
NothingLiteralExpression
Implements
ISyntaxKinds
Service
.
DefaultLiteralExpression
Public
ReadOnly
Property
FalseLiteralExpression
As
Integer
=
SyntaxKind
.
FalseLiteralExpression
Implements
ISyntaxKinds
Service
.
FalseLiteralExpression
Public
ReadOnly
Property
NullLiteralExpression
As
Integer
=
SyntaxKind
.
NothingLiteralExpression
Implements
ISyntaxKinds
Service
.
NullLiteralExpression
Public
ReadOnly
Property
StringLiteralExpression
As
Integer
=
SyntaxKind
.
StringLiteralExpression
Implements
ISyntaxKinds
Service
.
StringLiteralExpression
Public
ReadOnly
Property
TrueLiteralExpression
As
Integer
=
SyntaxKind
.
TrueLiteralExpression
Implements
ISyntaxKinds
Service
.
TrueLiteralExpression
Public
ReadOnly
Property
AnonymousObjectCreationExpression
As
Integer
=
SyntaxKind
.
AnonymousObjectCreationExpression
Implements
ISyntaxKinds
Service
.
AnonymousObjectCreationExpression
Public
ReadOnly
Property
AwaitExpression
As
Integer
=
SyntaxKind
.
AwaitExpression
Implements
ISyntaxKinds
Service
.
AwaitExpression
Public
ReadOnly
Property
BaseExpression
As
Integer
=
SyntaxKind
.
MyBaseExpression
Implements
ISyntaxKinds
Service
.
BaseExpression
Public
ReadOnly
Property
ConditionalAccessExpression
As
Integer
=
SyntaxKind
.
ConditionalAccessExpression
Implements
ISyntaxKinds
Service
.
ConditionalAccessExpression
Public
ReadOnly
Property
InvocationExpression
As
Integer
=
SyntaxKind
.
InvocationExpression
Implements
ISyntaxKinds
Service
.
InvocationExpression
Public
ReadOnly
Property
LogicalAndExpression
As
Integer
=
SyntaxKind
.
AndAlsoExpression
Implements
ISyntaxKinds
Service
.
LogicalAndExpression
Public
ReadOnly
Property
LogicalOrExpression
As
Integer
=
SyntaxKind
.
OrElseExpression
Implements
ISyntaxKinds
Service
.
LogicalOrExpression
Public
ReadOnly
Property
LogicalNotExpression
As
Integer
=
SyntaxKind
.
NotExpression
Implements
ISyntaxKinds
Service
.
LogicalNotExpression
Public
ReadOnly
Property
ObjectCreationExpression
As
Integer
=
SyntaxKind
.
ObjectCreationExpression
Implements
ISyntaxKinds
Service
.
ObjectCreationExpression
Public
ReadOnly
Property
ParenthesizedExpression
As
Integer
=
SyntaxKind
.
ParenthesizedExpression
Implements
ISyntaxKinds
Service
.
ParenthesizedExpression
Public
ReadOnly
Property
QueryExpression
As
Integer
=
SyntaxKind
.
QueryExpression
Implements
ISyntaxKinds
Service
.
QueryExpression
Public
ReadOnly
Property
ReferenceEqualsExpression
As
Integer
=
SyntaxKind
.
IsExpression
Implements
ISyntaxKinds
Service
.
ReferenceEqualsExpression
Public
ReadOnly
Property
ReferenceNotEqualsExpression
As
Integer
=
SyntaxKind
.
IsNotExpression
Implements
ISyntaxKinds
Service
.
ReferenceNotEqualsExpression
Public
ReadOnly
Property
SimpleMemberAccessExpression
As
Integer
=
SyntaxKind
.
SimpleMemberAccessExpression
Implements
ISyntaxKinds
Service
.
SimpleMemberAccessExpression
Public
ReadOnly
Property
TernaryConditionalExpression
As
Integer
=
SyntaxKind
.
TernaryConditionalExpression
Implements
ISyntaxKinds
Service
.
TernaryConditionalExpression
Public
ReadOnly
Property
ThisExpression
As
Integer
=
SyntaxKind
.
MeExpression
Implements
ISyntaxKinds
Service
.
ThisExpression
Public
ReadOnly
Property
TupleExpression
As
Integer
=
SyntaxKind
.
TupleExpression
Implements
ISyntaxKinds
Service
.
TupleExpression
Public
ReadOnly
Property
EndOfFileToken
As
Integer
=
SyntaxKind
.
EndOfFileToken
Implements
ISyntaxKinds
Service
.
EndOfFileToken
Public
ReadOnly
Property
AwaitKeyword
As
Integer
=
SyntaxKind
.
AwaitKeyword
Implements
ISyntaxKinds
Service
.
AwaitKeyword
Public
ReadOnly
Property
IdentifierToken
As
Integer
=
SyntaxKind
.
IdentifierToken
Implements
ISyntaxKinds
Service
.
IdentifierToken
Public
ReadOnly
Property
GlobalKeyword
As
Integer
=
SyntaxKind
.
GlobalKeyword
Implements
ISyntaxKinds
Service
.
GlobalKeyword
Public
ReadOnly
Property
IncompleteMember
As
Integer
=
SyntaxKind
.
IncompleteMember
Implements
ISyntaxKinds
Service
.
IncompleteMember
Public
ReadOnly
Property
HashToken
As
Integer
=
SyntaxKind
.
HashToken
Implements
ISyntaxKinds
Service
.
HashToken
Public
ReadOnly
Property
ExpressionStatement
As
Integer
=
SyntaxKind
.
ExpressionStatement
Implements
ISyntaxKinds
Service
.
ExpressionStatement
Public
ReadOnly
Property
ForEachStatement
As
Integer
=
SyntaxKind
.
ForEachStatement
Implements
ISyntaxKinds
Service
.
ForEachStatement
Public
ReadOnly
Property
LocalDeclarationStatement
As
Integer
=
SyntaxKind
.
LocalDeclarationStatement
Implements
ISyntaxKinds
Service
.
LocalDeclarationStatement
Public
ReadOnly
Property
LockStatement
As
Integer
=
SyntaxKind
.
SyncLockStatement
Implements
ISyntaxKinds
Service
.
LockStatement
Public
ReadOnly
Property
ReturnStatement
As
Integer
=
SyntaxKind
.
ReturnStatement
Implements
ISyntaxKinds
Service
.
ReturnStatement
Public
ReadOnly
Property
UsingStatement
As
Integer
=
SyntaxKind
.
UsingStatement
Implements
ISyntaxKinds
Service
.
UsingStatement
Public
ReadOnly
Property
Attribute
As
Integer
=
SyntaxKind
.
Attribute
Implements
ISyntaxKinds
Service
.
Attribute
Public
ReadOnly
Property
Parameter
As
Integer
=
SyntaxKind
.
Parameter
Implements
ISyntaxKinds
Service
.
Parameter
Public
ReadOnly
Property
TypeConstraint
As
Integer
=
SyntaxKind
.
TypeConstraint
Implements
ISyntaxKinds
Service
.
TypeConstraint
Public
ReadOnly
Property
VariableDeclarator
As
Integer
=
SyntaxKind
.
VariableDeclarator
Implements
ISyntaxKinds
Service
.
VariableDeclarator
Public
ReadOnly
Property
TypeArgumentList
As
Integer
=
SyntaxKind
.
TypeArgumentList
Implements
ISyntaxKinds
Service
.
TypeArgumentList
Public
ReadOnly
Property
ConflictMarkerTrivia
As
Integer
=
SyntaxKind
.
ConflictMarkerTrivia
Implements
ISyntaxKinds
.
ConflictMarkerTrivia
Public
ReadOnly
Property
DisabledTextTrivia
As
Integer
=
SyntaxKind
.
DisabledTextTrivia
Implements
ISyntaxKinds
.
DisabledTextTrivia
Public
ReadOnly
Property
EndOfLineTrivia
As
Integer
=
SyntaxKind
.
EndOfLineTrivia
Implements
ISyntaxKinds
.
EndOfLineTrivia
Public
ReadOnly
Property
SkippedTokensTrivia
As
Integer
=
SyntaxKind
.
SkippedTokensTrivia
Implements
ISyntaxKinds
.
SkippedTokensTrivia
Public
ReadOnly
Property
WhitespaceTrivia
As
Integer
=
SyntaxKind
.
WhitespaceTrivia
Implements
ISyntaxKinds
.
WhitespaceTrivia
Public
ReadOnly
Property
CharacterLiteralToken
As
Integer
=
SyntaxKind
.
CharacterLiteralToken
Implements
ISyntaxKinds
.
CharacterLiteralToken
Public
ReadOnly
Property
DotToken
As
Integer
=
SyntaxKind
.
DotToken
Implements
ISyntaxKinds
.
DotToken
Public
ReadOnly
Property
InterpolatedStringTextToken
As
Integer
=
SyntaxKind
.
InterpolatedStringTextToken
Implements
ISyntaxKinds
.
InterpolatedStringTextToken
Public
ReadOnly
Property
QuestionToken
As
Integer
=
SyntaxKind
.
QuestionToken
Implements
ISyntaxKinds
.
QuestionToken
Public
ReadOnly
Property
StringLiteralToken
As
Integer
=
SyntaxKind
.
StringLiteralToken
Implements
ISyntaxKinds
.
StringLiteralToken
Public
ReadOnly
Property
IfKeyword
As
Integer
=
SyntaxKind
.
IfKeyword
Implements
ISyntaxKinds
.
IfKeyword
Public
ReadOnly
Property
GenericName
As
Integer
=
SyntaxKind
.
GenericName
Implements
ISyntaxKinds
.
GenericName
Public
ReadOnly
Property
IdentifierName
As
Integer
=
SyntaxKind
.
IdentifierName
Implements
ISyntaxKinds
.
IdentifierName
Public
ReadOnly
Property
QualifiedName
As
Integer
=
SyntaxKind
.
QualifiedName
Implements
ISyntaxKinds
.
QualifiedName
Public
ReadOnly
Property
TupleType
As
Integer
=
SyntaxKind
.
TupleType
Implements
ISyntaxKinds
.
TupleType
Public
ReadOnly
Property
CharacterLiteralExpression
As
Integer
=
SyntaxKind
.
CharacterLiteralExpression
Implements
ISyntaxKinds
.
CharacterLiteralExpression
Public
ReadOnly
Property
DefaultLiteralExpression
As
Integer
=
SyntaxKind
.
NothingLiteralExpression
Implements
ISyntaxKinds
.
DefaultLiteralExpression
Public
ReadOnly
Property
FalseLiteralExpression
As
Integer
=
SyntaxKind
.
FalseLiteralExpression
Implements
ISyntaxKinds
.
FalseLiteralExpression
Public
ReadOnly
Property
NullLiteralExpression
As
Integer
=
SyntaxKind
.
NothingLiteralExpression
Implements
ISyntaxKinds
.
NullLiteralExpression
Public
ReadOnly
Property
StringLiteralExpression
As
Integer
=
SyntaxKind
.
StringLiteralExpression
Implements
ISyntaxKinds
.
StringLiteralExpression
Public
ReadOnly
Property
TrueLiteralExpression
As
Integer
=
SyntaxKind
.
TrueLiteralExpression
Implements
ISyntaxKinds
.
TrueLiteralExpression
Public
ReadOnly
Property
AnonymousObjectCreationExpression
As
Integer
=
SyntaxKind
.
AnonymousObjectCreationExpression
Implements
ISyntaxKinds
.
AnonymousObjectCreationExpression
Public
ReadOnly
Property
AwaitExpression
As
Integer
=
SyntaxKind
.
AwaitExpression
Implements
ISyntaxKinds
.
AwaitExpression
Public
ReadOnly
Property
BaseExpression
As
Integer
=
SyntaxKind
.
MyBaseExpression
Implements
ISyntaxKinds
.
BaseExpression
Public
ReadOnly
Property
ConditionalAccessExpression
As
Integer
=
SyntaxKind
.
ConditionalAccessExpression
Implements
ISyntaxKinds
.
ConditionalAccessExpression
Public
ReadOnly
Property
InvocationExpression
As
Integer
=
SyntaxKind
.
InvocationExpression
Implements
ISyntaxKinds
.
InvocationExpression
Public
ReadOnly
Property
LogicalAndExpression
As
Integer
=
SyntaxKind
.
AndAlsoExpression
Implements
ISyntaxKinds
.
LogicalAndExpression
Public
ReadOnly
Property
LogicalOrExpression
As
Integer
=
SyntaxKind
.
OrElseExpression
Implements
ISyntaxKinds
.
LogicalOrExpression
Public
ReadOnly
Property
LogicalNotExpression
As
Integer
=
SyntaxKind
.
NotExpression
Implements
ISyntaxKinds
.
LogicalNotExpression
Public
ReadOnly
Property
ObjectCreationExpression
As
Integer
=
SyntaxKind
.
ObjectCreationExpression
Implements
ISyntaxKinds
.
ObjectCreationExpression
Public
ReadOnly
Property
ParenthesizedExpression
As
Integer
=
SyntaxKind
.
ParenthesizedExpression
Implements
ISyntaxKinds
.
ParenthesizedExpression
Public
ReadOnly
Property
QueryExpression
As
Integer
=
SyntaxKind
.
QueryExpression
Implements
ISyntaxKinds
.
QueryExpression
Public
ReadOnly
Property
ReferenceEqualsExpression
As
Integer
=
SyntaxKind
.
IsExpression
Implements
ISyntaxKinds
.
ReferenceEqualsExpression
Public
ReadOnly
Property
ReferenceNotEqualsExpression
As
Integer
=
SyntaxKind
.
IsNotExpression
Implements
ISyntaxKinds
.
ReferenceNotEqualsExpression
Public
ReadOnly
Property
SimpleMemberAccessExpression
As
Integer
=
SyntaxKind
.
SimpleMemberAccessExpression
Implements
ISyntaxKinds
.
SimpleMemberAccessExpression
Public
ReadOnly
Property
TernaryConditionalExpression
As
Integer
=
SyntaxKind
.
TernaryConditionalExpression
Implements
ISyntaxKinds
.
TernaryConditionalExpression
Public
ReadOnly
Property
ThisExpression
As
Integer
=
SyntaxKind
.
MeExpression
Implements
ISyntaxKinds
.
ThisExpression
Public
ReadOnly
Property
TupleExpression
As
Integer
=
SyntaxKind
.
TupleExpression
Implements
ISyntaxKinds
.
TupleExpression
Public
ReadOnly
Property
EndOfFileToken
As
Integer
=
SyntaxKind
.
EndOfFileToken
Implements
ISyntaxKinds
.
EndOfFileToken
Public
ReadOnly
Property
AwaitKeyword
As
Integer
=
SyntaxKind
.
AwaitKeyword
Implements
ISyntaxKinds
.
AwaitKeyword
Public
ReadOnly
Property
IdentifierToken
As
Integer
=
SyntaxKind
.
IdentifierToken
Implements
ISyntaxKinds
.
IdentifierToken
Public
ReadOnly
Property
GlobalKeyword
As
Integer
=
SyntaxKind
.
GlobalKeyword
Implements
ISyntaxKinds
.
GlobalKeyword
Public
ReadOnly
Property
IncompleteMember
As
Integer
=
SyntaxKind
.
IncompleteMember
Implements
ISyntaxKinds
.
IncompleteMember
Public
ReadOnly
Property
HashToken
As
Integer
=
SyntaxKind
.
HashToken
Implements
ISyntaxKinds
.
HashToken
Public
ReadOnly
Property
ExpressionStatement
As
Integer
=
SyntaxKind
.
ExpressionStatement
Implements
ISyntaxKinds
.
ExpressionStatement
Public
ReadOnly
Property
ForEachStatement
As
Integer
=
SyntaxKind
.
ForEachStatement
Implements
ISyntaxKinds
.
ForEachStatement
Public
ReadOnly
Property
LocalDeclarationStatement
As
Integer
=
SyntaxKind
.
LocalDeclarationStatement
Implements
ISyntaxKinds
.
LocalDeclarationStatement
Public
ReadOnly
Property
LockStatement
As
Integer
=
SyntaxKind
.
SyncLockStatement
Implements
ISyntaxKinds
.
LockStatement
Public
ReadOnly
Property
ReturnStatement
As
Integer
=
SyntaxKind
.
ReturnStatement
Implements
ISyntaxKinds
.
ReturnStatement
Public
ReadOnly
Property
UsingStatement
As
Integer
=
SyntaxKind
.
UsingStatement
Implements
ISyntaxKinds
.
UsingStatement
Public
ReadOnly
Property
Attribute
As
Integer
=
SyntaxKind
.
Attribute
Implements
ISyntaxKinds
.
Attribute
Public
ReadOnly
Property
Parameter
As
Integer
=
SyntaxKind
.
Parameter
Implements
ISyntaxKinds
.
Parameter
Public
ReadOnly
Property
TypeConstraint
As
Integer
=
SyntaxKind
.
TypeConstraint
Implements
ISyntaxKinds
.
TypeConstraint
Public
ReadOnly
Property
VariableDeclarator
As
Integer
=
SyntaxKind
.
VariableDeclarator
Implements
ISyntaxKinds
.
VariableDeclarator
Public
ReadOnly
Property
TypeArgumentList
As
Integer
=
SyntaxKind
.
TypeArgumentList
Implements
ISyntaxKinds
.
TypeArgumentList
End
Class
End
Namespace
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/VisualBasicCompilerExtensions.projitems
浏览文件 @
51a6eda6
...
...
@@ -22,11 +22,12 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\VisualBasicDocumentationCommentService.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\VisualBasicSyntaxFacts.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\VisualBasicSyntaxKindsService.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Utilities\DirectiveSyntaxEqualityComparer.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Utilities\DirectiveWalker.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Services\SyntaxFacts\VisualBasicSyntaxKinds.vb"
/>
</ItemGroup>
<ItemGroup>
<EmbeddedResource
Include=
"$(MSBuildThisFileDirectory)VisualBasicCompilerExtensionsResources.resx"
GenerateSource=
"true"
Link=
"VisualBasicCompilerExtensionsResources.resx"
/>
<None
Include=
"$(MSBuildThisFileDirectory)VisualBasicCompilerExtensionsResources.resx"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems
浏览文件 @
51a6eda6
...
...
@@ -51,6 +51,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\CSharpSymbolDeclarationService.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\CSharpSyntaxFactsService.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\CSharpSyntaxFactsServiceFactory.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\CSharpSyntaxKindsServiceFactory.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\CSharpTypeInferenceService.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\CSharpGeneratedCodeRecognitionService.cs"
/>
...
...
@@ -70,5 +71,6 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource
Include=
"$(MSBuildThisFileDirectory)CSharpWorkspaceExtensionsResources.resx"
GenerateSource=
"true"
Link=
"CSharpWorkspaceExtensionsResources.resx"
/>
<None
Include=
"$(MSBuildThisFileDirectory)CSharpWorkspaceExtensionsResources.resx"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/Workspaces/
CSharp/Portable/LanguageServices/SyntaxFact
s/CSharpSyntaxKindsServiceFactory.cs
→
src/Workspaces/
SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageService
s/CSharpSyntaxKindsServiceFactory.cs
浏览文件 @
51a6eda6
...
...
@@ -5,6 +5,7 @@
using
System.Composition
;
using
Microsoft.CodeAnalysis.Host
;
using
Microsoft.CodeAnalysis.Host.Mef
;
using
Microsoft.CodeAnalysis.LanguageServices
;
namespace
Microsoft.CodeAnalysis.CSharp
{
...
...
@@ -13,5 +14,10 @@ internal class CSharpSyntaxKindsServiceFactory : ILanguageServiceFactory
{
public
ILanguageService
CreateLanguageService
(
HostLanguageServices
languageServices
)
=>
CSharpSyntaxKindsService
.
Instance
;
private
sealed
class
CSharpSyntaxKindsService
:
CSharpSyntaxKinds
,
ISyntaxKindsService
{
public
static
readonly
new
CSharpSyntaxKindsService
Instance
=
new
CSharpSyntaxKindsService
();
}
}
}
src/Workspaces/
Core/Portable/LanguageServices/SyntaxFacts/ISyntaxKindsService_Language
Service.cs
→
src/Workspaces/
SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/SyntaxFactsService/ISyntaxKinds
Service.cs
浏览文件 @
51a6eda6
...
...
@@ -6,13 +6,13 @@
using
Microsoft.CodeAnalysis.Host
;
namespace
Microsoft.CodeAnalysis
namespace
Microsoft.CodeAnalysis
.LanguageServices
{
/// <summary>
/// Provides a uniform view of SyntaxKinds over C# and VB for constructs they have
/// in common.
/// </summary>
internal
partial
interface
ISyntaxKindsService
:
ILanguageService
internal
partial
interface
ISyntaxKindsService
:
I
SyntaxKinds
,
I
LanguageService
{
}
}
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems
浏览文件 @
51a6eda6
...
...
@@ -34,6 +34,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\Precedence\PrecedenceKind.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\RemoveUnnecessaryImports\IRemoveUnnecessaryImportsService.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\SyntaxFactsService\ISyntaxKindsService.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\TypeInferenceService\ITypeInferenceService.cs"
/>
...
...
@@ -77,5 +78,6 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource
Include=
"$(MSBuildThisFileDirectory)WorkspaceExtensionsResources.resx"
GenerateSource=
"true"
Link=
"WorkspaceExtensionsResources.resx"
/>
<None
Include=
"$(MSBuildThisFileDirectory)WorkspaceExtensionsResources.resx"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/Workspaces/
VisualBasic/Portable/LanguageServices/SyntaxFact
s/VisualBasicSyntaxKindsServiceFactory.vb
→
src/Workspaces/
SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageService
s/VisualBasicSyntaxKindsServiceFactory.vb
浏览文件 @
51a6eda6
...
...
@@ -5,6 +5,7 @@
Imports
System.Composition
Imports
Microsoft.CodeAnalysis.Host
Imports
Microsoft.CodeAnalysis.Host.Mef
Imports
Microsoft.CodeAnalysis.LanguageServices
Namespace
Microsoft.CodeAnalysis.VisualBasic
<
ExportLanguageServiceFactory
(
GetType
(
ISyntaxKindsService
),
LanguageNames
.
VisualBasic
),
[
Shared
]
>
...
...
@@ -14,5 +15,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Public
Function
CreateLanguageService
(
languageServices
As
HostLanguageServices
)
As
ILanguageService
Implements
ILanguageServiceFactory
.
CreateLanguageService
Return
VisualBasicSyntaxKindsService
.
Instance
End
Function
Private
NotInheritable
Class
VisualBasicSyntaxKindsService
Inherits
VisualBasicSyntaxKinds
Implements
ISyntaxKindsService
Public
Shared
Shadows
ReadOnly
Instance
As
New
VisualBasicSyntaxKindsService
End
Class
End
Class
End
Namespace
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/VisualBasicWorkspaceExtensions.projitems
浏览文件 @
51a6eda6
...
...
@@ -52,6 +52,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\VisualBasicSymbolDeclarationService.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\VisualBasicSyntaxFactsService.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\VisualBasicSyntaxFactsServiceFactory.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\VisualBasicSyntaxKindsServiceFactory.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)LanguageServices\VisualBasicTypeInferenceService.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Utilities\VisualBasicSimplificationHelpers.vb"
/>
...
...
@@ -78,5 +79,6 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource
Include=
"$(MSBuildThisFileDirectory)VisualBasicWorkspaceExtensionsResources.resx"
GenerateSource=
"true"
Link=
"VisualBasicWorkspaceExtensionsResources.resx"
/>
<None
Include=
"$(MSBuildThisFileDirectory)VisualBasicWorkspaceExtensionsResources.resx"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/Workspaces/VisualBasic/Portable/Microsoft.CodeAnalysis.VisualBasic.Workspaces.vbproj
浏览文件 @
51a6eda6
...
...
@@ -41,7 +41,7 @@
<InternalsVisibleTo
Include=
"Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities"
/>
</ItemGroup>
<ItemGroup>
<EmbeddedResource
Update=
"VBWorkspaceResources.resx"
GenerateSource=
"true"
NAmespace=
"Microsoft.CodeAnalysis.VisualBasic"
/>
<EmbeddedResource
Update=
"VBWorkspaceResources.resx"
GenerateSource=
"true"
NAmespace=
"Microsoft.CodeAnalysis.VisualBasic"
/>
</ItemGroup>
<ItemGroup>
<Folder
Include=
"Workspace\LanguageServices\"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录