Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6307df69
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6307df69
编写于
6月 04, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #50879
上级
4e047b55
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
10 deletion
+10
-10
src/vs/base/common/filters.ts
src/vs/base/common/filters.ts
+7
-5
src/vs/editor/contrib/suggest/completionModel.ts
src/vs/editor/contrib/suggest/completionModel.ts
+2
-2
src/vs/workbench/parts/outline/electron-browser/outlineModel.ts
.../workbench/parts/outline/electron-browser/outlineModel.ts
+1
-3
未找到文件。
src/vs/base/common/filters.ts
浏览文件 @
6307df69
...
@@ -341,7 +341,7 @@ export function matchesFuzzy(word: string, wordToMatchAgainst: string, enableSep
...
@@ -341,7 +341,7 @@ export function matchesFuzzy(word: string, wordToMatchAgainst: string, enableSep
return
enableSeparateSubstringMatching
?
fuzzySeparateFilter
(
word
,
wordToMatchAgainst
)
:
fuzzyContiguousFilter
(
word
,
wordToMatchAgainst
);
return
enableSeparateSubstringMatching
?
fuzzySeparateFilter
(
word
,
wordToMatchAgainst
)
:
fuzzyContiguousFilter
(
word
,
wordToMatchAgainst
);
}
}
export
function
skipScore
(
pattern
:
string
,
word
:
string
,
patternMaxWhitespaceIgnore
?:
number
):
[
number
,
number
[]]
{
export
function
anyScore
(
pattern
:
string
,
word
:
string
,
patternMaxWhitespaceIgnore
?:
number
):
FuzzyScore
{
pattern
=
pattern
.
toLowerCase
();
pattern
=
pattern
.
toLowerCase
();
word
=
word
.
toLowerCase
();
word
=
word
.
toLowerCase
();
...
@@ -452,7 +452,9 @@ function isWhitespaceAtPos(value: string, index: number): boolean {
...
@@ -452,7 +452,9 @@ function isWhitespaceAtPos(value: string, index: number): boolean {
const
enum
Arrow
{
Top
=
0b1
,
Diag
=
0b10
,
Left
=
0b100
}
const
enum
Arrow
{
Top
=
0b1
,
Diag
=
0b10
,
Left
=
0b100
}
export
function
fuzzyScore
(
pattern
:
string
,
word
:
string
,
patternMaxWhitespaceIgnore
?:
number
):
[
number
,
number
[]]
{
export
type
FuzzyScore
=
[
number
,
number
[]];
export
function
fuzzyScore
(
pattern
:
string
,
word
:
string
,
patternMaxWhitespaceIgnore
?:
number
):
FuzzyScore
{
const
patternLen
=
pattern
.
length
>
100
?
100
:
pattern
.
length
;
const
patternLen
=
pattern
.
length
>
100
?
100
:
pattern
.
length
;
const
wordLen
=
word
.
length
>
100
?
100
:
word
.
length
;
const
wordLen
=
word
.
length
>
100
?
100
:
word
.
length
;
...
@@ -715,15 +717,15 @@ class LazyArray {
...
@@ -715,15 +717,15 @@ class LazyArray {
//#region --- graceful ---
//#region --- graceful ---
export
function
fuzzyScoreGracefulAggressive
(
pattern
:
string
,
word
:
string
,
patternMaxWhitespaceIgnore
?:
number
):
[
number
,
number
[]]
{
export
function
fuzzyScoreGracefulAggressive
(
pattern
:
string
,
word
:
string
,
patternMaxWhitespaceIgnore
?:
number
):
FuzzyScore
{
return
fuzzyScoreWithPermutations
(
pattern
,
word
,
true
,
patternMaxWhitespaceIgnore
);
return
fuzzyScoreWithPermutations
(
pattern
,
word
,
true
,
patternMaxWhitespaceIgnore
);
}
}
export
function
fuzzyScoreGraceful
(
pattern
:
string
,
word
:
string
,
patternMaxWhitespaceIgnore
?:
number
):
[
number
,
number
[]]
{
export
function
fuzzyScoreGraceful
(
pattern
:
string
,
word
:
string
,
patternMaxWhitespaceIgnore
?:
number
):
FuzzyScore
{
return
fuzzyScoreWithPermutations
(
pattern
,
word
,
false
,
patternMaxWhitespaceIgnore
);
return
fuzzyScoreWithPermutations
(
pattern
,
word
,
false
,
patternMaxWhitespaceIgnore
);
}
}
function
fuzzyScoreWithPermutations
(
pattern
:
string
,
word
:
string
,
aggressive
?:
boolean
,
patternMaxWhitespaceIgnore
?:
number
):
[
number
,
number
[]]
{
function
fuzzyScoreWithPermutations
(
pattern
:
string
,
word
:
string
,
aggressive
?:
boolean
,
patternMaxWhitespaceIgnore
?:
number
):
FuzzyScore
{
let
top
:
[
number
,
number
[]]
=
fuzzyScore
(
pattern
,
word
,
patternMaxWhitespaceIgnore
);
let
top
:
[
number
,
number
[]]
=
fuzzyScore
(
pattern
,
word
,
patternMaxWhitespaceIgnore
);
if
(
top
&&
!
aggressive
)
{
if
(
top
&&
!
aggressive
)
{
...
...
src/vs/editor/contrib/suggest/completionModel.ts
浏览文件 @
6307df69
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
'
use strict
'
;
'
use strict
'
;
import
{
fuzzyScore
,
fuzzyScoreGracefulAggressive
,
skip
Score
}
from
'
vs/base/common/filters
'
;
import
{
fuzzyScore
,
fuzzyScoreGracefulAggressive
,
any
Score
}
from
'
vs/base/common/filters
'
;
import
{
isDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
isDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ISuggestResult
,
ISuggestSupport
}
from
'
vs/editor/common/modes
'
;
import
{
ISuggestResult
,
ISuggestSupport
}
from
'
vs/editor/common/modes
'
;
import
{
ISuggestionItem
,
SnippetConfig
}
from
'
./suggest
'
;
import
{
ISuggestionItem
,
SnippetConfig
}
from
'
./suggest
'
;
...
@@ -191,7 +191,7 @@ export class CompletionModel {
...
@@ -191,7 +191,7 @@ export class CompletionModel {
continue
;
continue
;
}
}
item
.
score
=
match
[
0
];
item
.
score
=
match
[
0
];
item
.
matches
=
skipScore
(
word
,
suggestion
.
label
)[
1
];
item
.
matches
=
(
fuzzyScore
(
word
,
suggestion
.
label
)
||
anyScore
(
word
,
suggestion
.
label
)
)[
1
];
}
else
{
}
else
{
// by default match `word` against the `label`
// by default match `word` against the `label`
...
...
src/vs/workbench/parts/outline/electron-browser/outlineModel.ts
浏览文件 @
6307df69
...
@@ -8,15 +8,13 @@ import { DocumentSymbolProviderRegistry, SymbolInformation, DocumentSymbolProvid
...
@@ -8,15 +8,13 @@ import { DocumentSymbolProviderRegistry, SymbolInformation, DocumentSymbolProvid
import
{
ITextModel
}
from
'
vs/editor/common/model
'
;
import
{
ITextModel
}
from
'
vs/editor/common/model
'
;
import
{
asWinJsPromise
}
from
'
vs/base/common/async
'
;
import
{
asWinJsPromise
}
from
'
vs/base/common/async
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
fuzzyScore
}
from
'
vs/base/common/filters
'
;
import
{
fuzzyScore
,
FuzzyScore
}
from
'
vs/base/common/filters
'
;
import
{
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
first
,
size
}
from
'
vs/base/common/collections
'
;
import
{
first
,
size
}
from
'
vs/base/common/collections
'
;
import
{
isFalsyOrEmpty
}
from
'
vs/base/common/arrays
'
;
import
{
isFalsyOrEmpty
}
from
'
vs/base/common/arrays
'
;
import
{
commonPrefixLength
}
from
'
vs/base/common/strings
'
;
import
{
commonPrefixLength
}
from
'
vs/base/common/strings
'
;
export
type
FuzzyScore
=
[
number
,
number
[]];
export
abstract
class
TreeElement
{
export
abstract
class
TreeElement
{
abstract
id
:
string
;
abstract
id
:
string
;
abstract
children
:
{
[
id
:
string
]:
TreeElement
};
abstract
children
:
{
[
id
:
string
]:
TreeElement
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录