Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ecfd4db2
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 搜索 >>
提交
ecfd4db2
编写于
4月 18, 2020
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
define search view codicons
上级
17fa69a4
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
56 addition
and
24 deletion
+56
-24
src/vs/workbench/browser/parts/compositeBarActions.ts
src/vs/workbench/browser/parts/compositeBarActions.ts
+1
-1
src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts
...s/workbench/contrib/search/browser/anythingQuickAccess.ts
+3
-2
src/vs/workbench/contrib/search/browser/search.contribution.ts
...s/workbench/contrib/search/browser/search.contribution.ts
+2
-1
src/vs/workbench/contrib/search/browser/searchActions.ts
src/vs/workbench/contrib/search/browser/searchActions.ts
+10
-9
src/vs/workbench/contrib/search/browser/searchIcons.ts
src/vs/workbench/contrib/search/browser/searchIcons.ts
+24
-0
src/vs/workbench/contrib/search/browser/searchView.ts
src/vs/workbench/contrib/search/browser/searchView.ts
+2
-1
src/vs/workbench/contrib/search/browser/searchWidget.ts
src/vs/workbench/contrib/search/browser/searchWidget.ts
+10
-8
src/vs/workbench/contrib/search/browser/symbolsQuickAccess.ts
...vs/workbench/contrib/search/browser/symbolsQuickAccess.ts
+2
-1
src/vs/workbench/contrib/searchEditor/browser/searchEditor.ts
...vs/workbench/contrib/searchEditor/browser/searchEditor.ts
+2
-1
未找到文件。
src/vs/workbench/browser/parts/compositeBarActions.ts
浏览文件 @
ecfd4db2
...
...
@@ -321,7 +321,7 @@ export class ActivityActionViewItem extends BaseActionViewItem {
this
.
label
.
className
=
'
action-label
'
;
if
(
this
.
activity
.
cssClass
)
{
dom
.
addClass
(
this
.
label
,
this
.
activity
.
cssClass
);
dom
.
addClass
es
(
this
.
label
,
this
.
activity
.
cssClass
);
}
if
(
this
.
options
.
icon
&&
!
this
.
activity
.
iconUrl
)
{
...
...
src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts
浏览文件 @
ecfd4db2
...
...
@@ -49,6 +49,7 @@ import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsSe
import
{
getCodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
import
{
stripCodicons
}
from
'
vs/base/common/codicons
'
;
import
{
Codicon
}
from
'
vs/base/browser/ui/codicons/codicons
'
;
interface
IAnythingQuickPickItem
extends
IPickerQuickAccessItem
,
IQuickPickItemWithResource
{
}
...
...
@@ -868,14 +869,14 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
// Open to side / below
buttons
.
push
({
iconClass
:
openSideBySideDirection
===
'
right
'
?
'
codicon-split-horizontal
'
:
'
codicon-split-vertical
'
,
iconClass
:
openSideBySideDirection
===
'
right
'
?
Codicon
.
splitHorizontal
.
classNames
:
Codicon
.
splitVertical
.
classNames
,
tooltip
:
openSideBySideDirection
===
'
right
'
?
localize
(
'
openToSide
'
,
"
Open to the Side
"
)
:
localize
(
'
openToBottom
'
,
"
Open to the Bottom
"
)
});
// Remove from History
if
(
isEditorHistoryEntry
)
{
buttons
.
push
({
iconClass
:
isDirty
?
'
dirty-anything codicon-circle-filled
'
:
'
codicon-close
'
,
iconClass
:
isDirty
?
(
'
dirty-anything
'
+
Codicon
.
circleFilled
.
classNames
)
:
Codicon
.
close
.
classNames
,
tooltip
:
localize
(
'
closeEditor
'
,
"
Remove from Recently Opened
"
),
alwaysVisible
:
isDirty
});
...
...
src/vs/workbench/contrib/search/browser/search.contribution.ts
浏览文件 @
ecfd4db2
...
...
@@ -55,6 +55,7 @@ import { AnythingQuickAccessProvider } from 'vs/workbench/contrib/search/browser
import
{
IQuickInputService
}
from
'
vs/platform/quickinput/common/quickInput
'
;
import
{
AbstractGotoLineQuickAccessProvider
}
from
'
vs/editor/contrib/quickAccess/gotoLineQuickAccess
'
;
import
{
GotoSymbolQuickAccessProvider
}
from
'
vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess
'
;
import
{
searchViewIcon
}
from
'
vs/workbench/contrib/search/browser/searchIcons
'
;
registerSingleton
(
ISearchWorkbenchService
,
SearchWorkbenchService
,
true
);
registerSingleton
(
ISearchHistoryService
,
SearchHistoryService
,
true
);
...
...
@@ -506,7 +507,7 @@ const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewCo
name
:
nls
.
localize
(
'
name
'
,
"
Search
"
),
ctorDescriptor
:
new
SyncDescriptor
(
ViewPaneContainer
,
[
VIEWLET_ID
,
`
${
VIEWLET_ID
}
.state`
,
{
mergeViewWithContainerWhenSingleView
:
true
,
donotShowContainerTitleWhenMergedWithContainer
:
true
}]),
hideIfEmpty
:
true
,
icon
:
'
codicon-search
'
,
icon
:
searchViewIcon
.
classNames
,
order
:
1
},
ViewContainerLocation
.
Sidebar
);
...
...
src/vs/workbench/contrib/search/browser/searchActions.ts
浏览文件 @
ecfd4db2
...
...
@@ -28,6 +28,7 @@ import { ITreeNavigator } from 'vs/base/browser/ui/tree/tree';
import
{
IViewsService
}
from
'
vs/workbench/common/views
'
;
import
{
SearchEditorInput
}
from
'
vs/workbench/contrib/searchEditor/browser/searchEditorInput
'
;
import
{
SearchEditor
}
from
'
vs/workbench/contrib/searchEditor/browser/searchEditor
'
;
import
{
searchRefreshIcon
,
searchCollapseAllIcon
,
searchExpandAllIcon
,
searchClearIcon
,
searchReplaceAllIcon
,
searchReplaceIcon
,
searchRemoveIcon
,
searchStopIcon
}
from
'
vs/workbench/contrib/search/browser/searchIcons
'
;
export
function
isSearchViewFocused
(
viewsService
:
IViewsService
):
boolean
{
const
searchView
=
getSearchView
(
viewsService
);
...
...
@@ -268,7 +269,7 @@ export class RefreshAction extends Action {
constructor
(
id
:
string
,
label
:
string
,
@
IViewsService
private
readonly
viewsService
:
IViewsService
)
{
super
(
id
,
label
,
'
search-action
codicon-refresh
'
);
super
(
id
,
label
,
'
search-action
'
+
searchRefreshIcon
.
classNames
);
}
get
enabled
():
boolean
{
...
...
@@ -298,7 +299,7 @@ export class CollapseDeepestExpandedLevelAction extends Action {
constructor
(
id
:
string
,
label
:
string
,
@
IViewsService
private
readonly
viewsService
:
IViewsService
)
{
super
(
id
,
label
,
'
search-action
codicon-collapse-all
'
);
super
(
id
,
label
,
'
search-action
'
+
searchCollapseAllIcon
.
classNames
);
this
.
update
();
}
...
...
@@ -354,7 +355,7 @@ export class ExpandAllAction extends Action {
constructor
(
id
:
string
,
label
:
string
,
@
IViewsService
private
readonly
viewsService
:
IViewsService
)
{
super
(
id
,
label
,
'
search-action
codicon-expand-all
'
);
super
(
id
,
label
,
'
search-action
'
+
searchExpandAllIcon
.
classNames
);
this
.
update
();
}
...
...
@@ -438,7 +439,7 @@ export class ClearSearchResultsAction extends Action {
constructor
(
id
:
string
,
label
:
string
,
@
IViewsService
private
readonly
viewsService
:
IViewsService
)
{
super
(
id
,
label
,
'
search-action
codicon-clear-all
'
);
super
(
id
,
label
,
'
search-action
'
+
searchClearIcon
.
classNames
);
this
.
update
();
}
...
...
@@ -464,7 +465,7 @@ export class CancelSearchAction extends Action {
constructor
(
id
:
string
,
label
:
string
,
@
IViewsService
private
readonly
viewsService
:
IViewsService
)
{
super
(
id
,
label
,
'
search-action
codicon-search-stop
'
);
super
(
id
,
label
,
'
search-action
'
+
searchStopIcon
.
classNames
);
this
.
update
();
}
...
...
@@ -599,7 +600,7 @@ export class RemoveAction extends AbstractSearchAndReplaceAction {
private
viewer
:
WorkbenchObjectTree
<
RenderableMatch
>
,
private
element
:
RenderableMatch
)
{
super
(
'
remove
'
,
RemoveAction
.
LABEL
,
'
codicon-close
'
);
super
(
'
remove
'
,
RemoveAction
.
LABEL
,
searchRemoveIcon
.
classNames
);
}
run
():
Promise
<
any
>
{
...
...
@@ -639,7 +640,7 @@ export class ReplaceAllAction extends AbstractSearchAndReplaceAction {
private
fileMatch
:
FileMatch
,
@
IKeybindingService
keyBindingService
:
IKeybindingService
)
{
super
(
Constants
.
ReplaceAllInFileActionId
,
appendKeyBindingLabel
(
ReplaceAllAction
.
LABEL
,
keyBindingService
.
lookupKeybinding
(
Constants
.
ReplaceAllInFileActionId
),
keyBindingService
),
'
codicon-replace-all
'
);
super
(
Constants
.
ReplaceAllInFileActionId
,
appendKeyBindingLabel
(
ReplaceAllAction
.
LABEL
,
keyBindingService
.
lookupKeybinding
(
Constants
.
ReplaceAllInFileActionId
),
keyBindingService
),
searchReplaceAllIcon
.
classNames
);
}
run
():
Promise
<
any
>
{
...
...
@@ -663,7 +664,7 @@ export class ReplaceAllInFolderAction extends AbstractSearchAndReplaceAction {
constructor
(
private
viewer
:
WorkbenchObjectTree
<
RenderableMatch
>
,
private
folderMatch
:
FolderMatch
,
@
IKeybindingService
keyBindingService
:
IKeybindingService
)
{
super
(
Constants
.
ReplaceAllInFolderActionId
,
appendKeyBindingLabel
(
ReplaceAllInFolderAction
.
LABEL
,
keyBindingService
.
lookupKeybinding
(
Constants
.
ReplaceAllInFolderActionId
),
keyBindingService
),
'
codicon-replace-all
'
);
super
(
Constants
.
ReplaceAllInFolderActionId
,
appendKeyBindingLabel
(
ReplaceAllInFolderAction
.
LABEL
,
keyBindingService
.
lookupKeybinding
(
Constants
.
ReplaceAllInFolderActionId
),
keyBindingService
),
searchReplaceAllIcon
.
classNames
);
}
run
():
Promise
<
any
>
{
...
...
@@ -686,7 +687,7 @@ export class ReplaceAction extends AbstractSearchAndReplaceAction {
@
IKeybindingService
keyBindingService
:
IKeybindingService
,
@
IEditorService
private
readonly
editorService
:
IEditorService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
)
{
super
(
Constants
.
ReplaceActionId
,
appendKeyBindingLabel
(
ReplaceAction
.
LABEL
,
keyBindingService
.
lookupKeybinding
(
Constants
.
ReplaceActionId
),
keyBindingService
),
'
codicon-replace
'
);
super
(
Constants
.
ReplaceActionId
,
appendKeyBindingLabel
(
ReplaceAction
.
LABEL
,
keyBindingService
.
lookupKeybinding
(
Constants
.
ReplaceActionId
),
keyBindingService
),
searchReplaceIcon
.
classNames
);
}
run
():
Promise
<
any
>
{
...
...
src/vs/workbench/contrib/search/browser/searchIcons.ts
0 → 100644
浏览文件 @
ecfd4db2
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
Codicon
,
registerIcon
}
from
'
vs/base/browser/ui/codicons/codicons
'
;
export
const
searchDetails
=
registerIcon
(
'
search-details
'
,
Codicon
.
ellipsis
);
export
const
searchShowContextIcon
=
registerIcon
(
'
search-show-context
'
,
Codicon
.
listSelection
);
export
const
searchHideReplaceIcon
=
registerIcon
(
'
search-hide-replace
'
,
Codicon
.
chevronRight
);
export
const
searchShowReplaceIcon
=
registerIcon
(
'
search-show-replace
'
,
Codicon
.
chevronDown
);
export
const
searchReplaceAllIcon
=
registerIcon
(
'
search-replace-all
'
,
Codicon
.
replaceAll
);
export
const
searchReplaceIcon
=
registerIcon
(
'
search-replace-all
'
,
Codicon
.
replace
);
export
const
searchRemoveIcon
=
registerIcon
(
'
search-remove
'
,
Codicon
.
close
);
export
const
searchRefreshIcon
=
registerIcon
(
'
search-refresh
'
,
Codicon
.
refresh
);
export
const
searchCollapseAllIcon
=
registerIcon
(
'
search-collapse-results
'
,
Codicon
.
collapseAll
);
export
const
searchExpandAllIcon
=
registerIcon
(
'
search-expand-results
'
,
Codicon
.
expandAll
);
export
const
searchClearIcon
=
registerIcon
(
'
search-clear-results
'
,
Codicon
.
expandAll
);
export
const
searchStopIcon
=
Codicon
.
searchStop
;
export
const
searchViewIcon
=
Codicon
.
search
;
src/vs/workbench/contrib/search/browser/searchView.ts
浏览文件 @
ecfd4db2
...
...
@@ -69,6 +69,7 @@ import { OpenSearchEditorAction, createEditorFromSearchResult } from 'vs/workben
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
Orientation
}
from
'
vs/base/browser/ui/sash/sash
'
;
import
{
searchDetails
}
from
'
vs/workbench/contrib/search/browser/searchIcons
'
;
const
$
=
dom
.
$
;
...
...
@@ -282,7 +283,7 @@ export class SearchView extends ViewPane {
// Toggle query details button
this
.
toggleQueryDetailsButton
=
dom
.
append
(
this
.
queryDetails
,
$
(
'
.more
.codicon.codicon-ellipsis
'
,
{
tabindex
:
0
,
role
:
'
button
'
,
title
:
nls
.
localize
(
'
moreSearch
'
,
"
Toggle Search Details
"
)
}));
$
(
'
.more
'
+
searchDetails
.
cssSelector
,
{
tabindex
:
0
,
role
:
'
button
'
,
title
:
nls
.
localize
(
'
moreSearch
'
,
"
Toggle Search Details
"
)
}));
this
.
_register
(
dom
.
addDisposableListener
(
this
.
toggleQueryDetailsButton
,
dom
.
EventType
.
CLICK
,
e
=>
{
dom
.
EventHelper
.
stop
(
e
);
...
...
src/vs/workbench/contrib/search/browser/searchWidget.ts
浏览文件 @
ecfd4db2
...
...
@@ -33,13 +33,11 @@ import { IAccessibilityService } from 'vs/platform/accessibility/common/accessib
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
Checkbox
}
from
'
vs/base/browser/ui/checkbox/checkbox
'
;
import
{
IViewsService
}
from
'
vs/workbench/common/views
'
;
import
{
Codicon
,
registerIcon
}
from
'
vs/base/browser/ui/codicons/codi
cons
'
;
import
{
searchReplaceAllIcon
,
searchHideReplaceIcon
,
searchShowContextIcon
,
searchShowReplaceIcon
}
from
'
vs/workbench/contrib/search/browser/searchI
cons
'
;
/** Specified in searchview.css */
export
const
SingleLineInputHeight
=
24
;
export
const
searchShowContextIcon
=
registerIcon
(
'
search-show-context
'
,
Codicon
.
listSelection
);
export
interface
ISearchWidgetOptions
{
value
?:
string
;
replaceValue
?:
string
;
...
...
@@ -58,7 +56,7 @@ class ReplaceAllAction extends Action {
static
readonly
ID
:
string
=
'
search.action.replaceAll
'
;
constructor
(
private
_searchWidget
:
SearchWidget
)
{
super
(
ReplaceAllAction
.
ID
,
''
,
'
codicon-replace-all
'
,
false
);
super
(
ReplaceAllAction
.
ID
,
''
,
searchReplaceAllIcon
.
classNames
,
false
);
}
set
searchWidget
(
searchWidget
:
SearchWidget
)
{
...
...
@@ -294,8 +292,7 @@ export class SearchWidget extends Widget {
};
this
.
toggleReplaceButton
=
this
.
_register
(
new
Button
(
parent
,
opts
));
this
.
toggleReplaceButton
.
element
.
setAttribute
(
'
aria-expanded
'
,
'
false
'
);
this
.
toggleReplaceButton
.
element
.
classList
.
add
(
'
codicon
'
);
this
.
toggleReplaceButton
.
element
.
classList
.
add
(
'
codicon-chevron-right
'
);
dom
.
addClasses
(
this
.
toggleReplaceButton
.
element
,
searchHideReplaceIcon
.
classNames
);
this
.
toggleReplaceButton
.
icon
=
'
toggle-replace-button
'
;
// TODO@joh need to dispose this listener eventually
this
.
toggleReplaceButton
.
onDidClick
(()
=>
this
.
onToggleReplaceButton
());
...
...
@@ -429,8 +426,13 @@ export class SearchWidget extends Widget {
private
onToggleReplaceButton
():
void
{
dom
.
toggleClass
(
this
.
replaceContainer
,
'
disabled
'
);
dom
.
toggleClass
(
this
.
toggleReplaceButton
.
element
,
'
codicon-chevron-right
'
);
dom
.
toggleClass
(
this
.
toggleReplaceButton
.
element
,
'
codicon-chevron-down
'
);
if
(
this
.
isReplaceShown
())
{
dom
.
removeClasses
(
this
.
toggleReplaceButton
.
element
,
searchHideReplaceIcon
.
classNames
);
dom
.
addClasses
(
this
.
toggleReplaceButton
.
element
,
searchShowReplaceIcon
.
classNames
);
}
else
{
dom
.
removeClasses
(
this
.
toggleReplaceButton
.
element
,
searchShowReplaceIcon
.
classNames
);
dom
.
addClasses
(
this
.
toggleReplaceButton
.
element
,
searchHideReplaceIcon
.
classNames
);
}
this
.
toggleReplaceButton
.
element
.
setAttribute
(
'
aria-expanded
'
,
this
.
isReplaceShown
()
?
'
true
'
:
'
false
'
);
this
.
updateReplaceActiveState
();
this
.
_onReplaceToggled
.
fire
();
...
...
src/vs/workbench/contrib/search/browser/symbolsQuickAccess.ts
浏览文件 @
ecfd4db2
...
...
@@ -23,6 +23,7 @@ import { getSelectionSearchString } from 'vs/editor/contrib/find/findController'
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
import
{
prepareQuery
,
IPreparedQuery
,
scoreFuzzy2
,
pieceToQuery
}
from
'
vs/base/common/fuzzyScorer
'
;
import
{
IMatch
}
from
'
vs/base/common/filters
'
;
import
{
Codicon
}
from
'
vs/base/browser/ui/codicons/codicons
'
;
interface
ISymbolQuickPickItem
extends
IPickerQuickAccessItem
,
IQuickPickItemWithResource
{
score
?:
number
;
...
...
@@ -202,7 +203,7 @@ export class SymbolsQuickAccessProvider extends PickerQuickAccessProvider<ISymbo
strikethrough
:
deprecated
,
buttons
:
[
{
iconClass
:
openSideBySideDirection
===
'
right
'
?
'
codicon-split-horizontal
'
:
'
codicon-split-vertical
'
,
iconClass
:
openSideBySideDirection
===
'
right
'
?
Codicon
.
splitHorizontal
.
classNames
:
Codicon
.
splitVertical
.
classNames
,
tooltip
:
openSideBySideDirection
===
'
right
'
?
localize
(
'
openToSide
'
,
"
Open to the Side
"
)
:
localize
(
'
openToBottom
'
,
"
Open to the Bottom
"
)
}
],
...
...
src/vs/workbench/contrib/searchEditor/browser/searchEditor.ts
浏览文件 @
ecfd4db2
...
...
@@ -50,6 +50,7 @@ import { serializeSearchResultForEditor } from 'vs/workbench/contrib/searchEdito
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IPatternInfo
,
ISearchConfigurationProperties
,
ITextQuery
}
from
'
vs/workbench/services/search/common/search
'
;
import
{
searchDetails
}
from
'
vs/workbench/contrib/search/browser/searchIcons
'
;
const
RESULT_LINE_REGEX
=
/^
(\s
+
)(\d
+
)(
:|
)(\s
+
)(
.*
)
$/
;
const
FILE_LINE_REGEX
=
/^
(\S
.*
)
:$/
;
...
...
@@ -135,7 +136,7 @@ export class SearchEditor extends BaseTextEditor {
this
.
includesExcludesContainer
=
DOM
.
append
(
this
.
queryEditorContainer
,
DOM
.
$
(
'
.includes-excludes
'
));
// // Toggle query details button
this
.
toggleQueryDetailsButton
=
DOM
.
append
(
this
.
includesExcludesContainer
,
DOM
.
$
(
'
.expand
.codicon.codicon-ellipsis
'
,
{
tabindex
:
0
,
role
:
'
button
'
,
title
:
localize
(
'
moreSearch
'
,
"
Toggle Search Details
"
)
}));
this
.
toggleQueryDetailsButton
=
DOM
.
append
(
this
.
includesExcludesContainer
,
DOM
.
$
(
'
.expand
'
+
searchDetails
.
cssSelector
,
{
tabindex
:
0
,
role
:
'
button
'
,
title
:
localize
(
'
moreSearch
'
,
"
Toggle Search Details
"
)
}));
this
.
_register
(
DOM
.
addDisposableListener
(
this
.
toggleQueryDetailsButton
,
DOM
.
EventType
.
CLICK
,
e
=>
{
DOM
.
EventHelper
.
stop
(
e
);
this
.
toggleIncludesExcludes
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录