Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
58dabd0b
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,发现更多精彩内容 >>
提交
58dabd0b
编写于
5月 27, 2015
作者:
R
Ravi Chande
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3122 from rchande/stabilization
Port VB filtering changes (#3088)
上级
b041933a
486c4c7e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
65 addition
and
5 deletion
+65
-5
src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests.vb
.../IntelliSense/VisualBasicCompletionCommandHandlerTests.vb
+20
-0
src/Features/Core/Completion/AbstractCompletionService.CompletionRules.cs
...e/Completion/AbstractCompletionService.CompletionRules.cs
+6
-1
src/Features/Core/Shared/Utilities/PatternMatch.cs
src/Features/Core/Shared/Utilities/PatternMatch.cs
+4
-4
src/Features/VisualBasic/Completion/VisualBasicCompletionRules.vb
...ures/VisualBasic/Completion/VisualBasicCompletionRules.vb
+35
-0
未找到文件。
src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests.vb
浏览文件 @
58dabd0b
...
...
@@ -2123,5 +2123,25 @@ Class C
state
.
AssertNoCompletionSession
()
End
Using
End
Sub
<
WorkItem
(
3088
,
"https://github.com/dotnet/roslyn/issues/3088"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)
>
Public
Sub
DoNotPreferParameterNames
()
Using
state
=
TestState
.
CreateVisualBasicTestState
(
<
Document
><
!
[
CDATA
[
Module
Program
Sub
Main
(
args
As
String
())
Dim
Table
As
Integer
foo
(
table$
$
)
End
Sub
Sub
foo
(
table
As
String
)
End
Sub
End
Module
]]
></
Document
>
)
state
.
SendInvokeCompletionList
()
state
.
AssertSelectedCompletionItem
(
"Table"
)
End
Using
End
Sub
End
Class
End
Namespace
src/Features/Core/Completion/AbstractCompletionService.CompletionRules.cs
浏览文件 @
58dabd0b
...
...
@@ -80,7 +80,7 @@ private bool IsAllDigits(string filterText)
if
(
match1
!=
null
&&
match2
!=
null
)
{
var
result
=
match1
.
Value
.
CompareTo
(
match2
.
Value
);
var
result
=
CompareMatches
(
match1
.
Value
,
match2
.
Value
,
item1
,
item2
);
if
(
result
!=
0
)
{
return
result
<
0
;
...
...
@@ -118,6 +118,11 @@ private bool IsAllDigits(string filterText)
return
item1MRUIndex
<
item2MRUIndex
;
}
protected
virtual
int
CompareMatches
(
PatternMatch
match1
,
PatternMatch
match2
,
CompletionItem
item1
,
CompletionItem
item2
)
{
return
match1
.
CompareTo
(
match2
);
}
public
virtual
bool
?
ShouldSoftSelectItem
(
CompletionItem
item
,
string
filterText
,
CompletionTriggerInfo
triggerInfo
)
{
return
filterText
.
Length
==
0
&&
!
item
.
Preselect
;
...
...
src/Features/Core/Shared/Utilities/PatternMatch.cs
浏览文件 @
58dabd0b
...
...
@@ -51,7 +51,7 @@ public int CompareTo(PatternMatch other)
return
0
;
}
private
int
ComparePunctuation
(
PatternMatch
result1
,
PatternMatch
result2
)
internal
static
int
ComparePunctuation
(
PatternMatch
result1
,
PatternMatch
result2
)
{
// Consider a match to be better if it was successful without stripping punctuation
// versus a match that had to strip punctuation to succeed.
...
...
@@ -63,7 +63,7 @@ private int ComparePunctuation(PatternMatch result1, PatternMatch result2)
return
0
;
}
private
static
int
CompareCase
(
PatternMatch
result1
,
PatternMatch
result2
)
internal
static
int
CompareCase
(
PatternMatch
result1
,
PatternMatch
result2
)
{
if
(
result1
.
IsCaseSensitive
!=
result2
.
IsCaseSensitive
)
{
...
...
@@ -73,12 +73,12 @@ private static int CompareCase(PatternMatch result1, PatternMatch result2)
return
0
;
}
private
static
int
CompareType
(
PatternMatch
result1
,
PatternMatch
result2
)
internal
static
int
CompareType
(
PatternMatch
result1
,
PatternMatch
result2
)
{
return
result1
.
Kind
-
result2
.
Kind
;
}
private
static
int
CompareCamelCase
(
PatternMatch
result1
,
PatternMatch
result2
)
internal
static
int
CompareCamelCase
(
PatternMatch
result1
,
PatternMatch
result2
)
{
if
(
result1
.
Kind
==
PatternMatchKind
.
CamelCase
&&
result2
.
Kind
==
PatternMatchKind
.
CamelCase
)
{
...
...
src/Features/VisualBasic/Completion/VisualBasicCompletionRules.vb
浏览文件 @
58dabd0b
...
...
@@ -14,6 +14,41 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion
MyBase
.
New
(
service
)
End
Sub
Protected
Overrides
Function
CompareMatches
(
leftMatch
As
PatternMatch
,
rightMatch
As
PatternMatch
,
leftItem
As
CompletionItem
,
rightItem
As
CompletionItem
)
As
Integer
Dim
diff
As
Integer
diff
=
PatternMatch
.
CompareType
(
leftMatch
,
rightMatch
)
If
diff
<>
0
Then
Return
diff
End
If
diff
=
PatternMatch
.
CompareCamelCase
(
leftMatch
,
rightMatch
)
If
diff
<>
0
Then
Return
diff
End
If
' More important than the case sensitivity is that "left" isn't an argument name
Dim
leftIsNamedArgument
=
TypeOf
leftItem
.
CompletionProvider
Is
NamedParameterCompletionProvider
Dim
rightIsNamedArgument
=
TypeOf
rightItem
.
CompletionProvider
Is
NamedParameterCompletionProvider
If
leftIsNamedArgument
AndAlso
Not
rightIsNamedArgument
Then
Return
1
End
If
If
rightIsNamedArgument
AndAlso
Not
leftIsNamedArgument
Then
Return
-
1
End
If
diff
=
PatternMatch
.
CompareCase
(
leftMatch
,
rightMatch
)
If
diff
<>
0
Then
Return
diff
End
If
diff
=
PatternMatch
.
ComparePunctuation
(
leftMatch
,
rightMatch
)
If
diff
<>
0
Then
Return
diff
End
If
Return
0
End
Function
Public
Overrides
Function
IsBetterFilterMatch
(
item1
As
CompletionItem
,
item2
As
CompletionItem
,
filterText
As
String
,
triggerInfo
As
CompletionTriggerInfo
,
filterReason
As
CompletionFilterReason
)
As
Boolean
?
If
filterReason
=
CompletionFilterReason
.
BackspaceOrDelete
Then
Dim
prefixLength1
=
GetPrefixLength
(
item1
.
FilterText
,
filterText
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录