Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f5898a0e
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
f5898a0e
编写于
11月 10, 2020
作者:
C
Connor Peet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
surround match in zero-width spaces to avoid clobbering
上级
2b9e62fc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
5 deletion
+5
-5
extensions/search-result/src/extension.ts
extensions/search-result/src/extension.ts
+1
-1
src/vs/workbench/services/search/common/search.ts
src/vs/workbench/services/search/common/search.ts
+2
-2
src/vs/workbench/services/search/test/common/search.test.ts
src/vs/workbench/services/search/test/common/search.test.ts
+2
-2
未找到文件。
extensions/search-result/src/extension.ts
浏览文件 @
f5898a0e
...
...
@@ -8,7 +8,7 @@ import * as pathUtils from 'path';
const
FILE_LINE_REGEX
=
/^
(\S
.*
)
:$/
;
const
RESULT_LINE_REGEX
=
/^
(\s
+
)(\d
+
)(
:|
)(\s
+
)(
.*
)
$/
;
const
ELISION_REGEX
=
/
\.{3}\(
([
0-9
]
+
)
characters skipped
\)\.{3}
/g
;
const
ELISION_REGEX
=
/
\.{3}\(
\u
200b
([
0-9
]
+
)
characters skipped
\u
200b
\)\.{3}
/g
;
const
SEARCH_RESULT_SELECTOR
=
{
language
:
'
search-result
'
,
exclusive
:
true
};
const
DIRECTIVES
=
[
'
# Query:
'
,
'
# Flags:
'
,
'
# Including:
'
,
'
# Excluding:
'
,
'
# ContextLines:
'
];
const
FLAGS
=
[
'
RegExp
'
,
'
CaseSensitive
'
,
'
IgnoreExcludeSettings
'
,
'
WordMatch
'
];
...
...
src/vs/workbench/services/search/common/search.ts
浏览文件 @
f5898a0e
...
...
@@ -26,8 +26,8 @@ export const SEARCH_EXCLUDE_CONFIG = 'search.exclude';
// Warning: this pattern is used in the search editor to detect offsets. If you
// change this, also change the search-result built-in extension
const
SEARCH_ELIDED_PREFIX
=
'
...(
'
;
const
SEARCH_ELIDED_SUFFIX
=
'
characters skipped)...
'
;
const
SEARCH_ELIDED_PREFIX
=
'
...(
\
u200b
'
;
const
SEARCH_ELIDED_SUFFIX
=
'
characters skipped
\
u200b
)...
'
;
const
SEARCH_ELIDED_MIN_LEN
=
(
SEARCH_ELIDED_PREFIX
.
length
+
SEARCH_ELIDED_SUFFIX
.
length
+
5
)
*
2
;
export
const
ISearchService
=
createDecorator
<
ISearchService
>
(
'
searchService
'
);
...
...
src/vs/workbench/services/search/test/common/search.test.ts
浏览文件 @
f5898a0e
...
...
@@ -105,8 +105,8 @@ suite('TextSearchResult', () => {
const
range2
=
new
SearchRange
(
5
,
133
,
5
,
136
);
const
range3
=
new
SearchRange
(
5
,
141
,
5
,
144
);
const
result
=
new
TextSearchMatch
(
'
foo bar 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 foo bar baz bar
'
,
[
range1
,
range2
,
range3
],
previewOptions
);
assert
.
deepEqual
(
result
.
preview
.
matches
,
[
new
SearchRange
(
0
,
4
,
0
,
7
),
new
SearchRange
(
0
,
4
6
,
0
,
49
),
new
SearchRange
(
0
,
54
,
0
,
57
)]);
assert
.
equal
(
result
.
preview
.
text
,
'
foo bar 123456...(
117 characters skipped
)...o bar baz bar
'
);
assert
.
deepEqual
(
result
.
preview
.
matches
,
[
new
SearchRange
(
0
,
4
,
0
,
7
),
new
SearchRange
(
0
,
4
8
,
0
,
51
),
new
SearchRange
(
0
,
56
,
0
,
59
)]);
assert
.
equal
(
result
.
preview
.
text
,
'
foo bar 123456...(
\
u200b117 characters skipped
\
u200b
)...o bar baz bar
'
);
});
// test('all lines of multiline match', () => {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录