Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ddd8dbf9
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,发现更多精彩内容 >>
提交
ddd8dbf9
编写于
3月 16, 2017
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Provide a way to enable/disable gitignore support for #19983
上级
ac420a29
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
70 addition
and
14 deletion
+70
-14
src/vs/platform/search/common/search.ts
src/vs/platform/search/common/search.ts
+1
-0
src/vs/workbench/parts/search/browser/media/git-dark.svg
src/vs/workbench/parts/search/browser/media/git-dark.svg
+1
-0
src/vs/workbench/parts/search/browser/media/git.svg
src/vs/workbench/parts/search/browser/media/git.svg
+1
-0
src/vs/workbench/parts/search/browser/media/searchviewlet.css
...vs/workbench/parts/search/browser/media/searchviewlet.css
+11
-0
src/vs/workbench/parts/search/browser/patternInputWidget.ts
src/vs/workbench/parts/search/browser/patternInputWidget.ts
+31
-2
src/vs/workbench/parts/search/browser/searchViewlet.ts
src/vs/workbench/parts/search/browser/searchViewlet.ts
+15
-10
src/vs/workbench/parts/search/common/searchQuery.ts
src/vs/workbench/parts/search/common/searchQuery.ts
+2
-1
src/vs/workbench/services/search/node/ripgrepTextSearch.ts
src/vs/workbench/services/search/node/ripgrepTextSearch.ts
+5
-0
src/vs/workbench/services/search/node/search.ts
src/vs/workbench/services/search/node/search.ts
+1
-0
src/vs/workbench/services/search/node/searchService.ts
src/vs/workbench/services/search/node/searchService.ts
+2
-1
未找到文件。
src/vs/platform/search/common/search.ts
浏览文件 @
ddd8dbf9
...
...
@@ -36,6 +36,7 @@ export interface IQueryOptions {
cacheKey
?:
string
;
fileEncoding
?:
string
;
useRipgrep
?:
boolean
;
useIgnoreFiles
?:
boolean
;
}
export
interface
ISearchQuery
extends
IQueryOptions
{
...
...
src/vs/workbench/parts/search/browser/media/git-dark.svg
0 → 100644
浏览文件 @
ddd8dbf9
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"32"
height=
"32"
><path
d=
"M27.459 14.902l-10.439-10.439c-.296-.294-.672-.452-1.089-.452-.417 0-.793.157-1.089.452l-2.248 2.247 2.549 2.549c.249-.112.522-.177.813-.177 1.106 0 2.002.896 2.002 2.002 0 .291-.064.565-.176.814l2.311 2.336c.25-.111.633-.234.923-.234 1.106 0 2 .911 2 2.016s-.894 1.969-2 1.969c-1.105-.001-2.016-.751-2.016-1.985 0-.28.016-.462.119-.704l-2.373-2.374-.023.007v6.274c.747.295 1.277 1.026 1.277 1.875 0 1.105-.878 2.016-1.984 2.016-1.104 0-2.031-.926-2.031-2.031 0-.846.535-1.564 1.28-1.857l.001-6.25c-.762-.282-1.309-1.009-1.309-1.871 0-.28.059-.546.162-.788l-2.555-2.557-7.115 7.114c-.599.601-.601 1.576.001 2.178l10.44 10.518c.296.295.671.45 1.089.45.415 0 .796-.159 1.089-.45l10.391-10.471c.601-.599.599-1.576 0-2.177z"
fill=
"#fff"
/></svg>
\ No newline at end of file
src/vs/workbench/parts/search/browser/media/git.svg
0 → 100644
浏览文件 @
ddd8dbf9
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"32"
height=
"32"
><defs><clipPath><path
d=
"M.06 91.886h91.828v-91.886h-91.828v91.886z"
/></clipPath><clipPath
id=
"a"
><path
d=
"M0 0h92v92h-92v-92z"
/></clipPath></defs><path
d=
"M28.497 14.84l-11.354-11.353c-.653-.654-1.714-.654-2.368 0l-2.357 2.358 2.99 2.991c.695-.235 1.492-.077 2.046.477.557.558.713 1.361.473 2.059l2.882 2.882c.698-.241 1.502-.085 2.059.473.778.778.778 2.039 0 2.818-.779.779-2.04.779-2.819 0-.586-.586-.73-1.446-.434-2.167l-2.688-2.688v7.074c.19.094.369.219.527.377.778.778.778 2.039 0 2.819-.778.778-2.04.778-2.818 0-.778-.779-.778-2.04 0-2.819.192-.192.415-.338.653-.435v-7.14c-.237-.097-.46-.241-.653-.435-.589-.589-.731-1.455-.429-2.179l-2.948-2.949-7.785 7.785c-.654.655-.654 1.715 0 2.369l11.354 11.353c.654.654 1.714.654 2.369 0l11.3-11.301c.654-.654.654-1.715 0-2.369"
fill=
"#424242"
clip-path=
"url(#a)"
/></svg>
\ No newline at end of file
src/vs/workbench/parts/search/browser/media/searchviewlet.css
浏览文件 @
ddd8dbf9
...
...
@@ -299,6 +299,17 @@
background
:
url('pattern-dark.svg')
center
center
no-repeat
;
}
.vs
.monaco-workbench
.search-viewlet
.query-details
.file-types
.controls
>
.custom-checkbox.useIgnoreFiles
{
background
:
url('git.svg')
center
center
no-repeat
;
background-size
:
20px
20px
;
}
.vs-dark
.monaco-workbench
.search-viewlet
.query-details
.file-types
.controls
>
.custom-checkbox.useIgnoreFiles
,
.hc-black
.monaco-workbench
.search-viewlet
.query-details
.file-types
.controls
>
.custom-checkbox.useIgnoreFiles
{
background
:
url('git-dark.svg')
center
center
no-repeat
;
background-size
:
20px
20px
;
}
.search-viewlet
.findInFileMatch
,
.monaco-editor
.findInFileMatch
{
background-color
:
rgba
(
234
,
92
,
0
,
0.3
);
...
...
src/vs/workbench/parts/search/browser/patternInputWidget.ts
浏览文件 @
ddd8dbf9
...
...
@@ -36,6 +36,7 @@ export class PatternInputWidget extends Widget {
private
toDispose
:
any
[];
private
pattern
:
Checkbox
;
private
useIgnoreFilesBox
:
Checkbox
;
private
domNode
:
HTMLElement
;
private
inputNode
:
HTMLInputElement
;
...
...
@@ -44,7 +45,7 @@ export class PatternInputWidget extends Widget {
private
_onSubmit
=
this
.
_register
(
new
Emitter
<
boolean
>
());
public
onSubmit
:
CommonEvent
<
boolean
>
=
this
.
_onSubmit
.
event
;
constructor
(
parent
:
HTMLElement
,
private
contextViewProvider
:
IContextViewProvider
,
options
:
IOptions
=
Object
.
create
(
null
))
{
constructor
(
parent
:
HTMLElement
,
private
contextViewProvider
:
IContextViewProvider
,
options
:
IOptions
=
Object
.
create
(
null
)
,
private
showUseIgnoreFiles
=
false
)
{
super
();
this
.
onOptionChange
=
null
;
this
.
width
=
options
.
width
||
100
;
...
...
@@ -53,6 +54,7 @@ export class PatternInputWidget extends Widget {
this
.
toDispose
=
[];
this
.
pattern
=
null
;
this
.
useIgnoreFilesBox
=
null
;
this
.
domNode
=
null
;
this
.
inputNode
=
null
;
this
.
inputBox
=
null
;
...
...
@@ -65,6 +67,7 @@ export class PatternInputWidget extends Widget {
public
dispose
():
void
{
super
.
dispose
();
this
.
pattern
.
dispose
();
this
.
useIgnoreFilesBox
.
dispose
();
this
.
toDispose
.
forEach
((
element
)
=>
{
element
();
});
...
...
@@ -142,6 +145,15 @@ export class PatternInputWidget extends Widget {
return
this
.
inputBox
.
hasFocus
();
}
public
useIgnoreFiles
():
boolean
{
return
this
.
useIgnoreFilesBox
.
checked
;
}
public
setUseIgnoreFiles
(
value
:
boolean
):
void
{
this
.
useIgnoreFilesBox
.
checked
=
value
;
this
.
setInputWidth
();
}
public
isGlobPattern
():
boolean
{
return
this
.
pattern
.
checked
;
}
...
...
@@ -152,7 +164,7 @@ export class PatternInputWidget extends Widget {
}
private
setInputWidth
():
void
{
let
w
=
this
.
width
-
this
.
pattern
.
width
();
let
w
=
this
.
width
-
this
.
pattern
.
width
()
-
this
.
useIgnoreFilesBox
.
width
()
;
this
.
inputBox
.
width
=
w
;
}
...
...
@@ -191,6 +203,19 @@ export class PatternInputWidget extends Widget {
}
});
this
.
useIgnoreFilesBox
=
new
Checkbox
({
actionClassName
:
'
useIgnoreFiles
'
,
title
:
nls
.
localize
(
'
useIgnoreFilesDescription
'
,
"
Use Ignore Files
"
),
isChecked
:
false
,
onChange
:
(
viaKeyboard
)
=>
{
this
.
onOptionChange
(
null
);
if
(
!
viaKeyboard
)
{
this
.
inputBox
.
focus
();
}
this
.
setInputWidth
();
}
});
$
(
this
.
pattern
.
domNode
).
on
(
'
mouseover
'
,
()
=>
{
if
(
this
.
isGlobPattern
())
{
this
.
showGlobHelp
();
...
...
@@ -205,6 +230,10 @@ export class PatternInputWidget extends Widget {
let
controls
=
document
.
createElement
(
'
div
'
);
controls
.
className
=
'
controls
'
;
if
(
this
.
showUseIgnoreFiles
)
{
controls
.
appendChild
(
this
.
useIgnoreFilesBox
.
domNode
);
}
controls
.
appendChild
(
this
.
pattern
.
domNode
);
this
.
domNode
.
appendChild
(
controls
);
...
...
src/vs/workbench/parts/search/browser/searchViewlet.ts
浏览文件 @
ddd8dbf9
...
...
@@ -163,6 +163,7 @@ export class SearchViewlet extends Viewlet {
let
exclusionsUsePattern
=
this
.
viewletSettings
[
'
query.exclusionsUsePattern
'
];
let
includesUsePattern
=
this
.
viewletSettings
[
'
query.includesUsePattern
'
];
let
patternIncludes
=
this
.
viewletSettings
[
'
query.folderIncludes
'
]
||
''
;
let
useIgnoreFiles
=
this
.
viewletSettings
[
'
query.useIgnoreFiles
'
];
this
.
queryDetails
=
this
.
searchWidgetsContainer
.
div
({
'
class
'
:
[
'
query-details
'
]
},
(
builder
)
=>
{
builder
.
div
({
'
class
'
:
'
more
'
,
'
tabindex
'
:
0
,
'
role
'
:
'
button
'
,
'
title
'
:
nls
.
localize
(
'
moreSearch
'
,
"
Toggle Search Details
"
)
})
...
...
@@ -206,10 +207,11 @@ export class SearchViewlet extends Viewlet {
this
.
inputPatternExclusions
=
new
PatternInputWidget
(
builder
.
getContainer
(),
this
.
contextViewService
,
{
ariaLabel
:
nls
.
localize
(
'
label.excludes
'
,
'
Search Exclude Patterns
'
)
});
}
,
true
);
this
.
inputPatternExclusions
.
setIsGlobPattern
(
exclusionsUsePattern
);
this
.
inputPatternExclusions
.
setValue
(
patternExclusions
);
this
.
inputPatternExclusions
.
setUseIgnoreFiles
(
useIgnoreFiles
);
this
.
inputPatternExclusions
.
on
(
FindInput
.
OPTION_CHANGE
,
(
e
)
=>
{
...
...
@@ -902,14 +904,15 @@ export class SearchViewlet extends Viewlet {
}
public
onQueryChanged
(
rerunQuery
:
boolean
,
preserveFocus
?:
boolean
):
void
{
let
isRegex
=
this
.
searchWidget
.
searchInput
.
getRegex
();
let
isWholeWords
=
this
.
searchWidget
.
searchInput
.
getWholeWords
();
let
isCaseSensitive
=
this
.
searchWidget
.
searchInput
.
getCaseSensitive
();
let
contentPattern
=
this
.
searchWidget
.
searchInput
.
getValue
();
let
patternExcludes
=
this
.
inputPatternExclusions
.
getValue
().
trim
();
let
exclusionsUsePattern
=
this
.
inputPatternExclusions
.
isGlobPattern
();
let
patternIncludes
=
this
.
inputPatternIncludes
.
getValue
().
trim
();
let
includesUsePattern
=
this
.
inputPatternIncludes
.
isGlobPattern
();
const
isRegex
=
this
.
searchWidget
.
searchInput
.
getRegex
();
const
isWholeWords
=
this
.
searchWidget
.
searchInput
.
getWholeWords
();
const
isCaseSensitive
=
this
.
searchWidget
.
searchInput
.
getCaseSensitive
();
const
contentPattern
=
this
.
searchWidget
.
searchInput
.
getValue
();
const
patternExcludes
=
this
.
inputPatternExclusions
.
getValue
().
trim
();
const
exclusionsUsePattern
=
this
.
inputPatternExclusions
.
isGlobPattern
();
const
patternIncludes
=
this
.
inputPatternIncludes
.
getValue
().
trim
();
const
includesUsePattern
=
this
.
inputPatternIncludes
.
isGlobPattern
();
const
useIgnoreFiles
=
this
.
inputPatternExclusions
.
useIgnoreFiles
();
// store memento
this
.
viewletSettings
[
'
query.contentPattern
'
]
=
contentPattern
;
...
...
@@ -920,6 +923,7 @@ export class SearchViewlet extends Viewlet {
this
.
viewletSettings
[
'
query.exclusionsUsePattern
'
]
=
exclusionsUsePattern
;
this
.
viewletSettings
[
'
query.folderIncludes
'
]
=
patternIncludes
;
this
.
viewletSettings
[
'
query.includesUsePattern
'
]
=
includesUsePattern
;
this
.
viewletSettings
[
'
query.useIgnoreFiles
'
]
=
useIgnoreFiles
;
if
(
!
rerunQuery
)
{
return
;
...
...
@@ -958,7 +962,8 @@ export class SearchViewlet extends Viewlet {
extraFileResources
:
getOutOfWorkspaceEditorResources
(
this
.
editorGroupService
,
this
.
contextService
),
excludePattern
:
excludes
,
maxResults
:
SearchViewlet
.
MAX_TEXT_RESULTS
,
includePattern
:
includes
includePattern
:
includes
,
useIgnoreFiles
};
this
.
onQueryTriggered
(
this
.
queryBuilder
.
text
(
content
,
options
),
patternExcludes
,
patternIncludes
);
...
...
src/vs/workbench/parts/search/common/searchQuery.ts
浏览文件 @
ddd8dbf9
...
...
@@ -43,7 +43,8 @@ export class QueryBuilder {
cacheKey
:
options
.
cacheKey
,
fileEncoding
:
options
.
fileEncoding
,
contentPattern
:
contentPattern
,
useRipgrep
:
configuration
.
search
.
useRipgrep
useRipgrep
:
configuration
.
search
.
useRipgrep
,
useIgnoreFiles
:
options
.
useIgnoreFiles
};
}
}
\ No newline at end of file
src/vs/workbench/services/search/node/ripgrepTextSearch.ts
浏览文件 @
ddd8dbf9
...
...
@@ -331,6 +331,11 @@ function getRgArgs(config: IRawSearch): { args: string[], siblingClauses: glob.S
}
}
if
(
!
config
.
useIgnoreFiles
)
{
// Don't use .gitignore or .ignore
args
.
push
(
'
--no-ignore
'
);
}
// Folder to search
args
.
push
(
'
--
'
,
'
./
'
);
...
...
src/vs/workbench/services/search/node/search.ts
浏览文件 @
ddd8dbf9
...
...
@@ -22,6 +22,7 @@ export interface IRawSearch {
maxFilesize
?:
number
;
fileEncoding
?:
string
;
useRipgrep
?:
boolean
;
useIgnoreFiles
?:
boolean
;
}
export
interface
IRawSearchService
{
...
...
src/vs/workbench/services/search/node/searchService.ts
浏览文件 @
ddd8dbf9
...
...
@@ -236,7 +236,8 @@ export class DiskSearch {
maxResults
:
query
.
maxResults
,
sortByScore
:
query
.
sortByScore
,
cacheKey
:
query
.
cacheKey
,
useRipgrep
:
query
.
useRipgrep
useRipgrep
:
query
.
useRipgrep
,
useIgnoreFiles
:
query
.
useIgnoreFiles
};
if
(
query
.
type
===
QueryType
.
Text
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录