Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
a7ed2071
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,发现更多精彩内容 >>
提交
a7ed2071
编写于
4月 21, 2020
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Push options down.
上级
1dee0682
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
19 addition
and
17 deletion
+19
-17
src/EditorFeatures/Core.Wpf/InlineRename/AbstractEditorInlineRenameService.SymbolRenameInfo.cs
...ame/AbstractEditorInlineRenameService.SymbolRenameInfo.cs
+3
-2
src/Features/Core/Portable/EncapsulateField/AbstractEncapsulateFieldService.cs
...table/EncapsulateField/AbstractEncapsulateFieldService.cs
+1
-1
src/Features/Core/Portable/UseAutoProperty/AbstractUseAutoPropertyCodeFixProvider.cs
...UseAutoProperty/AbstractUseAutoPropertyCodeFixProvider.cs
+1
-1
src/Workspaces/Core/Portable/Rename/RenameOptions.cs
src/Workspaces/Core/Portable/Rename/RenameOptions.cs
+6
-2
src/Workspaces/Core/Portable/Rename/Renamer.cs
src/Workspaces/Core/Portable/Rename/Renamer.cs
+6
-8
src/Workspaces/Core/Portable/SymbolKey/SymbolKey.BodyLevelSymbolKey.cs
...s/Core/Portable/SymbolKey/SymbolKey.BodyLevelSymbolKey.cs
+0
-1
src/Workspaces/Remote/ServiceHub/Services/CodeAnalysisService_Renamer.cs
...Remote/ServiceHub/Services/CodeAnalysisService_Renamer.cs
+2
-2
未找到文件。
src/EditorFeatures/Core.Wpf/InlineRename/AbstractEditorInlineRenameService.SymbolRenameInfo.cs
浏览文件 @
a7ed2071
...
...
@@ -208,7 +208,7 @@ public Task<IInlineRenameLocationSet> FindRenameLocationsAsync(OptionSet optionS
// If this is the first call, then just start finding the initial set of rename
// locations.
_underlyingFindRenameLocationsTask
=
Renamer
.
FindRenameLocationsAsync
(
_document
.
Project
.
Solution
,
this
.
RenameSymbol
,
RenameOptionSet
.
From
(
optionSet
)
,
cancellationToken
);
_document
.
Project
.
Solution
,
this
.
RenameSymbol
,
optionSet
,
cancellationToken
);
renameTask
=
_underlyingFindRenameLocationsTask
;
// null out the option set. We don't need it anymore, and this will ensure
...
...
@@ -231,7 +231,8 @@ private async Task<IInlineRenameLocationSet> GetLocationSetAsync(Task<RenameLoca
var
locationSet
=
await
renameTask
.
ConfigureAwait
(
false
);
if
(
optionSet
!=
null
)
{
locationSet
=
await
locationSet
.
FindWithUpdatedOptionsAsync
(
RenameOptionSet
.
From
(
optionSet
),
cancellationToken
).
ConfigureAwait
(
false
);
locationSet
=
await
locationSet
.
FindWithUpdatedOptionsAsync
(
RenameOptionSet
.
From
(
_document
.
Project
.
Solution
,
optionSet
),
cancellationToken
).
ConfigureAwait
(
false
);
}
return
new
InlineRenameLocationSet
(
this
,
locationSet
);
...
...
src/Features/Core/Portable/EncapsulateField/AbstractEncapsulateFieldService.cs
浏览文件 @
a7ed2071
...
...
@@ -281,7 +281,7 @@ private async Task<Result> EncapsulateFieldAsync(IFieldSymbol field, Document do
CancellationToken
cancellationToken
)
{
var
initialLocations
=
await
Renamer
.
FindRenameLocationsAsync
(
solution
,
field
,
RenameOptionSet
.
From
(
solution
.
Options
)
,
cancellationToken
).
ConfigureAwait
(
false
);
solution
,
field
,
optionSet
:
null
,
cancellationToken
).
ConfigureAwait
(
false
);
return
await
Renamer
.
RenameAsync
(
initialLocations
.
Filter
(
filter
),
finalName
,
...
...
src/Features/Core/Portable/UseAutoProperty/AbstractUseAutoPropertyCodeFixProvider.cs
浏览文件 @
a7ed2071
...
...
@@ -85,7 +85,7 @@ private async Task<Solution> ProcessResultAsync(CodeFixContext context, Diagnost
var
solution
=
context
.
Document
.
Project
.
Solution
;
var
fieldLocations
=
await
Renamer
.
FindRenameLocationsAsync
(
solution
,
fieldSymbol
,
RenameOptionSet
.
From
(
solution
.
Options
)
,
cancellationToken
).
ConfigureAwait
(
false
);
solution
,
fieldSymbol
,
optionSet
:
null
,
cancellationToken
).
ConfigureAwait
(
false
);
// First, create the updated property we want to replace the old property with
var
isWrittenToOutsideOfConstructor
=
IsWrittenToOutsideOfConstructorOrProperty
(
fieldSymbol
,
fieldLocations
,
property
,
cancellationToken
);
...
...
src/Workspaces/Core/Portable/Rename/RenameOptions.cs
浏览文件 @
a7ed2071
...
...
@@ -35,11 +35,15 @@ public RenameOptionSet(bool renameOverloads, bool renameInStrings, bool renameIn
RenameFile
=
renameFile
;
}
internal
static
RenameOptionSet
From
(
OptionSet
options
)
=>
new
RenameOptionSet
(
internal
static
RenameOptionSet
From
(
Solution
solution
,
OptionSet
options
)
{
options
??=
solution
.
Options
;
return
new
RenameOptionSet
(
options
.
GetOption
(
RenameOptions
.
RenameOverloads
),
options
.
GetOption
(
RenameOptions
.
RenameInStrings
),
options
.
GetOption
(
RenameOptions
.
RenameInComments
),
options
.
GetOption
(
RenameOptions
.
RenameFile
));
}
}
}
src/Workspaces/Core/Portable/Rename/Renamer.cs
浏览文件 @
a7ed2071
...
...
@@ -6,9 +6,7 @@
using
System.Collections.Immutable
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.Internal.Log
;
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Remote
;
using
Roslyn.Utilities
;
namespace
Microsoft.CodeAnalysis.Rename
...
...
@@ -32,14 +30,14 @@ public static class Renamer
optionSet
??=
solution
.
Options
;
var
renameOptions
=
RenameOptionSet
.
From
(
optionSet
);
return
RenameSymbolAsync
(
solution
,
symbol
,
newName
,
renameOptions
,
nonConflictSymbols
:
null
,
cancellationToken
);
return
RenameSymbolAsync
(
solution
,
symbol
,
newName
,
optionSet
,
nonConflictSymbols
:
null
,
cancellationToken
);
}
internal
static
Task
<
RenameLocations
>
FindRenameLocationsAsync
(
Solution
solution
,
ISymbol
symbol
,
RenameOptionSet
options
,
CancellationToken
cancellationToken
)
Solution
solution
,
ISymbol
symbol
,
OptionSet
optionSet
,
CancellationToken
cancellationToken
)
{
return
RenameLocations
.
FindLocationsAsync
(
symbol
,
solution
,
options
,
cancellationToken
);
return
RenameLocations
.
FindLocationsAsync
(
symbol
,
solution
,
RenameOptionSet
.
From
(
solution
,
optionSet
),
cancellationToken
);
}
internal
static
async
Task
<
Solution
>
RenameAsync
(
...
...
@@ -62,7 +60,7 @@ public static class Renamer
Solution
solution
,
ISymbol
symbol
,
string
newName
,
RenameOptionSet
options
,
OptionSet
optionSet
,
ImmutableHashSet
<
ISymbol
>
nonConflictSymbols
,
CancellationToken
cancellationToken
)
{
...
...
@@ -73,7 +71,7 @@ public static class Renamer
cancellationToken
.
ThrowIfCancellationRequested
();
var
renameLocations
=
await
FindRenameLocationsAsync
(
solution
,
symbol
,
option
s
,
cancellationToken
).
ConfigureAwait
(
false
);
var
renameLocations
=
await
FindRenameLocationsAsync
(
solution
,
symbol
,
option
Set
,
cancellationToken
).
ConfigureAwait
(
false
);
return
await
RenameAsync
(
renameLocations
,
newName
,
nonConflictSymbols
,
cancellationToken
).
ConfigureAwait
(
false
);
}
}
...
...
src/Workspaces/Core/Portable/SymbolKey/SymbolKey.BodyLevelSymbolKey.cs
浏览文件 @
a7ed2071
...
...
@@ -4,7 +4,6 @@
using
System.Collections.Generic
;
using
System.Threading
;
using
Microsoft.CodeAnalysis.Shared.Extensions
;
namespace
Microsoft.CodeAnalysis
{
...
...
src/Workspaces/Remote/ServiceHub/Services/CodeAnalysisService_Renamer.cs
浏览文件 @
a7ed2071
...
...
@@ -29,8 +29,8 @@ internal partial class CodeAnalysisService : IRemoteRenamer
if
(
symbol
==
null
)
return
null
;
var
result
=
await
Rename
r
.
FindRename
LocationsAsync
(
s
olution
,
symbol
,
options
.
Rehydrate
(),
cancellationToken
).
ConfigureAwait
(
false
);
var
result
=
await
Rename
Locations
.
Find
LocationsAsync
(
s
ymbol
,
solution
,
options
.
Rehydrate
(),
cancellationToken
).
ConfigureAwait
(
false
);
return
result
.
Dehydrate
(
solution
,
cancellationToken
);
}
},
cancellationToken
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录