Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
00f36c3c
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,发现更多精彩内容 >>
提交
00f36c3c
编写于
7月 13, 2016
作者:
A
AdamSpeight2008
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Working Implementation of VisualBasicSyntaxFactServiceFactory.
上级
068a98b7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
26 deletion
+18
-26
src/EditorFeatures/Test/SolutionCrawler/WorkCoordinatorTests.cs
...itorFeatures/Test/SolutionCrawler/WorkCoordinatorTests.cs
+2
-6
src/EditorFeatures/VisualBasicTest/Diagnostics/Suppression/SuppressionAllCodeTests.vb
...icTest/Diagnostics/Suppression/SuppressionAllCodeTests.vb
+1
-5
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.cs
...deFixes/Suppression/AbstractSuppressionCodeFixProvider.cs
+1
-0
src/Workspaces/VisualBasic/Portable/Extensions/SyntaxTokenExtensions.vb
.../VisualBasic/Portable/Extensions/SyntaxTokenExtensions.vb
+1
-2
src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxFactsService.vb
...ortable/LanguageServices/VisualBasicSyntaxFactsService.vb
+10
-9
src/Workspaces/VisualBasicTest/VisualBasicSyntaxFactsServiceTests.vb
...ces/VisualBasicTest/VisualBasicSyntaxFactsServiceTests.vb
+3
-4
未找到文件。
src/EditorFeatures/Test/SolutionCrawler/WorkCoordinatorTests.cs
浏览文件 @
00f36c3c
...
...
@@ -690,16 +690,12 @@ End Property
var
root
=
Microsoft
.
CodeAnalysis
.
VisualBasic
.
SyntaxFactory
.
ParseCompilationUnit
(
code
);
var
property
=
root
.
FindToken
(
position
).
Parent
.
FirstAncestorOrSelf
<
Microsoft
.
CodeAnalysis
.
VisualBasic
.
Syntax
.
PropertyBlockSyntax
>();
var
memberId
=
_Facts
.
GetMethodLevelMemberId
(
root
,
property
);
var
memberId
=
Microsoft
.
CodeAnalysis
.
VisualBasic
.
VisualBasicSyntaxFactsServiceFactory
.
GetService
()
.
GetMethodLevelMemberId
(
root
,
property
);
Assert
.
Equal
(
0
,
memberId
);
}
[
Import
(
nameof
(
Microsoft
.
CodeAnalysis
.
VisualBasic
.
VisualBasicSyntaxFactsServiceFactory
.
VisualBasicSyntaxFactsService
))]
internal
Microsoft
.
CodeAnalysis
.
VisualBasic
.
VisualBasicSyntaxFactsServiceFactory
.
VisualBasicSyntaxFactsService
_Facts
{
get
;
set
;
}
[
Fact
,
WorkItem
(
739943
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/739943"
)]
public
async
Task
SemanticChange_Propagation_Transitive
()
{
...
...
src/EditorFeatures/VisualBasicTest/Diagnostics/Suppression/SuppressionAllCodeTests.vb
浏览文件 @
00f36c3c
...
...
@@ -25,17 +25,13 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Diagnostics.Suppre
Await
TestPragmaAsync
(
TestResource
.
AllInOneVisualBasicCode
,
VisualBasicParseOptions
.
Default
,
verifier
:
=
Function
(
t
)
t
.
IndexOf
(
"#Disable Warning"
,
StringComparison
.
Ordinal
)
>=
0
)
End
Function
<
Import
(
NameOf
(
VisualBasicSyntaxFactsServiceFactory
.
VisualBasicSyntaxFactsService
))
>
Private
Property
_Facts
As
VisualBasicSyntaxFactsServiceFactory
.
VisualBasicSyntaxFactsService
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsSuppression
)
>
Public
Async
Function
TestSuppressionWithAttributeOnEveryNodes
()
As
Threading
.
Tasks
.
Task
Await
TestSuppressionWithAttributeAsync
(
TestResource
.
AllInOneVisualBasicCode
,
VisualBasicParseOptions
.
Default
,
digInto
:
=
Function
(
n
)
Dim
member
=
_Facts
.
GetContainingMemberDeclaration
(
n
,
n
.
Span
.
Start
)
Dim
member
=
VisualBasicSyntaxFactsServiceFactory
.
GetService
.
GetContainingMemberDeclaration
(
n
,
n
.
Span
.
Start
)
If
member
Is
Nothing
OrElse
member
Is
n
Then
Return
True
End
If
...
...
src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.cs
浏览文件 @
00f36c3c
...
...
@@ -192,6 +192,7 @@ private async Task<SuppressionTargetInfo> GetSuppressionTargetInfoAsync(Document
var
nodeWithTokens
=
GetNodeWithTokens
(
startToken
,
endToken
,
root
);
var
semanticModel
=
await
document
.
GetSemanticModelAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
syntaxFacts
=
document
.
GetLanguageService
<
ISyntaxFactsService
>();
ISymbol
targetSymbol
=
null
;
...
...
src/Workspaces/VisualBasic/Portable/Extensions/SyntaxTokenExtensions.vb
浏览文件 @
00f36c3c
...
...
@@ -238,8 +238,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions
token
)
End
Function
<
Import
(
NameOf
(
VisualBasicSyntaxFactsServiceFactory
.
VisualBasicSyntaxFactsService
))
>
Private
Property
_Facts
As
VisualBasicSyntaxFactsServiceFactory
.
VisualBasicSyntaxFactsService
Private
ReadOnly
Property
_Facts
As
VisualBasicSyntaxFactsServiceFactory
.
VisualBasicSyntaxFactsService
=
VisualBasicSyntaxFactsServiceFactory
.
GetService
<
Extension
>
Public
Function
IsWord
(
token
As
SyntaxToken
)
As
Boolean
...
...
src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxFactsService.vb
浏览文件 @
00f36c3c
...
...
@@ -16,28 +16,29 @@ Imports Microsoft.CodeAnalysis.VisualBasic.SyntaxFacts
Namespace
Microsoft.CodeAnalysis.VisualBasic
<
ExportLanguageServiceFactory
(
GetType
(
I
LanguageServiceFactory
),
LanguageNames
.
VisualBasic
),
[
Shared
]
>
<
ExportLanguageServiceFactory
(
GetType
(
I
SyntaxFactsService
),
LanguageNames
.
VisualBasic
),
[
Shared
]
>
Public
Class
VisualBasicSyntaxFactsServiceFactory
Implements
ILanguageServiceFactory
Private
Shared
ReadOnly
Property
Instance
As
New
VisualBasicSyntaxFactsService
Public
Sub
New
()
End
Sub
Public
Function
CreateLanguageService
(
languageServices
As
HostLanguageServices
)
As
ILanguageService
Implements
ILanguageServiceFactory
.
CreateLanguageService
Return
New
VisualBasicSyntaxFactsService
(
languageServices
)
Return
Instance
End
Function
Friend
Shared
Function
GetService
()
As
VisualBasicSyntaxFactsService
Return
Instance
End
Function
<
ExportLanguageService
(
GetType
(
ISyntaxFactsService
),
LanguageNames
.
VisualBasic
),
[
Shared
]
>
Friend
Class
VisualBasicSyntaxFactsService
Inherits
AbstractSyntaxFactsService
Implements
ISyntaxFactsService
Implements
ISyntaxFactsService
,
ILanguageService
Friend
Sub
New
(
LanguageService
As
HostLanguageServices
)
Me
.
LanguageServices
=
LanguageServices
Friend
Sub
New
()
End
Sub
Private
ReadOnly
Property
LanguageServices
As
HostLanguageServices
Public
Function
IsAwaitKeyword
(
token
As
SyntaxToken
)
As
Boolean
Implements
ISyntaxFactsService
.
IsAwaitKeyword
Return
token
.
Kind
=
SyntaxKind
.
AwaitKeyword
End
Function
...
...
src/Workspaces/VisualBasicTest/VisualBasicSyntaxFactsServiceTests.vb
浏览文件 @
00f36c3c
...
...
@@ -222,12 +222,11 @@ End Class"))
MarkupTestFile
.
GetSpan
(
markup
,
code
,
span
)
Dim
tree
=
SyntaxFactory
.
ParseSyntaxTree
(
code
)
Dim
node
=
tree
.
GetRoot
().
FindNode
(
span
)
Dim
service
=
_Facts
Dim
service
=
VisualBasicSyntaxFactsServiceFactory
.
GetService
Return
service
.
IsMethodLevelMember
(
node
)
End
Function
<
Import
(
GetType
(
Microsoft
.
CodeAnalysis
.
LanguageServices
.
ISyntaxFactsService
))
>
Private
Property
_Facts
As
VisualBasicSyntaxFactsServiceFactory
.
VisualBasicSyntaxFactsService
End
Class
End
Namespace
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录