Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
b49a7117
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,发现更多精彩内容 >>
提交
b49a7117
编写于
5月 01, 2015
作者:
D
David Poeschl
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2361 from dpoeschl/RenameStringsInInterpolations
Rename in interpolated strings
上级
ab30f1c7
065d323c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
8 deletion
+26
-8
src/EditorFeatures/Test2/Rename/InlineRenameTests.vb
src/EditorFeatures/Test2/Rename/InlineRenameTests.vb
+8
-2
src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxFactsService.cs
...arp/Portable/LanguageServices/CSharpSyntaxFactsService.cs
+1
-1
src/Workspaces/CSharp/Portable/Rename/CSharpRenameRewriterLanguageService.cs
...rp/Portable/Rename/CSharpRenameRewriterLanguageService.cs
+10
-2
src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxFactsService.vb
...ortable/LanguageServices/VisualBasicSyntaxFactsService.vb
+1
-1
src/Workspaces/VisualBasic/Portable/Rename/VisualBasicRenameRewriterLanguageService.vb
...rtable/Rename/VisualBasicRenameRewriterLanguageService.vb
+6
-2
未找到文件。
src/EditorFeatures/Test2/Rename/InlineRenameTests.vb
浏览文件 @
b49a7117
...
...
@@ -313,7 +313,7 @@ public partial class C { }
<
Fact
>
<
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Rename
)
>
<
WorkItem
(
700923
),
WorkItem
(
700925
)
>
<
WorkItem
(
700923
),
WorkItem
(
700925
)
,
WorkItem
(
1486
,
"https://github.com/dotnet/roslyn/issues/1486"
)
>
Public
Sub
RenameInCommentsAndStringsCSharp
()
Dim
workspace
=
CreateWorkspaceWithWaiter
(
<
Workspace
>
...
...
@@ -330,6 +330,7 @@ class Program
[|
foo
|]
()
;
var
a
=
"foo"
;
var
b
=
$
"{1}foo{2}"
;
}
public
void
foo
(
int
i
)
...
...
@@ -358,6 +359,7 @@ class Program
[|
foo
|]
()
;
var
a
=
"foo"
;
var
b
=
$
"{1}foo{2}"
;
}
public
void
[|
foo
|]
(
int
i
)
...
...
@@ -386,6 +388,7 @@ class Program
[|
foo
|]
()
;
var
a
=
"[|foo|]"
;
var
b
=
$
"{1}[|foo|]{2}"
;
}
public
void
foo
(
int
i
)
...
...
@@ -402,7 +405,7 @@ class Program
<
Fact
>
<
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Rename
)
>
<
WorkItem
(
700923
),
WorkItem
(
700925
)
>
<
WorkItem
(
700923
),
WorkItem
(
700925
)
,
WorkItem
(
1486
,
"https://github.com/dotnet/roslyn/issues/1486"
)
>
Public
Sub
RenameInCommentsAndStringsVisualBasic
()
Dim
workspace
=
CreateWorkspaceWithWaiter
(
<
Workspace
>
...
...
@@ -417,6 +420,7 @@ Class Program
[|
foo
|]
()
Dim
a
=
"foo"
Dim
b
=
$
"{1}foo{2}"
End
Sub
Public
Sub
foo
(
i
As
Integer
)
...
...
@@ -443,6 +447,7 @@ Class Program
[|
foo
|]
()
Dim
a
=
"foo"
Dim
b
=
$
"{1}foo{2}"
End
Sub
Public
Sub
[|
foo
|]
(
i
As
Integer
)
...
...
@@ -469,6 +474,7 @@ Class Program
[|
foo
|]
()
Dim
a
=
"[|foo|]"
Dim
b
=
$
"{1}[|foo|]{2}"
End
Sub
Public
Sub
foo
(
i
As
Integer
)
...
...
src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxFactsService.cs
浏览文件 @
b49a7117
...
...
@@ -462,7 +462,7 @@ public bool IsLiteral(SyntaxToken token)
public
bool
IsStringLiteral
(
SyntaxToken
token
)
{
return
token
.
IsKind
(
SyntaxKind
.
StringLiteralToken
);
return
token
.
IsKind
(
SyntaxKind
.
StringLiteralToken
,
SyntaxKind
.
InterpolatedStringTextToken
);
}
public
bool
IsTypeNamedVarInVariableOrFieldDeclaration
(
SyntaxToken
token
,
SyntaxNode
parent
)
...
...
src/Workspaces/CSharp/Portable/Rename/CSharpRenameRewriterLanguageService.cs
浏览文件 @
b49a7117
...
...
@@ -655,9 +655,17 @@ private SyntaxToken RenameWithinToken(SyntaxToken oldToken, SyntaxToken newToken
return
newToken
;
}
if
(
_isRenamingInStrings
&&
newToken
.
IsKind
(
SyntaxKind
.
StringLiteralToken
)
)
if
(
_isRenamingInStrings
)
{
newToken
=
RenameInStringLiteral
(
oldToken
,
newToken
,
SyntaxFactory
.
Literal
);
if
(
newToken
.
IsKind
(
SyntaxKind
.
StringLiteralToken
))
{
newToken
=
RenameInStringLiteral
(
oldToken
,
newToken
,
SyntaxFactory
.
Literal
);
}
else
if
(
newToken
.
IsKind
(
SyntaxKind
.
InterpolatedStringTextToken
))
{
newToken
=
RenameInStringLiteral
(
oldToken
,
newToken
,
(
leadingTrivia
,
text
,
value
,
trailingTrivia
)
=>
SyntaxFactory
.
Token
(
newToken
.
LeadingTrivia
,
SyntaxKind
.
InterpolatedStringTextToken
,
text
,
value
,
newToken
.
TrailingTrivia
));
}
}
if
(
_isRenamingInComments
)
...
...
src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxFactsService.vb
浏览文件 @
b49a7117
...
...
@@ -407,7 +407,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End
Function
Public
Function
IsStringLiteral
(
token
As
SyntaxToken
)
As
Boolean
Implements
ISyntaxFactsService
.
IsStringLiteral
Return
CType
(
token
.
Kind
,
SyntaxKind
)
=
SyntaxKind
.
StringLiteralToken
Return
token
.
IsKind
(
SyntaxKind
.
StringLiteralToken
,
SyntaxKind
.
InterpolatedStringTextToken
)
End
Function
Public
Function
IsBindableToken
(
token
As
Microsoft
.
CodeAnalysis
.
SyntaxToken
)
As
Boolean
Implements
ISyntaxFactsService
.
IsBindableToken
...
...
src/Workspaces/VisualBasic/Portable/Rename/VisualBasicRenameRewriterLanguageService.vb
浏览文件 @
b49a7117
...
...
@@ -585,8 +585,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Rename
Return
newToken
End
If
If
Me
.
_isRenamingInStrings
AndAlso
newToken
.
Kind
=
SyntaxKind
.
StringLiteralToken
Then
newToken
=
RenameInStringLiteral
(
oldToken
,
newToken
,
AddressOf
SyntaxFactory
.
StringLiteralToken
)
If
Me
.
_isRenamingInStrings
Then
If
newToken
.
Kind
=
SyntaxKind
.
StringLiteralToken
Then
newToken
=
RenameInStringLiteral
(
oldToken
,
newToken
,
AddressOf
SyntaxFactory
.
StringLiteralToken
)
ElseIf
newToken
.
Kind
=
SyntaxKind
.
InterpolatedStringTextToken
Then
newToken
=
RenameInStringLiteral
(
oldToken
,
newToken
,
AddressOf
SyntaxFactory
.
InterpolatedStringTextToken
)
End
If
End
If
If
Me
.
_isRenamingInComments
Then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录