Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
50e27eba
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,发现更多精彩内容 >>
提交
50e27eba
编写于
6月 14, 2015
作者:
T
Tanner Gooding
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3493 from tannergooding/master
[Automated] Merge 'stabilization' into 'master'
上级
0e0f64bb
b3c9b558
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
511 addition
and
33 deletion
+511
-33
cibuild.cmd
cibuild.cmd
+9
-8
src/Compilers/CSharp/Portable/Binder/Binder_Statements.cs
src/Compilers/CSharp/Portable/Binder/Binder_Statements.cs
+1
-1
src/Compilers/CSharp/Portable/Symbols/ReferenceManager.cs
src/Compilers/CSharp/Portable/Symbols/ReferenceManager.cs
+4
-0
src/Compilers/CSharp/Test/Semantic/Semantics/SemanticErrorTests.cs
...lers/CSharp/Test/Semantic/Semantics/SemanticErrorTests.cs
+30
-0
src/Compilers/CSharp/Test/Symbol/Compilation/ReferenceManagerTests.cs
...s/CSharp/Test/Symbol/Compilation/ReferenceManagerTests.cs
+28
-0
src/Compilers/Core/Portable/MetadataReference/AssemblyIdentityComparer.cs
...re/Portable/MetadataReference/AssemblyIdentityComparer.cs
+1
-0
src/Compilers/Core/Portable/ReferenceManager/AssemblyData.cs
src/Compilers/Core/Portable/ReferenceManager/AssemblyData.cs
+6
-0
src/Compilers/Core/Portable/ReferenceManager/AssemblyDataForAssemblyBeingBuilt.cs
...ble/ReferenceManager/AssemblyDataForAssemblyBeingBuilt.cs
+2
-0
src/Compilers/Core/Portable/ReferenceManager/CommonReferenceManager.Resolution.cs
...ble/ReferenceManager/CommonReferenceManager.Resolution.cs
+27
-0
src/Compilers/Test/Resources/Core/CompilerTestResources.vbproj
...ompilers/Test/Resources/Core/CompilerTestResources.vbproj
+2
-0
src/Compilers/Test/Resources/Core/WinRt/MakeWinMds.cmd
src/Compilers/Test/Resources/Core/WinRt/MakeWinMds.cmd
+1
-0
src/Compilers/Test/Resources/Core/WinRt/WImpl.il
src/Compilers/Test/Resources/Core/WinRt/WImpl.il
+24
-0
src/Compilers/Test/Resources/Core/WinRt/WImpl.winmd
src/Compilers/Test/Resources/Core/WinRt/WImpl.winmd
+0
-0
src/Compilers/Test/Resources/Core/WinRt/WinRt.Designer.vb
src/Compilers/Test/Resources/Core/WinRt/WinRt.Designer.vb
+11
-1
src/Compilers/Test/Resources/Core/WinRt/WinRt.resx
src/Compilers/Test/Resources/Core/WinRt/WinRt.resx
+3
-0
src/Compilers/VisualBasic/Portable/Compilation/SyntaxTreeSemanticModel.vb
...sualBasic/Portable/Compilation/SyntaxTreeSemanticModel.vb
+7
-7
src/Compilers/VisualBasic/Portable/Symbols/ReferenceManager.vb
...ompilers/VisualBasic/Portable/Symbols/ReferenceManager.vb
+12
-0
src/Compilers/VisualBasic/Portable/Symbols/Source/SourceMemberMethodSymbol.vb
...Basic/Portable/Symbols/Source/SourceMemberMethodSymbol.vb
+12
-0
src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/Source/EventTests.vb
...VisualBasic/Test/Symbol/SymbolsTests/Source/EventTests.vb
+109
-0
src/EditorFeatures/Test2/NavigationBar/VisualBasicNavigationBarTests.vb
...ures/Test2/NavigationBar/VisualBasicNavigationBarTests.vb
+201
-0
src/EditorFeatures/VisualBasic/NavigationBar/VisualBasicNavigationBarItemService.vb
...asic/NavigationBar/VisualBasicNavigationBarItemService.vb
+18
-14
src/Samples/CSharp/AsyncPackage/AsyncPackage.csproj
src/Samples/CSharp/AsyncPackage/AsyncPackage.csproj
+1
-1
src/VisualStudio/Core/Def/Implementation/ProjectSystem/AbstractProject.cs
.../Core/Def/Implementation/ProjectSystem/AbstractProject.cs
+2
-1
未找到文件。
cibuild.cmd
浏览文件 @
50e27eba
...
...
@@ -16,9 +16,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd
REM Build the compiler so we can self host it for the full build
src
\.nuget\NuGet.exe
restore
%RoslynRoot%
/src/Toolset
.sln
-packagesdirectory
packages
msbuild
/nologo /v
:m
/m
%RoslynRoot%
/src/Compilers/Core/VBCSCompiler/VBCSCompiler
.csproj
/p
:Configuration
=
%BuildConfiguration%
msbuild
/nologo /v
:m
/m
%RoslynRoot%
/src/Compilers/CSharp/csc
2
/csc
2
.csproj
/p
:Configuration
=
%BuildConfiguration%
msbuild
/nologo /v
:m
/m
%RoslynRoot%
/src/Compilers/VisualBasic/vbc
2
/vbc
2
.csproj
/p
:Configuration
=
%BuildConfiguration%
msbuild
/nologo /v
:m
/m
%RoslynRoot%
/src/Toolset
.sln
/p
:Configuration
=
%BuildConfiguration%
mkdir
%RoslynRoot%
\Binaries\Bootstrap
move
Binaries
\
%BuildConfiguration%
\
*
%RoslynRoot%
\Binaries\Bootstrap
...
...
@@ -32,6 +30,13 @@ if ERRORLEVEL 1 (
exit
/b
1
)
msbuild
/v
:m
/m /p
:BootstrapBuildPath
=
%RoslynRoot%
\Binaries\Bootstrap
src
/Samples/Samples
.sln
/p
:CIBuild
=
true
/p
:Configuration
=
%BuildConfiguration%
if
ERRORLEVEL
1
(
taskkill
/F /IM
vbcscompiler
.exe
echo
Build
failed
exit
/b
1
)
REM Kill any instances of VBCSCompiler.exe to release locked files;
REM otherwise future CI runs may fail while trying to delete those files.
taskkill
/F /IM
vbcscompiler
.exe
...
...
@@ -44,8 +49,4 @@ exit /b 0
@echo
Usage
:
cibuild
.cmd
[
/debug
^|
/release
]
@echo
/debug
Perform
debug
build
.
This
is
the
default
.
@echo
/release
Perform
release
build
<<<<<<<
HEAD
@goto
:eof
=======
@goto
:eof
>>>>>>>
origin
/stabilization
@goto
:eof
\ No newline at end of file
src/Compilers/CSharp/Portable/Binder/Binder_Statements.cs
浏览文件 @
50e27eba
...
...
@@ -346,7 +346,7 @@ private BoundLabeledStatement BindLabeled(LabeledStatementSyntax node, Diagnosti
// result.Symbols can be empty in some malformed code, e.g. when a labeled statement is used an embedded statement in an if or foreach statement
// In this case we create new label symbol on the fly, and an error is reported by parser
var
symbol
=
result
.
Symbols
.
Count
!=
0
?
var
symbol
=
result
.
Symbols
.
Count
>
0
&&
result
.
IsMultiViable
?
(
LabelSymbol
)
result
.
Symbols
.
First
()
:
new
SourceLabelSymbol
((
MethodSymbol
)
ContainingMemberOrLambda
,
node
.
Identifier
);
...
...
src/Compilers/CSharp/Portable/Symbols/ReferenceManager.cs
浏览文件 @
50e27eba
...
...
@@ -1027,6 +1027,8 @@ public override bool DeclaresTheObjectClass
return
_assembly
.
DeclaresTheObjectClass
;
}
}
public
override
Compilation
SourceCompilation
=>
null
;
}
private
sealed
class
AssemblyDataForCompilation
:
AssemblyDataForMetadataOrCompilation
...
...
@@ -1130,6 +1132,8 @@ public override bool DeclaresTheObjectClass
return
_compilation
.
DeclaresTheObjectClass
;
}
}
public
override
Compilation
SourceCompilation
=>
_compilation
;
}
/// <summary>
...
...
src/Compilers/CSharp/Test/Semantic/Semantics/SemanticErrorTests.cs
浏览文件 @
50e27eba
...
...
@@ -22455,5 +22455,35 @@ static void Main()
Diagnostic(ErrorCode.ERR_IllegalStatement, "x?.ToString()[1]").WithLocation(10, 9)
);
}
[Fact]
[WorkItem(1179322, "DevDiv")]
public void LabelSameNameAsParameter()
{
var text = @"
class Program
{
static object M(object obj, object value)
{
if (((string)obj).Length == 0) value: new Program();
}
}
";
var compilation = CreateCompilationWithMscorlib(text);
compilation.GetParseDiagnostics().Verify(
// (6,41): error CS1023: Embedded statement cannot be a declaration or labeled statement
// if (((string)obj).Length == 0) value: new Program();
Diagnostic(ErrorCode.ERR_BadEmbeddedStmt, "value: new Program();").WithLocation(6, 41));
// Make sure the compiler can handle producing method body diagnostics for this pattern when
// queriied via an API (command line compile would exit after parse errors were reported).
compilation.GetMethodBodyDiagnostics().Verify(
// (6,41): warning CS0164: This label has not been referenced
// if (((string)obj).Length == 0) value: new Program();
Diagnostic(ErrorCode.WRN_UnreferencedLabel, "value").WithLocation(6, 41),
// (4,19): error CS0161: 'Program.M(object, object)': not all code paths return a value
// static object M(object obj, object value)
Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("Program.M(object, object)").WithLocation(4, 19));
}
}
}
src/Compilers/CSharp/Test/Symbol/Compilation/ReferenceManagerTests.cs
浏览文件 @
50e27eba
...
...
@@ -23,6 +23,34 @@ public class ReferenceManagerTests : CSharpTestBase
WithCryptoKeyFile
(
SigningTestHelpers
.
KeyPairFile
).
WithStrongNameProvider
(
new
SigningTestHelpers
.
VirtualizedStrongNameProvider
(
ImmutableArray
.
Create
<
string
>()));
[
ClrOnlyFact
(
ClrOnlyReason
.
Signing
)]
public
void
WinRtCompilationReferences
()
{
var
ifaceDef
=
CreateCompilationWithMscorlib
(
@"
public interface ITest
{
}"
,
options
:
TestOptions
.
DebugWinMD
,
assemblyName
:
"ITest"
);
ifaceDef
.
VerifyDiagnostics
();
var
ifaceImageRef
=
ifaceDef
.
EmitToImageReference
();
var
wimpl
=
AssemblyMetadata
.
CreateFromImage
(
TestResources
.
WinRt
.
WImpl
).
GetReference
(
display
:
"WImpl"
);
var
implDef2
=
CreateCompilationWithMscorlib
(
@"
public class C
{
public static void Main()
{
ITest test = new WImpl();
}
}"
,
references
:
new
MetadataReference
[]
{
ifaceDef
.
ToMetadataReference
(),
wimpl
},
options
:
TestOptions
.
DebugExe
);
implDef2
.
VerifyDiagnostics
();
}
[
ClrOnlyFact
(
ClrOnlyReason
.
Signing
)]
public
void
VersionUnification_SymbolUsed
()
{
...
...
src/Compilers/Core/Portable/MetadataReference/AssemblyIdentityComparer.cs
浏览文件 @
50e27eba
...
...
@@ -218,3 +218,4 @@ internal virtual bool ApplyUnificationPolicies(ref AssemblyIdentity reference, r
}
}
}
src/Compilers/Core/Portable/ReferenceManager/AssemblyData.cs
浏览文件 @
50e27eba
...
...
@@ -57,6 +57,12 @@ internal abstract class AssemblyData
public
abstract
bool
IsLinked
{
get
;
}
public
abstract
bool
DeclaresTheObjectClass
{
get
;
}
/// <summary>
/// Get the source compilation backing this assembly, if one exists.
/// Returns null otherwise.
/// </summary>
public
abstract
Compilation
SourceCompilation
{
get
;
}
}
}
}
src/Compilers/Core/Portable/ReferenceManager/AssemblyDataForAssemblyBeingBuilt.cs
浏览文件 @
50e27eba
...
...
@@ -144,6 +144,8 @@ public override bool DeclaresTheObjectClass
return
false
;
}
}
public
override
Compilation
SourceCompilation
=>
null
;
}
}
}
src/Compilers/Core/Portable/ReferenceManager/CommonReferenceManager.Resolution.cs
浏览文件 @
50e27eba
...
...
@@ -10,6 +10,7 @@
namespace
Microsoft.CodeAnalysis
{
using
System.Reflection
;
using
MetadataOrDiagnostic
=
System
.
Object
;
/// <summary>
...
...
@@ -850,6 +851,32 @@ private static PortableExecutableReference ResolveReferenceDirective(string refe
}
}
// In the IDE it is possible the reference we're looking for is a
// compilation reference to a source assembly. However, if the reference
// is of ContentType WindowsRuntime then the compilation will never
// match since all C#/VB WindowsRuntime compilations output .winmdobjs,
// not .winmds, and the ContentType of a .winmdobj is Default.
// If this is the case, we want to ignore the ContentType mismatch and
// allow the compilation to match the reference.
if
(
reference
.
ContentType
==
AssemblyContentType
.
WindowsRuntime
)
{
for
(
int
i
=
definitionOffset
;
i
<
definitions
.
Length
;
i
++)
{
var
definition
=
definitions
[
i
].
Identity
;
var
sourceCompilation
=
definitions
[
i
].
SourceCompilation
;
if
(
definition
.
ContentType
==
AssemblyContentType
.
Default
&&
sourceCompilation
?.
Options
.
OutputKind
==
OutputKind
.
WindowsRuntimeMetadata
&&
AssemblyIdentityComparer
.
SimpleNameComparer
.
Equals
(
reference
.
Name
,
definition
.
Name
)
&&
reference
.
Version
.
Equals
(
definition
.
Version
)
&&
reference
.
IsRetargetable
==
definition
.
IsRetargetable
&&
AssemblyIdentityComparer
.
CultureComparer
.
Equals
(
reference
.
CultureName
,
definition
.
CultureName
)
&&
AssemblyIdentity
.
KeysEqual
(
reference
,
definition
))
{
return
new
AssemblyReferenceBinding
(
reference
,
i
);
}
}
}
// As in the native compiler (see IMPORTER::MapAssemblyRefToAid), we compare against the
// compilation (i.e. source) assembly as a last resort. We follow the native approach of
// skipping the public key comparison since we have yet to compute it.
...
...
src/Compilers/Test/Resources/Core/CompilerTestResources.vbproj
浏览文件 @
50e27eba
...
...
@@ -401,6 +401,8 @@
<None
Include=
"packages.config"
/>
<None
Include=
"SymbolsTests\netModule\hash_module.cs"
/>
<None
Include=
"SymbolsTests\NoPia\MissingPIAAttributes.dll"
/>
<None
Include=
"WinRt\WImpl.il"
/>
<None
Include=
"WinRt\WImpl.winmd"
/>
</ItemGroup>
<ItemGroup>
<EmbeddedResource
Include=
"Analyzers\AnalyzerTests.resx"
>
...
...
src/Compilers/Test/Resources/Core/WinRt/MakeWinMds.cmd
浏览文件 @
50e27eba
...
...
@@ -5,3 +5,4 @@ ilasm W1.il /mdv="WindowsRuntime 1.2" /msv:1.1 /dll /out=W1.winmd
ilasm
W2
.il
/mdv
=
"WindowsRuntime 1.2"
/msv
:1.1
/dll /out
=
W2
.winmd
ilasm
WB
.il
/mdv
=
"WindowsRuntime 1.2"
/msv
:1.1
/dll /out
=
WB
.winmd
ilasm
WB_Version1
.il
/mdv
=
"WindowsRuntime 1.2"
/msv
:1.1
/dll /out
=
WB_Version1
.winmd
ilasm
WImpl
.il
/mdv
=
"WindowsRuntime 1.3"
/msv
:1.1
/dll /out
=
WImpl
.winmd
src/Compilers/Test/Resources/Core/WinRt/WImpl.il
0 → 100644
浏览文件 @
50e27eba
.assembly extern windowsruntime ITest {}
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 255:255:255:255
}
.assembly windowsruntime WImpl
{
.hash algorithm 0x00008004
.ver 255:255:255:255
}
.module WImpl.winmd
.class public auto ansi windowsruntime sealed WImpl
extends System.Object
implements [ITest]ITest
{
.method public hidebysig specialname rtspecialname
instance void .ctor() runtime managed
{
}
}
\ No newline at end of file
src/Compilers/Test/Resources/Core/WinRt/WImpl.winmd
0 → 100644
浏览文件 @
50e27eba
文件已添加
src/Compilers/Test/Resources/Core/WinRt/WinRt.Designer.vb
浏览文件 @
50e27eba
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.
18326
' Runtime Version:4.0.30319.
42000
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
...
...
@@ -104,6 +104,16 @@ Namespace TestResources
End
Get
End
Property
'''<summary>
''' Looks up a localized resource of type System.Byte[].
'''</summary>
Public
Shared
ReadOnly
Property
WImpl
()
As
Byte
()
Get
Dim
obj
As
Object
=
ResourceManager
.
GetObject
(
"WImpl"
,
resourceCulture
)
Return
CType
(
obj
,
Byte
())
End
Get
End
Property
'''<summary>
''' Looks up a localized resource of type System.Byte[].
'''</summary>
...
...
src/Compilers/Test/Resources/Core/WinRt/WinRt.resx
浏览文件 @
50e27eba
...
...
@@ -147,4 +147,7 @@
<data
name=
"WinMDPrefixing_dump"
type=
"System.Resources.ResXFileRef, System.Windows.Forms"
>
<value>
WinMDPrefixing.ildump;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</data>
<data
name=
"WImpl"
type=
"System.Resources.ResXFileRef, System.Windows.Forms"
>
<value>
WImpl.winmd;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</data>
</root>
src/Compilers/VisualBasic/Portable/Compilation/SyntaxTreeSemanticModel.vb
浏览文件 @
50e27eba
...
...
@@ -758,13 +758,13 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Dim
methodSym
=
DirectCast
(
implementingMember
,
SourceMemberMethodSymbol
)
Dim
diagbag
=
DiagnosticBag
.
GetInstance
()
Dim
boundClause
=
methodSym
.
BindSingleHandlesClause
(
handlesClause
,
binder
,
diagbag
,
eventSymbolBuilder
,
containerSymbolBuilder
,
propertySymbolBuilder
,
resultKind
)
methodSym
.
BindSingleHandlesClause
(
handlesClause
,
binder
,
diagbag
,
eventSymbolBuilder
,
containerSymbolBuilder
,
propertySymbolBuilder
,
resultKind
)
diagbag
.
Free
()
End
If
...
...
src/Compilers/VisualBasic/Portable/Symbols/ReferenceManager.vb
浏览文件 @
50e27eba
...
...
@@ -869,6 +869,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return
_assembly
.
DeclaresTheObjectClass
End
Get
End
Property
Public
Overrides
ReadOnly
Property
SourceCompilation
As
Compilation
Get
Return
Nothing
End
Get
End
Property
End
Class
Private
NotInheritable
Class
AssemblyDataForCompilation
...
...
@@ -955,6 +961,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return
_compilation
.
DeclaresTheObjectClass
End
Get
End
Property
Public
Overrides
ReadOnly
Property
SourceCompilation
As
Compilation
Get
Return
_compilation
End
Get
End
Property
End
Class
''' <summary>
...
...
src/Compilers/VisualBasic/Portable/Symbols/Source/SourceMemberMethodSymbol.vb
浏览文件 @
50e27eba
...
...
@@ -743,6 +743,18 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
diagBag
)
End
If
Select
Case
ContainingType
.
TypeKind
Case
TypeKind
.
Interface
,
TypeKind
.
Structure
,
TypeKind
.
Enum
,
TypeKind
.
Delegate
' Handles clause is invalid in this context.
Return
Nothing
Case
TypeKind
.
Class
,
TypeKind
.
Module
' Valid context
Case
Else
Debug
.
Assert
(
False
)
End
Select
Dim
receiverOpt
As
BoundExpression
=
Nothing
' synthesize delegate creation (may involve relaxation)
...
...
src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/Source/EventTests.vb
浏览文件 @
50e27eba
...
...
@@ -2100,5 +2100,114 @@ End Structure
}
]]
>
)
End
Sub
<
Fact
,
WorkItem
(
3448
,
"https://github.com/dotnet/roslyn/issues/3448"
)
>
Public
Sub
HandlesInAnInterface
()
Dim
compilation
=
CreateCompilationWithMscorlibAndVBRuntime
(
<
compilation
>
<
file
name
=
"a.vb"
><
!
[
CDATA
[
Interface
I
Event
E
()
Sub
M
()
Handles
Me
.
E
End
Interface
]]
></
file
>
</
compilation
>
,
options
:
=
TestOptions
.
DebugDll
)
Dim
expected
=
<
expected
>
BC30270
:
'Handles' is not valid on an interface method declaration.
Sub
M
()
Handles
Me
.
E
~~~~~~~~~~~~
</
expected
>
compilation
.
AssertTheseDiagnostics
(
expected
)
compilation
.
AssertTheseEmitDiagnostics
(
expected
)
Dim
tree
=
compilation
.
SyntaxTrees
.
Single
()
Dim
node
=
tree
.
GetRoot
().
DescendantNodes
().
OfType
(
Of
IdentifierNameSyntax
)().
Where
(
Function
(
n
)
n
.
Identifier
.
ValueText
=
"E"
).
Single
()
Assert
.
Equal
(
"Me.E"
,
node
.
Parent
.
ToString
())
Dim
semanticModel
=
compilation
.
GetSemanticModel
(
tree
)
Dim
symbolInfo
=
semanticModel
.
GetSymbolInfo
(
node
)
Assert
.
Equal
(
"Event I.E()"
,
symbolInfo
.
Symbol
.
ToTestDisplayString
())
End
Sub
<
Fact
,
WorkItem
(
3448
,
"https://github.com/dotnet/roslyn/issues/3448"
)
>
Public
Sub
HandlesInAStruct
()
Dim
compilation
=
CreateCompilationWithMscorlibAndVBRuntime
(
<
compilation
>
<
file
name
=
"a.vb"
><
!
[
CDATA
[
Structure
S
Event
E
()
Sub
M
()
Handles
Me
.
E
End
Sub
End
Structure
]]
></
file
>
</
compilation
>
,
options
:
=
TestOptions
.
DebugDll
)
Dim
expected
=
<
expected
>
BC30728
:
Methods
declared
in
structures
cannot
have
'Handles' clauses.
Sub
M
()
Handles
Me
.
E
~
</
expected
>
compilation
.
AssertTheseDiagnostics
(
expected
)
compilation
.
AssertTheseEmitDiagnostics
(
expected
)
Dim
tree
=
compilation
.
SyntaxTrees
.
Single
()
Dim
node
=
tree
.
GetRoot
().
DescendantNodes
().
OfType
(
Of
IdentifierNameSyntax
)().
Where
(
Function
(
n
)
n
.
Identifier
.
ValueText
=
"E"
).
Single
()
Assert
.
Equal
(
"Me.E"
,
node
.
Parent
.
ToString
())
Dim
semanticModel
=
compilation
.
GetSemanticModel
(
tree
)
Dim
symbolInfo
=
semanticModel
.
GetSymbolInfo
(
node
)
Assert
.
Equal
(
"Event S.E()"
,
symbolInfo
.
Symbol
.
ToTestDisplayString
())
End
Sub
<
Fact
,
WorkItem
(
3448
,
"https://github.com/dotnet/roslyn/issues/3448"
)
>
Public
Sub
HandlesInAnEnum
()
Dim
compilation
=
CreateCompilationWithMscorlibAndVBRuntime
(
<
compilation
>
<
file
name
=
"a.vb"
><
!
[
CDATA
[
Enum
E1
'Event E()
Sub
M
()
Handles
Me
.
E
End
Sub
End
Enum
]]
></
file
>
</
compilation
>
,
options
:
=
TestOptions
.
DebugDll
)
Dim
expected
=
<
expected
>
BC30185
:
'Enum' must end with a matching 'End Enum'.
Enum
E1
~~~~~~~
BC30280
:
Enum
'E1' must contain at least one member.
Enum
E1
~~
BC30619
:
Statement
cannot
appear
within
an
Enum
body
.
End
of
Enum
assumed
.
Sub
M
()
Handles
Me
.
E
~~~~~~~~~~~~~~~~~~~~
BC30590
:
Event
'E' cannot be found.
Sub
M
()
Handles
Me
.
E
~
BC30184
:
'End Enum' must be preceded by a matching 'Enum'.
End
Enum
~~~~~~~~
</
expected
>
compilation
.
AssertTheseDiagnostics
(
expected
)
compilation
.
AssertTheseEmitDiagnostics
(
expected
)
Dim
tree
=
compilation
.
SyntaxTrees
.
Single
()
Dim
node
=
tree
.
GetRoot
().
DescendantNodes
().
OfType
(
Of
IdentifierNameSyntax
)().
Where
(
Function
(
n
)
n
.
Identifier
.
ValueText
=
"E"
).
Single
()
Assert
.
Equal
(
"Me.E"
,
node
.
Parent
.
ToString
())
Dim
semanticModel
=
compilation
.
GetSemanticModel
(
tree
)
Dim
symbolInfo
=
semanticModel
.
GetSymbolInfo
(
node
)
Assert
.
Null
(
symbolInfo
.
Symbol
)
Assert
.
Equal
(
0
,
symbolInfo
.
CandidateSymbols
.
Length
)
End
Sub
End
Class
End
Namespace
src/EditorFeatures/Test2/NavigationBar/VisualBasicNavigationBarTests.vb
浏览文件 @
50e27eba
...
...
@@ -448,6 +448,207 @@ End Class
Item
(
"CancelKeyPress"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
)}))
End
Sub
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
NavigationBar
),
WorkItem
(
1185589
)
>
Public
Sub
WithEventsField_EventsFromInheritedInterfaces
()
AssertItemsAre
(
<
Workspace
>
<
Project
Language
=
"Visual Basic"
CommonReferences
=
"true"
>
<
Document
>
Interface
I1
Event
I1Event
(
sender
As
Object
,
e
As
EventArgs
)
End
Interface
Interface
I2
Event
I2Event
(
sender
As
Object
,
e
As
EventArgs
)
End
Interface
Interface
I3
Inherits
I1
,
I2
Event
I3Event
(
sender
As
Object
,
e
As
EventArgs
)
End
Interface
Class
Test
WithEvents
i3
As
I3
End
Class
</
Document
>
</
Project
>
</
Workspace
>
,
Item
(
"I1"
,
Glyph
.
InterfaceInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
"I1Event"
,
Glyph
.
EventPublic
,
bolded
:
=
True
)}),
Item
(
"I2"
,
Glyph
.
InterfaceInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
"I2Event"
,
Glyph
.
EventPublic
,
bolded
:
=
True
)}),
Item
(
"I3"
,
Glyph
.
InterfaceInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
"I3Event"
,
Glyph
.
EventPublic
,
bolded
:
=
True
)}),
Item
(
"Test"
,
Glyph
.
ClassInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
"i3"
,
Glyph
.
FieldPrivate
,
hasNavigationSymbolId
:
=
False
,
indent
:
=
1
,
children
:
=
{
Item
(
"I1Event"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"I2Event"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"I3Event"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
)}))
End
Sub
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
NavigationBar
),
WorkItem
(
1185589
),
WorkItem
(
530506
)
>
Public
Sub
DoNotIncludeShadowedEvents
()
AssertItemsAre
(
<
Workspace
>
<
Project
Language
=
"Visual Basic"
CommonReferences
=
"true"
>
<
Document
>
Class
B
Event
E
(
sender
As
Object
,
e
As
EventArgs
)
End
Class
Class
C
Inherits
B
Shadows
Event
E
(
sender
As
Object
,
e
As
EventArgs
)
End
Class
Class
Test
WithEvents
c
As
C
End
Class
</
Document
>
</
Project
>
</
Workspace
>
,
Item
(
"B"
,
Glyph
.
ClassInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
),
Item
(
"E"
,
Glyph
.
EventPublic
,
bolded
:
=
True
)}),
Item
(
String
.
Format
(
VBEditorResources
.
Events
,
"B"
),
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
,
indent
:
=
1
,
children
:
=
{
Item
(
"E"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
"C"
,
Glyph
.
ClassInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
),
Item
(
"E"
,
Glyph
.
EventPublic
,
bolded
:
=
True
)}),
Item
(
String
.
Format
(
VBEditorResources
.
Events
,
"C"
),
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
,
indent
:
=
1
,
children
:
=
{
Item
(
"E"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
)}),
' Only one E under the "(C Events)" node
Item
(
"Test"
,
Glyph
.
ClassInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
"c"
,
Glyph
.
FieldPrivate
,
hasNavigationSymbolId
:
=
False
,
indent
:
=
1
,
children
:
=
{
Item
(
"E"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
)}))
' Only one E for WithEvents handling
End
Sub
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
NavigationBar
),
WorkItem
(
1185589
),
WorkItem
(
530506
)
>
Public
Sub
EventList_EnsureInternalEventsInEventListAndInInheritedEventList
()
AssertItemsAre
(
<
Workspace
>
<
Project
Language
=
"Visual Basic"
CommonReferences
=
"true"
>
<
Document
>
Class
C
Event
E
()
End
Class
Class
D
Inherits
C
End
Class
</
Document
>
</
Project
>
</
Workspace
>
,
Item
(
"C"
,
Glyph
.
ClassInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
),
Item
(
"E"
,
Glyph
.
EventPublic
,
bolded
:
=
True
)}),
Item
(
String
.
Format
(
VBEditorResources
.
Events
,
"C"
),
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
,
indent
:
=
1
,
children
:
=
{
Item
(
"E"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
"D"
,
Glyph
.
ClassInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
String
.
Format
(
VBEditorResources
.
Events
,
"D"
),
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
,
indent
:
=
1
,
children
:
=
{
Item
(
"E"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
)}))
End
Sub
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
NavigationBar
),
WorkItem
(
1185589
),
WorkItem
(
530506
)
>
Public
Sub
EventList_EnsurePrivateEventsInEventListButNotInInheritedEventList
()
AssertItemsAre
(
<
Workspace
>
<
Project
Language
=
"Visual Basic"
CommonReferences
=
"true"
>
<
Document
>
Class
C
Private
Event
E
()
End
Class
Class
D
Inherits
C
End
Class
</
Document
>
</
Project
>
</
Workspace
>
,
Item
(
"C"
,
Glyph
.
ClassInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
),
Item
(
"E"
,
Glyph
.
EventPrivate
,
bolded
:
=
True
)}),
Item
(
String
.
Format
(
VBEditorResources
.
Events
,
"C"
),
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
,
indent
:
=
1
,
children
:
=
{
Item
(
"E"
,
Glyph
.
EventPrivate
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
"D"
,
Glyph
.
ClassInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
)}))
End
Sub
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
NavigationBar
),
WorkItem
(
1185589
),
WorkItem
(
530506
)
>
Public
Sub
EventList_TestAccessibilityThroughNestedAndDerivedTypes
()
AssertItemsAre
(
<
Workspace
>
<
Project
Language
=
"Visual Basic"
CommonReferences
=
"true"
>
<
Document
>
Class
C
Public
Event
E0
()
Protected
Event
E1
()
Private
Event
E2
()
Class
N1
Class
N2
Inherits
C
End
Class
End
Class
End
Class
Class
D2
Inherits
C
End
Class
Class
T
WithEvents
c
As
C
End
Class
</
Document
>
</
Project
>
</
Workspace
>
,
Item
(
"C"
,
Glyph
.
ClassInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
),
Item
(
"E0"
,
Glyph
.
EventPublic
,
bolded
:
=
True
),
Item
(
"E1"
,
Glyph
.
EventProtected
,
bolded
:
=
True
),
Item
(
"E2"
,
Glyph
.
EventPrivate
,
bolded
:
=
True
)}),
Item
(
String
.
Format
(
VBEditorResources
.
Events
,
"C"
),
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
,
indent
:
=
1
,
children
:
=
{
Item
(
"E0"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"E1"
,
Glyph
.
EventProtected
,
hasNavigationSymbolId
:
=
False
),
Item
(
"E2"
,
Glyph
.
EventPrivate
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
"D2"
,
Glyph
.
ClassInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
String
.
Format
(
VBEditorResources
.
Events
,
"D2"
),
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
,
indent
:
=
1
,
children
:
=
{
Item
(
"E0"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"E1"
,
Glyph
.
EventProtected
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
"N1 (C)"
,
Glyph
.
ClassPublic
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
"N2 (C.N1)"
,
Glyph
.
ClassPublic
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
String
.
Format
(
VBEditorResources
.
Events
,
"N2"
),
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
,
indent
:
=
1
,
children
:
=
{
Item
(
"E0"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"E1"
,
Glyph
.
EventProtected
,
hasNavigationSymbolId
:
=
False
),
Item
(
"E2"
,
Glyph
.
EventPrivate
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
"T"
,
Glyph
.
ClassInternal
,
bolded
:
=
True
,
children
:
=
{
Item
(
NavigationItemNew
,
Glyph
.
MethodPublic
,
hasNavigationSymbolId
:
=
False
),
Item
(
"Finalize"
,
Glyph
.
MethodProtected
,
hasNavigationSymbolId
:
=
False
)}),
Item
(
"c"
,
Glyph
.
FieldPrivate
,
hasNavigationSymbolId
:
=
False
,
indent
:
=
1
,
children
:
=
{
Item
(
"E0"
,
Glyph
.
EventPublic
,
hasNavigationSymbolId
:
=
False
)}))
End
Sub
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
NavigationBar
)
>
Public
Sub
GenerateEventHandler
()
AssertGeneratedResultIs
(
...
...
src/EditorFeatures/VisualBasic/NavigationBar/VisualBasicNavigationBarItemService.vb
浏览文件 @
50e27eba
...
...
@@ -45,7 +45,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.NavigationBar
Dim
semanticModel
=
Await
document
.
GetSemanticModelAsync
(
cancellationToken
).
ConfigureAwait
(
False
)
Contract
.
ThrowIfNull
(
semanticModel
)
Dim
types
=
GetType
sInFile
(
semanticModel
,
cancellationToken
)
Dim
types
AndDeclarations
=
GetTypesAndDeclaration
sInFile
(
semanticModel
,
cancellationToken
)
Dim
typeItems
As
New
List
(
Of
NavigationBarItem
)
Dim
typeSymbolIndexProvider
As
New
NavigationBarSymbolIdIndexProvider
(
caseSensitive
:
=
False
)
...
...
@@ -53,8 +53,10 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.NavigationBar
Dim
symbolDeclarationService
=
document
.
GetLanguageService
(
Of
ISymbolDeclarationService
)
Dim
workspaceSupportsDocumentChanges
=
document
.
Project
.
Solution
.
Workspace
.
CanApplyChange
(
ApplyChangesKind
.
ChangeDocument
)
For
Each
typeSymbol
In
types
typeItems
.
AddRange
(
CreateItemsForType
(
typeSymbol
,
typeSymbolIndexProvider
.
GetIndexForSymbolId
(
typeSymbol
.
GetSymbolKey
()),
semanticModel
,
workspaceSupportsDocumentChanges
,
symbolDeclarationService
,
cancellationToken
))
For
Each
typeAndDeclaration
In
typesAndDeclarations
Dim
type
=
typeAndDeclaration
.
Item1
Dim
position
=
typeAndDeclaration
.
Item2
.
SpanStart
typeItems
.
AddRange
(
CreateItemsForType
(
type
,
position
,
typeSymbolIndexProvider
.
GetIndexForSymbolId
(
type
.
GetSymbolKey
()),
semanticModel
,
workspaceSupportsDocumentChanges
,
symbolDeclarationService
,
cancellationToken
))
Next
Return
typeItems
...
...
@@ -65,23 +67,23 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.NavigationBar
Return
TypeOf
item
IsNot
AbstractGenerateCodeItem
End
Function
Private
Function
GetTypes
InFile
(
semanticModel
As
SemanticModel
,
cancellationToken
As
CancellationToken
)
As
IEnumerable
(
Of
INamedTypeSymbol
)
Private
Function
GetTypes
AndDeclarationsInFile
(
semanticModel
As
SemanticModel
,
cancellationToken
As
CancellationToken
)
As
IEnumerable
(
Of
Tuple
(
Of
INamedTypeSymbol
,
SyntaxNode
)
)
Try
Dim
types
As
New
HashSet
(
Of
INamedTypeSymbol
)
Dim
types
AndDeclarations
As
New
Dictionary
(
Of
INamedTypeSymbol
,
SyntaxNode
)
Dim
nodesToVisit
As
New
Stack
(
Of
SyntaxNode
)
nodesToVisit
.
Push
(
DirectCast
(
semanticModel
.
SyntaxTree
.
GetRoot
(
cancellationToken
),
SyntaxNode
))
Do
Until
nodesToVisit
.
IsEmpty
If
cancellationToken
.
IsCancellationRequested
Then
Return
SpecializedCollections
.
EmptyEnumerable
(
Of
INamedTypeSymbol
)()
Return
SpecializedCollections
.
EmptyEnumerable
(
Of
Tuple
(
Of
INamedTypeSymbol
,
SyntaxNode
)
)()
End
If
Dim
node
=
nodesToVisit
.
Pop
()
Dim
type
=
TryCast
(
semanticModel
.
GetDeclaredSymbol
(
node
,
cancellationToken
),
INamedTypeSymbol
)
If
type
IsNot
Nothing
Then
types
.
Add
(
type
)
types
AndDeclarations
(
type
)
=
node
End
If
If
TypeOf
node
Is
MethodBlockBaseSyntax
OrElse
...
...
@@ -99,13 +101,14 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.NavigationBar
Next
Loop
Return
types
.
OrderBy
(
Function
(
t
)
t
.
Name
)
Return
types
AndDeclarations
.
Select
(
Function
(
kvp
)
Tuple
.
Create
(
kvp
.
Key
,
kvp
.
Value
)).
OrderBy
(
Function
(
t
)
t
.
Item1
.
Name
)
Catch
ex
As
Exception
When
FatalError
.
ReportUnlessCanceled
(
ex
)
Throw
ExceptionUtilities
.
Unreachable
End
Try
End
Function
Private
Function
CreateItemsForType
(
type
As
INamedTypeSymbol
,
position
As
Integer
,
typeSymbolIdIndex
As
Integer
,
semanticModel
As
SemanticModel
,
workspaceSupportsDocumentChanges
As
Boolean
,
...
...
@@ -120,6 +123,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.NavigationBar
If
type
.
TypeKind
<>
TypeKind
.
Interface
Then
Dim
typeEvents
=
CreateItemForEvents
(
type
,
position
,
type
,
eventContainer
:
=
Nothing
,
semanticModel
:
=
semanticModel
,
...
...
@@ -139,6 +143,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.NavigationBar
items
.
Add
(
CreateItemForEvents
(
type
,
position
,
propertySymbol
.
Type
,
propertySymbol
,
semanticModel
,
...
...
@@ -279,6 +284,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.NavigationBar
''' <param name="eventContainer">If this is an entry for a WithEvents member, the WithEvents
''' property itself.</param>
Private
Function
CreateItemForEvents
(
containingType
As
INamedTypeSymbol
,
position
As
Integer
,
eventType
As
ITypeSymbol
,
eventContainer
As
IPropertySymbol
,
semanticModel
As
SemanticModel
,
...
...
@@ -288,10 +294,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.NavigationBar
Dim
rightHandMemberItems
As
New
List
(
Of
NavigationBarItem
)
' Get all of the events and methods implementing them. We must include events from base
' types, as well as static events.
Dim
allEvents
=
eventType
.
GetBaseTypesAndThis
().
SelectMany
(
Function
(
t
)
t
.
GetMembers
()).
OfType
(
Of
IEventSymbol
)().
OrderBy
(
Function
(
e
)
e
.
Name
)
Dim
accessibleEvents
=
allEvents
.
Where
(
Function
(
e
)
e
.
IsAccessibleWithin
(
containingType
))
Dim
accessibleEvents
=
semanticModel
.
LookupSymbols
(
position
,
eventType
).
OfType
(
Of
IEventSymbol
).
OrderBy
(
Function
(
e
)
e
.
Name
)
Dim
methodsImplementingEvents
=
containingType
.
GetMembers
().
OfType
(
Of
IMethodSymbol
)
_
.
Where
(
Function
(
m
)
m
.
HandledEvents
.
Any
(
Function
(
he
)
Object
.
Equals
(
he
.
EventContainer
,
eventContainer
)))
...
...
@@ -299,10 +303,10 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.NavigationBar
For
Each
method
In
methodsImplementingEvents
For
Each
handledEvent
In
method
.
HandledEvents
Dim
list
As
l
ist
(
Of
IMethodSymbol
)
=
Nothing
Dim
list
As
L
ist
(
Of
IMethodSymbol
)
=
Nothing
If
Not
eventToImplementingMethods
.
TryGetValue
(
handledEvent
.
EventSymbol
,
list
)
Then
list
=
New
l
ist
(
Of
IMethodSymbol
)
list
=
New
L
ist
(
Of
IMethodSymbol
)
eventToImplementingMethods
.
Add
(
handledEvent
.
EventSymbol
,
list
)
End
If
...
...
src/Samples/CSharp/AsyncPackage/AsyncPackage.csproj
浏览文件 @
50e27eba
...
...
@@ -193,6 +193,6 @@
</ImportGroup>
<Target
Name=
"AfterBuild"
>
<Message
Text=
"AfterBuild"
/>
<Exec
Command=
"$(SolutionDir)..\..\packages\NuGet.CommandLine.$(NuGetCommandLineVersion)\tools\NuGet.exe pack Diagnostic.nuspec -NoPackageAnalysis -OutputDirectory $(OutDir)"
/>
<Exec
Co
ndition=
"'$(CIBuild)' != 'true'"
Co
mmand=
"$(SolutionDir)..\..\packages\NuGet.CommandLine.$(NuGetCommandLineVersion)\tools\NuGet.exe pack Diagnostic.nuspec -NoPackageAnalysis -OutputDirectory $(OutDir)"
/>
</Target>
</Project>
src/VisualStudio/Core/Def/Implementation/ProjectSystem/AbstractProject.cs
浏览文件 @
50e27eba
...
...
@@ -413,7 +413,8 @@ private static string GetAssemblyName(string outputPath)
// dev11 sometimes gives us output path w/o extension, so removing extension becomes problematic
if
(
outputPath
.
EndsWith
(
".exe"
,
StringComparison
.
OrdinalIgnoreCase
)
||
outputPath
.
EndsWith
(
".dll"
,
StringComparison
.
OrdinalIgnoreCase
)
||
outputPath
.
EndsWith
(
".netmodule"
,
StringComparison
.
OrdinalIgnoreCase
))
outputPath
.
EndsWith
(
".netmodule"
,
StringComparison
.
OrdinalIgnoreCase
)
||
outputPath
.
EndsWith
(
".winmdobj"
,
StringComparison
.
OrdinalIgnoreCase
))
{
return
Path
.
GetFileNameWithoutExtension
(
outputPath
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录