Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
f0fc524f
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,发现更多精彩内容 >>
提交
f0fc524f
编写于
2月 23, 2017
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More formatting work.
上级
74c477c8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
7 deletion
+22
-7
src/Features/Core/Portable/GenerateConstructorFromMembers/GenerateConstructorFromMembersCodeRefactoringProvider.cs
.../GenerateConstructorFromMembersCodeRefactoringProvider.cs
+1
-0
src/Features/Core/Portable/GenerateEqualsAndGetHashCodeFromMembers/FormatLargeBinaryExpressionRule.cs
...GetHashCodeFromMembers/FormatLargeBinaryExpressionRule.cs
+12
-7
src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxFactsService.cs
...arp/Portable/LanguageServices/CSharpSyntaxFactsService.cs
+3
-0
src/Workspaces/Core/Portable/LanguageServices/SyntaxFactsService/ISyntaxFactsService.cs
...anguageServices/SyntaxFactsService/ISyntaxFactsService.cs
+2
-0
src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxFactsService.vb
...ortable/LanguageServices/VisualBasicSyntaxFactsService.vb
+4
-0
未找到文件。
src/Features/Core/Portable/GenerateConstructorFromMembers/GenerateConstructorFromMembersCodeRefactoringProvider.cs
浏览文件 @
f0fc524f
...
...
@@ -18,6 +18,7 @@ namespace Microsoft.CodeAnalysis.GenerateConstructorFromMembers
[
ExportCodeRefactoringProvider
(
LanguageNames
.
CSharp
,
LanguageNames
.
VisualBasic
,
Name
=
PredefinedCodeRefactoringProviderNames
.
GenerateConstructorFromMembers
),
Shared
]
[
ExtensionOrder
(
Before
=
PredefinedCodeRefactoringProviderNames
.
AddConstructorParametersFromMembers
)]
[
ExtensionOrder
(
Before
=
PredefinedCodeRefactoringProviderNames
.
GenerateEqualsAndGetHashCodeFromMembers
)]
internal
partial
class
GenerateConstructorFromMembersCodeRefactoringProvider
:
AbstractGenerateFromMembersCodeRefactoringProvider
{
public
override
async
Task
ComputeRefactoringsAsync
(
CodeRefactoringContext
context
)
...
...
src/Features/Core/Portable/GenerateEqualsAndGetHashCodeFromMembers/FormatLargeBinaryExpressionRule.cs
浏览文件 @
f0fc524f
...
...
@@ -37,13 +37,18 @@ public FormatLargeBinaryExpressionRule(ISyntaxFactsService syntaxFacts)
{
if
(
_syntaxFacts
.
IsReturnStatement
(
node
))
{
list
.
Add
(
FormattingOperations
.
CreateRelativeIndentBlockOperation
(
node
.
GetFirstToken
(),
node
.
GetFirstToken
().
GetNextToken
(),
node
.
GetLastToken
(),
indentationDelta
:
1
,
option
:
IndentBlockOption
.
RelativePosition
));
return
;
var
expr
=
_syntaxFacts
.
GetExpressionOfReturnStatement
(
node
);
if
(
expr
!=
null
)
{
list
.
Add
(
FormattingOperations
.
CreateRelativeIndentBlockOperation
(
expr
.
GetFirstToken
(),
expr
.
GetFirstToken
(),
node
.
GetLastToken
(),
indentationDelta
:
0
,
option
:
IndentBlockOption
.
RelativePosition
));
return
;
}
}
nextOperation
.
Invoke
(
list
);
...
...
src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxFactsService.cs
浏览文件 @
f0fc524f
...
...
@@ -236,6 +236,9 @@ public bool IsUsingStatement(SyntaxNode node)
public
bool
IsReturnStatement
(
SyntaxNode
node
)
=>
node
.
Kind
()
==
SyntaxKind
.
ReturnStatement
;
public
SyntaxNode
GetExpressionOfReturnStatement
(
SyntaxNode
node
)
=>
(
node
as
ReturnStatementSyntax
)?.
Expression
;
public
bool
IsThisConstructorInitializer
(
SyntaxToken
token
)
{
return
token
.
Parent
.
IsKind
(
SyntaxKind
.
ThisConstructorInitializer
)
&&
...
...
src/Workspaces/Core/Portable/LanguageServices/SyntaxFactsService/ISyntaxFactsService.cs
浏览文件 @
f0fc524f
...
...
@@ -165,7 +165,9 @@ internal interface ISyntaxFactsService : ILanguageService
bool
IsForEachStatement
(
SyntaxNode
node
);
bool
IsLockStatement
(
SyntaxNode
node
);
bool
IsUsingStatement
(
SyntaxNode
node
);
bool
IsReturnStatement
(
SyntaxNode
node
);
SyntaxNode
GetExpressionOfReturnStatement
(
SyntaxNode
node
);
bool
IsLocalDeclarationStatement
(
SyntaxNode
node
);
bool
IsDeclaratorOfLocalDeclarationStatement
(
SyntaxNode
declator
,
SyntaxNode
localDeclarationStatement
);
...
...
src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxFactsService.vb
浏览文件 @
f0fc524f
...
...
@@ -212,6 +212,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return
node
.
Kind
()
=
SyntaxKind
.
ReturnStatement
End
Function
Public
Function
GetExpressionOfReturnStatement
(
node
As
SyntaxNode
)
As
SyntaxNode
Implements
ISyntaxFactsService
.
GetExpressionOfReturnStatement
Return
TryCast
(
node
,
ReturnStatementSyntax
)
?
.
Expression
End
Function
Public
Function
IsThisConstructorInitializer
(
token
As
SyntaxToken
)
As
Boolean
Implements
ISyntaxFactsService
.
IsThisConstructorInitializer
If
TypeOf
token
.
Parent
Is
IdentifierNameSyntax
AndAlso
token
.
HasMatchingText
(
SyntaxKind
.
NewKeyword
)
Then
Dim
memberAccess
=
TryCast
(
token
.
Parent
.
Parent
,
MemberAccessExpressionSyntax
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录