Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
dafad662
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,发现更多精彩内容 >>
提交
dafad662
编写于
6月 07, 2016
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move method off of CompletionHelper.
上级
ea779ae5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
39 addition
and
44 deletion
+39
-44
src/EditorFeatures/Core/Extensibility/Completion/CompletionHelper.cs
...eatures/Core/Extensibility/Completion/CompletionHelper.cs
+0
-40
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Controller_TypeChar.cs
...ementation/IntelliSense/Completion/Controller_TypeChar.cs
+39
-4
未找到文件。
src/EditorFeatures/Core/Extensibility/Completion/CompletionHelper.cs
浏览文件 @
dafad662
...
...
@@ -375,46 +375,6 @@ private static bool TextTypedSoFarMatchesItem(CompletionItem item, char ch, stri
item
.
FilterText
.
StartsWith
(
textTypedWithChar
,
StringComparison
.
CurrentCultureIgnoreCase
);
}
/// <summary>
/// Returns true if the character typed should be used to filter the specified completion
/// item. A character will be checked to see if it should filter an item. If not, it will be
/// checked to see if it should commit that item. If it does neither, then completion will
/// be dismissed.
/// </summary>
public
virtual
bool
IsFilterCharacter
(
CompletionItem
item
,
char
ch
,
string
textTypedSoFar
)
{
// general rule: if the filtering text exactly matches the start of the item then it must be a filter character
if
(
TextTypedSoFarMatchesItem
(
item
,
ch
,
textTypedSoFar
))
{
return
false
;
}
foreach
(
var
rule
in
item
.
Rules
.
FilterCharacterRules
)
{
switch
(
rule
.
Kind
)
{
case
CharacterSetModificationKind
.
Add
:
if
(
rule
.
Characters
.
Contains
(
ch
))
{
return
true
;
}
continue
;
case
CharacterSetModificationKind
.
Remove
:
if
(
rule
.
Characters
.
Contains
(
ch
))
{
return
false
;
}
continue
;
case
CharacterSetModificationKind
.
Replace
:
return
rule
.
Characters
.
Contains
(
ch
);
}
}
return
false
;
}
private
static
StringComparison
GetComparision
(
bool
isCaseSensitive
)
{
return
isCaseSensitive
?
StringComparison
.
CurrentCulture
:
StringComparison
.
CurrentCultureIgnoreCase
;
...
...
src/EditorFeatures/Core/Implementation/IntelliSense/Completion/Controller_TypeChar.cs
浏览文件 @
dafad662
...
...
@@ -337,11 +337,46 @@ private bool IsFilterCharacter(char ch)
return
char
.
IsLetterOrDigit
(
ch
);
}
var
helper
=
GetCompletionHelper
();
if
(
helper
!=
null
)
var
filterText
=
GetCurrentFilterText
(
model
,
model
.
SelectedItem
.
Item
);
return
IsFilterCharacter
(
model
.
SelectedItem
.
Item
,
ch
,
filterText
);
}
private
static
bool
TextTypedSoFarMatchesItem
(
CompletionItem
item
,
char
ch
,
string
textTypedSoFar
)
{
var
textTypedWithChar
=
textTypedSoFar
+
ch
;
return
item
.
DisplayText
.
StartsWith
(
textTypedWithChar
,
StringComparison
.
CurrentCultureIgnoreCase
)
||
item
.
FilterText
.
StartsWith
(
textTypedWithChar
,
StringComparison
.
CurrentCultureIgnoreCase
);
}
private
bool
IsFilterCharacter
(
CompletionItem
item
,
char
ch
,
string
filterText
)
{
// general rule: if the filtering text exactly matches the start of the item then it must be a filter character
if
(
TextTypedSoFarMatchesItem
(
item
,
ch
,
textTypedSoFar
:
filterText
))
{
var
filterText
=
GetCurrentFilterText
(
model
,
model
.
SelectedItem
.
Item
);
return
helper
.
IsFilterCharacter
(
model
.
SelectedItem
.
Item
,
ch
,
filterText
);
return
false
;
}
foreach
(
var
rule
in
item
.
Rules
.
FilterCharacterRules
)
{
switch
(
rule
.
Kind
)
{
case
CharacterSetModificationKind
.
Add
:
if
(
rule
.
Characters
.
Contains
(
ch
))
{
return
true
;
}
continue
;
case
CharacterSetModificationKind
.
Remove
:
if
(
rule
.
Characters
.
Contains
(
ch
))
{
return
false
;
}
continue
;
case
CharacterSetModificationKind
.
Replace
:
return
rule
.
Characters
.
Contains
(
ch
);
}
}
return
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录