Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
a25b0499
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,发现更多精彩内容 >>
提交
a25b0499
编写于
2月 08, 2020
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Simplify by moving to extensions
上级
f71ac339
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
23 addition
and
21 deletion
+23
-21
src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxFactsService.cs
...arp/Portable/LanguageServices/CSharpSyntaxFactsService.cs
+0
-6
src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxKindsService.cs
...arp/Portable/LanguageServices/CSharpSyntaxKindsService.cs
+1
-0
src/Workspaces/Core/Portable/LanguageServices/SyntaxFactsService/AbstractSyntaxFactsService.cs
...Services/SyntaxFactsService/AbstractSyntaxFactsService.cs
+6
-2
src/Workspaces/Core/Portable/LanguageServices/SyntaxFactsService/ISyntaxFactsService.cs
...anguageServices/SyntaxFactsService/ISyntaxFactsService.cs
+0
-2
src/Workspaces/Core/Portable/LanguageServices/SyntaxFactsService/ISyntaxFactsServiceExtensions.cs
...vices/SyntaxFactsService/ISyntaxFactsServiceExtensions.cs
+13
-3
src/Workspaces/Core/Portable/LanguageServices/SyntaxFactsService/ISyntaxKindsService.cs
...anguageServices/SyntaxFactsService/ISyntaxKindsService.cs
+2
-0
src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxFactsService.vb
...ortable/LanguageServices/VisualBasicSyntaxFactsService.vb
+0
-8
src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxKindsService.vb
...ortable/LanguageServices/VisualBasicSyntaxKindsService.vb
+1
-0
未找到文件。
src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxFactsService.cs
浏览文件 @
a25b0499
...
...
@@ -1529,12 +1529,6 @@ public SyntaxToken GetOperatorTokenOfPrefixUnaryExpression(SyntaxNode node)
public
SyntaxNode
GetNextExecutableStatement
(
SyntaxNode
statement
)
=>
((
StatementSyntax
)
statement
).
GetNextStatement
();
public
override
bool
IsWhitespaceTrivia
(
SyntaxTrivia
trivia
)
=>
trivia
.
IsWhitespace
();
public
override
bool
IsEndOfLineTrivia
(
SyntaxTrivia
trivia
)
=>
trivia
.
IsEndOfLine
();
public
override
bool
IsSingleLineCommentTrivia
(
SyntaxTrivia
trivia
)
=>
trivia
.
IsSingleLineComment
();
...
...
src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxKindsService.cs
浏览文件 @
a25b0499
...
...
@@ -24,6 +24,7 @@ public override TSyntaxKind Convert<TSyntaxKind>(int kind)
public
override
int
DisabledTextTrivia
=>
(
int
)
SyntaxKind
.
DisabledTextTrivia
;
public
override
int
EndOfLineTrivia
=>
(
int
)
SyntaxKind
.
EndOfLineTrivia
;
public
override
int
SkippedTokensTrivia
=>
(
int
)
SyntaxKind
.
SkippedTokensTrivia
;
public
override
int
WhitespaceTrivia
=>
(
int
)
SyntaxKind
.
WhitespaceTrivia
;
public
override
int
CharacterLiteralToken
=>
(
int
)
SyntaxKind
.
CharacterLiteralToken
;
public
override
int
DotToken
=>
(
int
)
SyntaxKind
.
DotToken
;
...
...
src/Workspaces/Core/Portable/LanguageServices/SyntaxFactsService/AbstractSyntaxFactsService.cs
浏览文件 @
a25b0499
...
...
@@ -158,8 +158,12 @@ protected AbstractSyntaxFactsService()
Matcher
.
Repeat
(
singleBlankLine
));
}
public
abstract
bool
IsWhitespaceTrivia
(
SyntaxTrivia
trivia
);
public
abstract
bool
IsEndOfLineTrivia
(
SyntaxTrivia
trivia
);
private
bool
IsWhitespaceTrivia
(
SyntaxTrivia
trivia
)
=>
SyntaxKinds
.
WhitespaceTrivia
==
trivia
.
RawKind
;
private
bool
IsEndOfLineTrivia
(
SyntaxTrivia
trivia
)
=>
SyntaxKinds
.
EndOfLineTrivia
==
trivia
.
RawKind
;
public
abstract
bool
IsSingleLineCommentTrivia
(
SyntaxTrivia
trivia
);
public
abstract
bool
IsMultiLineCommentTrivia
(
SyntaxTrivia
trivia
);
public
abstract
bool
IsSingleLineDocCommentTrivia
(
SyntaxTrivia
trivia
);
...
...
src/Workspaces/Core/Portable/LanguageServices/SyntaxFactsService/ISyntaxFactsService.cs
浏览文件 @
a25b0499
...
...
@@ -201,8 +201,6 @@ internal interface ISyntaxFactsService : ILanguageService
SyntaxNode
GetDefaultOfParameter
(
SyntaxNode
node
);
SyntaxNode
GetParameterList
(
SyntaxNode
node
);
bool
IsWhitespaceTrivia
(
SyntaxTrivia
trivia
);
bool
IsEndOfLineTrivia
(
SyntaxTrivia
trivia
);
bool
IsDocumentationCommentExteriorTrivia
(
SyntaxTrivia
trivia
);
void
GetPartsOfElementAccessExpression
(
SyntaxNode
node
,
out
SyntaxNode
expression
,
out
SyntaxNode
argumentList
);
...
...
src/Workspaces/Core/Portable/LanguageServices/SyntaxFactsService/ISyntaxFactsServiceExtensions.cs
浏览文件 @
a25b0499
...
...
@@ -187,6 +187,17 @@ public static void GetPartsOfMemberAccessExpression(this ISyntaxFactsService syn
public
static
void
GetPartsOfConditionalAccessExpression
(
this
ISyntaxFactsService
syntaxFacts
,
SyntaxNode
node
,
out
SyntaxNode
expression
,
out
SyntaxNode
whenNotNull
)
=>
syntaxFacts
.
GetPartsOfConditionalAccessExpression
(
node
,
out
expression
,
out
_
,
out
whenNotNull
);
#
region
ISyntaxKinds
forwarding
methods
public
static
bool
IsEndOfLineTrivia
(
this
ISyntaxFactsService
syntaxFacts
,
SyntaxTrivia
trivia
)
=>
trivia
.
RawKind
==
syntaxFacts
.
SyntaxKinds
.
EndOfLineTrivia
;
public
static
bool
IsWhitespaceTrivia
(
this
ISyntaxFactsService
syntaxFacts
,
SyntaxTrivia
trivia
)
=>
trivia
.
RawKind
==
syntaxFacts
.
SyntaxKinds
.
WhitespaceTrivia
;
public
static
bool
IsSkippedTokensTrivia
(
this
ISyntaxFactsService
syntaxFacts
,
[
NotNullWhen
(
true
)]
SyntaxNode
?
node
)
=>
node
?.
RawKind
==
syntaxFacts
.
SyntaxKinds
.
SkippedTokensTrivia
;
public
static
bool
IsAwaitKeyword
(
this
ISyntaxFactsService
syntaxFacts
,
SyntaxToken
token
)
=>
token
.
RawKind
==
syntaxFacts
.
SyntaxKinds
.
AwaitKeyword
;
...
...
@@ -208,9 +219,6 @@ public static bool IsInterpolatedStringTextToken(this ISyntaxFactsService syntax
public
static
bool
IsStringLiteral
(
this
ISyntaxFactsService
syntaxFacts
,
SyntaxToken
token
)
=>
token
.
RawKind
==
syntaxFacts
.
SyntaxKinds
.
StringLiteralToken
;
public
static
bool
IsSkippedTokensTrivia
(
this
ISyntaxFactsService
syntaxFacts
,
[
NotNullWhen
(
true
)]
SyntaxNode
?
node
)
=>
node
?.
RawKind
==
syntaxFacts
.
SyntaxKinds
.
SkippedTokensTrivia
;
public
static
bool
IsGenericName
(
this
ISyntaxFactsService
syntaxFacts
,
[
NotNullWhen
(
true
)]
SyntaxNode
?
node
)
=>
node
?.
RawKind
==
syntaxFacts
.
SyntaxKinds
.
GenericName
;
...
...
@@ -309,5 +317,7 @@ public static bool IsVariableDeclarator(this ISyntaxFactsService syntaxFacts, [N
public
static
bool
IsTypeArgumentList
(
this
ISyntaxFactsService
syntaxFacts
,
[
NotNullWhen
(
true
)]
SyntaxNode
node
)
=>
node
?.
RawKind
==
syntaxFacts
.
SyntaxKinds
.
TypeArgumentList
;
#
endregion
}
}
src/Workspaces/Core/Portable/LanguageServices/SyntaxFactsService/ISyntaxKindsService.cs
浏览文件 @
a25b0499
...
...
@@ -20,6 +20,7 @@ internal interface ISyntaxKindsService : ILanguageService
int
DisabledTextTrivia
{
get
;
}
int
EndOfLineTrivia
{
get
;
}
int
SkippedTokensTrivia
{
get
;
}
int
WhitespaceTrivia
{
get
;
}
int
CharacterLiteralToken
{
get
;
}
int
DotToken
{
get
;
}
...
...
@@ -98,6 +99,7 @@ internal abstract class AbstractSyntaxKindsService : ISyntaxKindsService
public
abstract
int
DisabledTextTrivia
{
get
;
}
public
abstract
int
EndOfLineTrivia
{
get
;
}
public
abstract
int
SkippedTokensTrivia
{
get
;
}
public
abstract
int
WhitespaceTrivia
{
get
;
}
public
abstract
int
CharacterLiteralToken
{
get
;
}
public
abstract
int
DotToken
{
get
;
}
...
...
src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxFactsService.vb
浏览文件 @
a25b0499
...
...
@@ -1567,14 +1567,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return
DirectCast
(
statement
,
StatementSyntax
).
GetNextStatement
()
?
.
FirstAncestorOrSelf
(
Of
ExecutableStatementSyntax
)
End
Function
Public
Overrides
Function
IsWhitespaceTrivia
(
trivia
As
SyntaxTrivia
)
As
Boolean
Implements
ISyntaxFactsService
.
IsWhitespaceTrivia
Return
trivia
.
IsWhitespace
()
End
Function
Public
Overrides
Function
IsEndOfLineTrivia
(
trivia
As
SyntaxTrivia
)
As
Boolean
Implements
ISyntaxFactsService
.
IsEndOfLineTrivia
Return
trivia
.
IsEndOfLine
()
End
Function
Public
Overrides
Function
IsSingleLineCommentTrivia
(
trivia
As
SyntaxTrivia
)
As
Boolean
Return
trivia
.
Kind
=
SyntaxKind
.
CommentTrivia
End
Function
...
...
src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxKindsService.vb
浏览文件 @
a25b0499
...
...
@@ -22,6 +22,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageServices
Public
Overrides
ReadOnly
Property
DisabledTextTrivia
As
Integer
=
SyntaxKind
.
DisabledTextTrivia
Public
Overrides
ReadOnly
Property
EndOfLineTrivia
As
Integer
=
SyntaxKind
.
EndOfLineTrivia
Public
Overrides
ReadOnly
Property
SkippedTokensTrivia
As
Integer
=
SyntaxKind
.
SkippedTokensTrivia
Public
Overrides
ReadOnly
Property
WhitespaceTrivia
As
Integer
=
SyntaxKind
.
WhitespaceTrivia
Public
Overrides
ReadOnly
Property
CharacterLiteralToken
As
Integer
=
SyntaxKind
.
CharacterLiteralToken
Public
Overrides
ReadOnly
Property
DotToken
As
Integer
=
SyntaxKind
.
DotToken
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录