Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
31a83f08
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,发现更多精彩内容 >>
提交
31a83f08
编写于
4月 18, 2016
作者:
A
AlekseyTs
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/master' into merge-master-into-future20160418-171208
上级
7d02e6cf
33281005
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
131 addition
and
189 deletion
+131
-189
netci.groovy
netci.groovy
+18
-171
src/Compilers/CSharp/Test/Symbol/Symbols/Metadata/PE/LoadingFields.cs
...s/CSharp/Test/Symbol/Symbols/Metadata/PE/LoadingFields.cs
+33
-3
src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.vb
...alBasic/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.vb
+19
-6
src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/Metadata/PE/LoadingFields.vb
...sic/Test/Symbol/SymbolsTests/Metadata/PE/LoadingFields.vb
+33
-0
src/EditorFeatures/CSharpTest/NavigateTo/NavigateToTests.cs
src/EditorFeatures/CSharpTest/NavigateTo/NavigateToTests.cs
+5
-3
src/EditorFeatures/Core/Extensibility/Navigation/NavigableItemFactory.cs
...res/Core/Extensibility/Navigation/NavigableItemFactory.cs
+2
-1
src/EditorFeatures/Core/Implementation/NavigateTo/NavigateToSymbolFinder.cs
.../Core/Implementation/NavigateTo/NavigateToSymbolFinder.cs
+1
-2
src/NuGet/Microsoft.CodeAnalysis.CSharp.Workspaces.nuspec
src/NuGet/Microsoft.CodeAnalysis.CSharp.Workspaces.nuspec
+2
-0
src/NuGet/Microsoft.CodeAnalysis.VisualBasic.Workspaces.nuspec
...uGet/Microsoft.CodeAnalysis.VisualBasic.Workspaces.nuspec
+2
-0
src/NuGet/Microsoft.CodeAnalysis.Workspaces.Common.nuspec
src/NuGet/Microsoft.CodeAnalysis.Workspaces.Common.nuspec
+2
-0
src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeInfo.cs
...es/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeInfo.cs
+14
-3
未找到文件。
netci.groovy
浏览文件 @
31a83f08
...
...
@@ -2,94 +2,10 @@
// Jenkins DSL: https://github.com/jenkinsci/job-dsl-plugin/wiki
import
jobs.generation.Utilities
;
import
static
Constants
.*;
def
project
=
GithubProject
class
Constants
{
// Number of minutes a build job is given to complete.
static
final
BuildTimeLimit
=
120
;
}
static
void
addLogRotator
(
def
myJob
)
{
myJob
.
with
{
logRotator
{
daysToKeep
(
90
)
numToKeep
(-
1
)
artifactDaysToKeep
(
21
)
artifactNumToKeep
(-
1
)
}
}
}
static
void
addConcurrentBuild
(
def
myJob
,
String
category
)
{
myJob
.
with
{
concurrentBuild
(
true
)
if
(
category
!=
null
)
{
throttleConcurrentBuilds
{
throttleDisabled
(
false
)
maxTotal
(
0
)
maxPerNode
(
1
)
categories
([
category
])
}
}
}
}
static
void
addScm
(
def
myJob
,
String
branchName
,
String
refspecName
=
''
)
{
myJob
.
with
{
scm
{
git
{
remote
{
github
(
'dotnet/roslyn'
,
'https'
,
'github.com'
)
name
(
''
)
refspec
(
refspecName
)
}
branch
(
branchName
)
wipeOutWorkspace
(
true
)
shallowClone
(
true
)
}
}
}
}
static
void
addWrappers
(
def
myJob
)
{
myJob
.
with
{
wrappers
{
timeout
{
absolute
(
BuildTimeLimit
)
abortBuild
()
}
timestamps
()
}
}
}
static
void
addArtifactArchiving
(
def
myJob
,
String
patternString
,
String
excludeString
)
{
myJob
.
with
{
publishers
{
flexiblePublish
{
conditionalAction
{
condition
{
status
(
'ABORTED'
,
'FAILURE'
)
}
publishers
{
archiveArtifacts
{
allowEmpty
(
true
)
defaultExcludes
(
false
)
exclude
(
excludeString
)
fingerprint
(
false
)
onlyIfSuccessful
(
false
)
pattern
(
patternString
)
}
}
}
}
}
}
}
// Email the results of aborted / failed jobs to our infrastructure alias
static
void
addEmailPublisher
(
def
myJob
)
{
myJob
.
with
{
publishers
{
...
...
@@ -101,94 +17,29 @@ static void addEmailPublisher(def myJob) {
}
}
static
void
addUnitPublisher
(
def
myJob
)
{
myJob
.
with
{
configure
{
node
->
node
/
'publishers'
<<
{
'xunit'
(
'plugin'
:
'xunit@1.97'
)
{
'types'
{
'XUnitDotNetTestType'
{
'pattern'
(
'**/xUnitResults/*.xml'
)
'skipNoTestFiles'
(
false
)
'failIfNotNew'
(
true
)
'deleteOutputFiles'
(
true
)
'stopProcessingIfError'
(
true
)
}
}
'thresholds'
{
'org.jenkinsci.plugins.xunit.threshold.FailedThreshold'
{
'unstableThreshold'
(
''
)
'unstableNewThreshold'
(
''
)
'failureThreshold'
(
'0'
)
'failureNewThreshold'
(
''
)
}
'org.jenkinsci.plugins.xunit.threshold.SkippedThreshold'
{
'unstableThreshold'
(
''
)
'unstableNewThreshold'
(
''
)
'failureThreshold'
(
''
)
'failureNewThreshold'
(
''
)
}
}
'thresholdMode'
(
'1'
)
'extraConfiguration'
{
testTimeMargin
(
'3000'
)
}
}
}
}
}
}
static
void
addPushTrigger
(
def
myJob
)
{
myJob
.
with
{
triggers
{
githubPush
()
}
}
}
// Generates the standard trigger phrases. This is the regex which ends up matching lines like:
// test win32 please
static
String
generateTriggerPhrase
(
String
jobName
,
String
opsysName
,
String
triggerKeyword
=
'this'
)
{
return
"(?i).*test\\W+(${jobName.replace('_', '/').substring(7)}|${opsysName}|${triggerKeyword}|${opsysName}\\W+${triggerKeyword}|${triggerKeyword}\\W+${opsysName})\\W+please.*"
;
}
static
void
addPullRequestTrigger
(
def
myJob
,
String
jobName
,
String
triggerPhraseText
,
Boolean
triggerPhraseOnly
=
false
)
{
myJob
.
with
{
triggers
{
pullRequest
{
admin
(
'Microsoft'
)
useGitHubHooks
(
true
)
triggerPhrase
(
triggerPhraseText
)
onlyTriggerPhrase
(
triggerPhraseOnly
)
autoCloseFailedPullRequests
(
false
)
orgWhitelist
(
'Microsoft'
)
allowMembersOfWhitelistedOrgsAsAdmin
(
true
)
permitAll
(
true
)
extensions
{
commitStatus
{
context
(
jobName
.
replace
(
'_'
,
'/'
).
substring
(
7
))
}
}
}
}
}
}
static
void
addStandardJob
(
def
myJob
,
String
jobName
,
String
branchName
,
String
triggerPhrase
,
Boolean
triggerPhraseOnly
=
false
)
{
addLogRotator
(
myJob
)
addWrappers
(
myJob
)
static
void
addRoslynJob
(
def
myJob
,
String
jobName
,
String
branchName
,
String
triggerPhrase
,
Boolean
triggerPhraseOnly
=
false
)
{
def
includePattern
=
"Binaries/**/*.pdb,Binaries/**/*.xml,Binaries/**/*.log,Binaries/**/*.dmp,Binaries/**/*.zip,Binaries/**/*.png,Binaries/**/*.xml"
def
excludePattern
=
"Binaries/Obj/**,Binaries/Bootstrap/**,Binaries/**/nuget*.zip"
addArtifactArchiving
(
myJob
,
includePattern
,
excludePattern
)
if
(
branchName
==
'prtest'
)
{
addPullRequestTrigger
(
myJob
,
jobName
,
triggerPhrase
,
triggerPhraseOnly
);
addScm
(
myJob
,
'${sha1}'
,
'+refs/pull/*:refs/remotes/origin/pr/*'
)
Utilities
.
addArchival
(
myJob
,
includePattern
,
excludePattern
)
// Create the standard job. This will setup parameter, SCM, timeout, etc ...
def
projectName
=
'dotnet/roslyn'
def
isPr
=
branchName
==
'prtest'
def
defaultBranch
=
"*/${branchName}"
Utilities
.
standardJobSetup
(
myJob
,
projectName
,
isPr
,
defaultBranch
)
// Need to setup the triggers for the job
if
(
isPr
)
{
def
contextName
=
jobName
.
replace
(
'_'
,
'/'
).
substring
(
7
)
Utilities
.
addGithubPRTrigger
(
myJob
,
contextName
,
triggerPhrase
,
triggerPhraseOnly
)
}
else
{
addPushTrigger
(
myJob
)
addScm
(
myJob
,
"*/${branchName}"
)
Utilities
.
addGithubPushTrigger
(
myJob
)
addEmailPublisher
(
myJob
)
}
}
...
...
@@ -237,7 +88,6 @@ set TMP=%TEMP%
}
Utilities
.
setMachineAffinity
(
myJob
,
'Windows_NT'
,
'latest-or-auto'
)
// Generic throttling for Windows, no category
addConcurrentBuild
(
myJob
,
null
)
break
;
case
'linux'
:
myJob
.
with
{
...
...
@@ -246,7 +96,6 @@ set TMP=%TEMP%
shell
(
"./cibuild.sh --nocache --debug"
)
}
}
addConcurrentBuild
(
myJob
,
'roslyn/lin/unit'
)
break
;
case
'mac'
:
myJob
.
with
{
...
...
@@ -255,13 +104,12 @@ set TMP=%TEMP%
shell
(
"./cibuild.sh --nocache --debug"
)
}
}
addConcurrentBuild
(
myJob
,
'roslyn/mac/unit'
)
triggerPhraseOnly
=
true
;
break
;
}
addUnitPublisher
(
myJob
)
add
StandardJob
(
myJob
,
jobName
,
branchName
,
triggerPhrase
,
triggerPhraseOnly
);
Utilities
.
addXUnitDotNETResults
(
myJob
,
'**/xUnitResults/*.xml'
)
add
RoslynJob
(
myJob
,
jobName
,
branchName
,
triggerPhrase
,
triggerPhraseOnly
)
}
}
}
...
...
@@ -284,7 +132,6 @@ set TMP=%TEMP%
}
Utilities
.
setMachineAffinity
(
determinismJob
,
'Windows_NT'
,
'latest-or-auto'
)
addConcurrentBuild
(
determinismJob
,
null
)
addStandardJob
(
determinismJob
,
determinismJobName
,
branchName
,
"(?i).*test\\W+determinism.*"
,
true
);
addRoslynJob
(
determinismJob
,
determinismJobName
,
branchName
,
"(?i).*test\\W+determinism.*"
,
true
);
}
src/Compilers/CSharp/Test/Symbol/Symbols/Metadata/PE/LoadingFields.cs
浏览文件 @
31a83f08
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using
System.Linq
;
using
Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE
;
using
Microsoft.CodeAnalysis.CSharp.Symbols
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.CSharp.Test.Utilities
;
using
Microsoft.CodeAnalysis.Text
;
using
Roslyn.Test.Utilities
;
using
System.Linq
;
using
Xunit
;
namespace
Microsoft.CodeAnalysis.CSharp.UnitTests.Symbols.Metadata.PE
...
...
@@ -105,5 +104,36 @@ public void Test1()
Assert
.
Equal
(
SymbolKind
.
Field
,
csFields
.
GetMembers
(
"Fff"
).
Single
().
Kind
);
Assert
.
Equal
(
SymbolKind
.
Method
,
csFields
.
GetMembers
(
"FfF"
).
Single
().
Kind
);
}
[
Fact
]
[
WorkItem
(
193333
,
"https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems?_a=edit&id=193333"
)]
public
void
EnumWithPrivateValueField
()
{
var
il
=
@"
.class public auto ansi sealed TestEnum
extends [mscorlib]System.Enum
{
.field private specialname rtspecialname int32 value__
.field public static literal valuetype TestEnum Value1 = int32(0x00000000)
.field public static literal valuetype TestEnum Value2 = int32(0x00000001)
} // end of class TestEnum
"
;
var
text
=
@"
class Program
{
static void Main()
{
TestEnum val = TestEnum.Value1;
System.Console.WriteLine(val.ToString());
val = TestEnum.Value2;
System.Console.WriteLine(val.ToString());
}
}
"
;
var
compilation
=
CreateCompilationWithCustomILSource
(
text
,
il
,
options
:
TestOptions
.
DebugExe
);
CompileAndVerify
(
compilation
,
expectedOutput
:
@"Value1
Value2"
);
}
}
}
src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.vb
浏览文件 @
31a83f08
...
...
@@ -1115,17 +1115,30 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols.Metadata.PE
Dim
moduleSymbol
=
Me
.
ContainingPEModule
Dim
[
module
]
=
moduleSymbol
.
Module
Dim
isOrdinaryStruct
As
Boolean
=
Me
.
TypeKind
=
TypeKind
.
Structure
AndAlso
(
Me
.
SpecialType
=
SpecialType
.
None
OrElse
Me
.
SpecialType
=
SpecialType
.
System_Nullable_T
)
Try
For
Each
fieldDef
In
[
module
]
.
GetFieldsOfTypeOrThrow
(
_handle
)
Dim
import
As
Boolean
=
True
Dim
import
As
Boolean
Try
If
Not
(
[
module
]
.
ShouldImportField
(
fieldDef
,
moduleSymbol
.
ImportOptions
)
OrElse
isOrdinaryStruct
AndAlso
(
[
module
]
.
GetFieldDefFlagsOrThrow
(
fieldDef
)
And
FieldAttributes
.
Static
)
=
0
)
Then
import
=
False
import
=
[
module
]
.
ShouldImportField
(
fieldDef
,
moduleSymbol
.
ImportOptions
)
If
Not
import
Then
Select
Case
Me
.
TypeKind
Case
TypeKind
.
Structure
Dim
specialType
=
Me
.
SpecialType
If
specialType
=
SpecialType
.
None
OrElse
specialType
=
SpecialType
.
System_Nullable_T
Then
' This is an ordinary struct
If
(
[
module
]
.
GetFieldDefFlagsOrThrow
(
fieldDef
)
And
FieldAttributes
.
Static
)
=
0
Then
import
=
True
End
If
End
If
Case
TypeKind
.
Enum
If
(
[
module
]
.
GetFieldDefFlagsOrThrow
(
fieldDef
)
And
FieldAttributes
.
Static
)
=
0
Then
import
=
True
End
If
End
Select
End
If
Catch
mrEx
As
BadImageFormatException
End
Try
...
...
src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/Metadata/PE/LoadingFields.vb
浏览文件 @
31a83f08
...
...
@@ -240,6 +240,39 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Symbols.Metadata.PE
Assert
.
Equal
(
-
8L
,
Int64Value
.
GetConstantValue
(
SymbolsInProgress
(
Of
FieldSymbol
).
Empty
).
Int64Value
)
End
Sub
<
Fact
>
<
WorkItem
(
193333
,
"https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems?_a=edit&id=193333"
)
>
Public
Sub
EnumWithPrivateValueField
()
Dim
ilSource
=
"
.class public auto ansi sealed TestEnum
extends [mscorlib]System.Enum
{
.field private specialname rtspecialname int32 value__
.field public static literal valuetype TestEnum Value1 = int32(0x00000000)
.field public static literal valuetype TestEnum Value2 = int32(0x00000001)
} // end of class TestEnum
"
Dim
vbSource
=
<
compilation
>
<
file
>
Module
Module1
Sub
Main
()
Dim
val
as
TestEnum
=
TestEnum
.
Value1
System
.
Console
.
WriteLine
(
val
.
ToString
())
val
=
TestEnum
.
Value2
System
.
Console
.
WriteLine
(
val
.
ToString
())
End
Sub
End
Module
</
file
>
</
compilation
>
Dim
compilation
=
CreateCompilationWithCustomILSource
(
vbSource
,
ilSource
,
includeVbRuntime
:
=
True
,
options
:
=
TestOptions
.
DebugExe
)
CompileAndVerify
(
compilation
,
expectedOutput
:
=
"Value1
Value2"
)
End
Sub
End
Class
...
...
src/EditorFeatures/CSharpTest/NavigateTo/NavigateToTests.cs
浏览文件 @
31a83f08
...
...
@@ -840,8 +840,9 @@ public async Task DottedPattern7()
}
[
WorkItem
(
1174255
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1174255"
)]
[
WorkItem
(
8009
,
"https://github.com/dotnet/roslyn/issues/8009"
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
NavigateTo
)]
public
async
Task
N
oNavigation
ToGeneratedFiles
()
public
async
Task
N
avigate
ToGeneratedFiles
()
{
using
(
var
workspace
=
await
TestWorkspace
.
CreateAsync
(
@"
<Workspace>
...
...
@@ -860,7 +861,7 @@ namespace N
{
public partial class C
{
public void VisibleMethod_
Not
() { }
public void VisibleMethod_
Generated
() { }
}
}
</Document>
...
...
@@ -876,7 +877,8 @@ public partial class C
var
items
=
_aggregator
.
GetItems
(
"VisibleMethod"
);
var
expectedItems
=
new
List
<
NavigateToItem
>()
{
new
NavigateToItem
(
"VisibleMethod"
,
NavigateToItemKind
.
Method
,
"csharp"
,
null
,
null
,
MatchKind
.
Exact
,
true
,
null
)
new
NavigateToItem
(
"VisibleMethod"
,
NavigateToItemKind
.
Method
,
"csharp"
,
null
,
null
,
MatchKind
.
Exact
,
true
,
null
),
new
NavigateToItem
(
"VisibleMethod_Generated"
,
NavigateToItemKind
.
Method
,
"csharp"
,
null
,
null
,
MatchKind
.
Prefix
,
true
,
null
)
};
// The pattern matcher should match 'VisibleMethod' to both 'VisibleMethod' and 'VisibleMethod_Not', except that
...
...
src/EditorFeatures/Core/Extensibility/Navigation/NavigableItemFactory.cs
浏览文件 @
31a83f08
...
...
@@ -29,7 +29,8 @@ public static IEnumerable<INavigableItem> GetItemsFromPreferredSourceLocations(S
return
locations
.
Select
(
loc
=>
GetItemFromSymbolLocation
(
solution
,
symbol
,
loc
,
displayString
));
}
public
static
IEnumerable
<
Location
>
GetPreferredSourceLocations
(
Solution
solution
,
ISymbol
symbol
)
public
static
IEnumerable
<
Location
>
GetPreferredSourceLocations
(
Solution
solution
,
ISymbol
symbol
)
{
// Prefer non-generated source locations over generated ones.
...
...
src/EditorFeatures/Core/Implementation/NavigateTo/NavigateToSymbolFinder.cs
浏览文件 @
31a83f08
...
...
@@ -16,11 +16,10 @@ internal static class NavigateToSymbolFinder
{
internal
static
async
Task
<
IEnumerable
<
ValueTuple
<
DeclaredSymbolInfo
,
Document
,
IEnumerable
<
PatternMatch
>>>>
FindNavigableDeclaredSymbolInfos
(
Project
project
,
string
pattern
,
CancellationToken
cancellationToken
)
{
var
generatedCodeRecognitionService
=
project
.
LanguageServices
.
WorkspaceServices
.
GetService
<
IGeneratedCodeRecognitionService
>();
var
patternMatcher
=
new
PatternMatcher
(
pattern
);
var
result
=
new
List
<
ValueTuple
<
DeclaredSymbolInfo
,
Document
,
IEnumerable
<
PatternMatch
>>>();
foreach
(
var
document
in
project
.
Documents
.
Where
(
d
=>
!
generatedCodeRecognitionService
?.
IsGeneratedCode
(
d
)
??
true
)
)
foreach
(
var
document
in
project
.
Documents
)
{
cancellationToken
.
ThrowIfCancellationRequested
();
var
declaredSymbolInfos
=
await
document
.
GetDeclaredSymbolInfosAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
...
...
src/NuGet/Microsoft.CodeAnalysis.CSharp.Workspaces.nuspec
浏览文件 @
31a83f08
...
...
@@ -27,6 +27,8 @@ Supported Platforms:
<file
src=
"Microsoft.CodeAnalysis.CSharp.Workspaces.xml"
target=
"lib\portable-net45+win8"
/>
<file
src=
"Microsoft.CodeAnalysis.CSharp.Workspaces.dll"
target=
"lib\net45"
/>
<file
src=
"Microsoft.CodeAnalysis.CSharp.Workspaces.xml"
target=
"lib\net45"
/>
<file
src=
"Microsoft.CodeAnalysis.CSharp.Workspaces.dll"
target=
"lib\netstandard1.3"
/>
<file
src=
"Microsoft.CodeAnalysis.CSharp.Workspaces.xml"
target=
"lib\netstandard1.3"
/>
<file
src=
"$thirdPartyNoticesPath$"
target=
""
/>
</files>
</package>
src/NuGet/Microsoft.CodeAnalysis.VisualBasic.Workspaces.nuspec
浏览文件 @
31a83f08
...
...
@@ -27,6 +27,8 @@ Supported Platforms:
<file
src=
"Microsoft.CodeAnalysis.VisualBasic.Workspaces.xml"
target=
"lib\portable-net45+win8"
/>
<file
src=
"Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll"
target=
"lib\net45"
/>
<file
src=
"Microsoft.CodeAnalysis.VisualBasic.Workspaces.xml"
target=
"lib\net45"
/>
<file
src=
"Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll"
target=
"lib\netstandard1.3"
/>
<file
src=
"Microsoft.CodeAnalysis.VisualBasic.Workspaces.xml"
target=
"lib\netstandard1.3"
/>
<file
src=
"$thirdPartyNoticesPath$"
target=
""
/>
</files>
</package>
src/NuGet/Microsoft.CodeAnalysis.Workspaces.Common.nuspec
浏览文件 @
31a83f08
...
...
@@ -32,6 +32,8 @@ Supported Platforms:
<file
src=
"Microsoft.CodeAnalysis.Workspaces.xml"
target=
"lib\net45"
/>
<file
src=
"Microsoft.CodeAnalysis.Workspaces.Desktop.dll"
target=
"lib\net45"
/>
<file
src=
"Microsoft.CodeAnalysis.Workspaces.Desktop.xml"
target=
"lib\net45"
/>
<file
src=
"Microsoft.CodeAnalysis.Workspaces.dll"
target=
"lib\netstandard1.3"
/>
<file
src=
"Microsoft.CodeAnalysis.Workspaces.xml"
target=
"lib\netstandard1.3"
/>
<file
src=
"$thirdPartyNoticesPath$"
target=
""
/>
</files>
</package>
src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeInfo.cs
浏览文件 @
31a83f08
...
...
@@ -5,6 +5,7 @@
using
System.Runtime.CompilerServices
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.ErrorReporting
;
using
Microsoft.CodeAnalysis.LanguageServices
;
using
Microsoft.CodeAnalysis.Shared.Extensions
;
using
Microsoft.CodeAnalysis.Shared.Utilities
;
...
...
@@ -170,10 +171,20 @@ public static Task<SyntaxTreeDeclarationInfo> GetDeclarationInfoAsync(Document d
// TryGetDeclaredSymbolInfo, then this will at least prevent us from returning bad spans
// and will prevent the crash from occurring.
DeclaredSymbolInfo
declaredSymbolInfo
;
if
(
syntaxFacts
.
TryGetDeclaredSymbolInfo
(
node
,
out
declaredSymbolInfo
)
&&
root
.
FullSpan
.
Contains
(
declaredSymbolInfo
.
Span
))
if
(
syntaxFacts
.
TryGetDeclaredSymbolInfo
(
node
,
out
declaredSymbolInfo
))
{
declaredSymbolInfos
.
Add
(
declaredSymbolInfo
);
if
(
root
.
FullSpan
.
Contains
(
declaredSymbolInfo
.
Span
))
{
declaredSymbolInfos
.
Add
(
declaredSymbolInfo
);
}
else
{
var
message
=
$@"Invalid span in
{
nameof
(
declaredSymbolInfo
)}
.
{
nameof
(
declaredSymbolInfo
.
Span
)}
=
{
declaredSymbolInfo
.
Span
}
{
nameof
(
root
.
FullSpan
)}
=
{
root
.
FullSpan
}
"
;
FatalError
.
ReportWithoutCrash
(
new
InvalidOperationException
(
message
));
}
}
}
else
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录