Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f9c0e7b7
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,发现更多精彩内容 >>
提交
f9c0e7b7
编写于
12月 08, 2015
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Introduce a new setting to enable fuzzy for pickers
上级
65a35be7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
77 addition
and
21 deletion
+77
-21
src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
.../workbench/browser/parts/quickopen/quickOpenController.ts
+28
-1
src/vs/workbench/browser/workbench.ts
src/vs/workbench/browser/workbench.ts
+3
-0
src/vs/workbench/electron-browser/main.contribution.ts
src/vs/workbench/electron-browser/main.contribution.ts
+15
-0
src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts
...rkbench/parts/quickopen/browser/quickopen.contribution.ts
+2
-18
src/vs/workbench/services/quickopen/browser/quickOpenService.ts
.../workbench/services/quickopen/browser/quickOpenService.ts
+5
-0
src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts
.../workbench/test/browser/parts/quickOpen/quickopen.test.ts
+2
-1
src/vs/workbench/test/browser/servicesTestUtils.ts
src/vs/workbench/test/browser/servicesTestUtils.ts
+22
-1
未找到文件。
src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
浏览文件 @
f9c0e7b7
...
...
@@ -13,6 +13,7 @@ import strings = require('vs/base/common/strings');
import
filters
=
require
(
'
vs/base/common/filters
'
);
import
uuid
=
require
(
'
vs/base/common/uuid
'
);
import
types
=
require
(
'
vs/base/common/types
'
);
import
{
ListenerUnbind
}
from
'
vs/base/common/eventEmitter
'
;
import
{
Mode
,
IContext
,
IAutoFocus
,
IQuickNavigateConfiguration
,
IModel
}
from
'
vs/base/parts/quickopen/browser/quickOpen
'
;
import
{
QuickOpenEntryItem
,
QuickOpenEntry
,
QuickOpenModel
,
QuickOpenEntryGroup
}
from
'
vs/base/parts/quickopen/browser/quickOpenModel
'
;
import
{
QuickOpenWidget
}
from
'
vs/base/parts/quickopen/browser/quickOpenWidget
'
;
...
...
@@ -38,8 +39,9 @@ import {IEventService} from 'vs/platform/event/common/event';
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IMessageService
,
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IWorkspaceContextService
}
from
'
vs/
platform/workspace/common/workspa
ce
'
;
import
{
IWorkspaceContextService
}
from
'
vs/
workbench/services/workspace/common/contextServi
ce
'
;
import
{
IKeybindingService
,
IKeybindingContextKey
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
IConfigurationService
,
IConfigurationServiceEvent
,
ConfigurationServiceEventTypes
}
from
'
vs/platform/configuration/common/configuration
'
;
const
ID
=
'
workbench.component.quickopen
'
;
const
EDITOR_HISTORY_STORAGE_KEY
=
'
quickopen.editorhistory
'
;
...
...
@@ -77,6 +79,8 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
private
actionProvider
=
new
ContributableActionProvider
();
private
previousValue
=
''
;
private
visibilityChangeTimeoutHandle
:
number
;
private
fuzzyMatchingEnabled
:
boolean
;
private
configurationListenerUnbind
:
ListenerUnbind
;
constructor
(
private
eventService
:
IEventService
,
...
...
@@ -86,6 +90,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
private
messageService
:
IMessageService
,
private
telemetryService
:
ITelemetryService
,
private
contextService
:
IWorkspaceContextService
,
private
configurationService
:
IConfigurationService
,
keybindingService
:
IKeybindingService
)
{
super
(
ID
);
...
...
@@ -97,8 +102,22 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
this
.
inQuickOpenMode
=
keybindingService
.
createKey
(
QUICK_OPEN_MODE
,
false
);
this
.
updateFuzzyMatching
(
contextService
.
getOptions
().
globalSettings
.
settings
);
this
.
_onShow
=
new
EventSource
<
()
=>
void
>
();
this
.
_onHide
=
new
EventSource
<
()
=>
void
>
();
this
.
registerListeners
();
}
private
registerListeners
():
void
{
// Listen to configuration changes
this
.
configurationListenerUnbind
=
this
.
configurationService
.
addListener
(
ConfigurationServiceEventTypes
.
UPDATED
,
(
e
:
IConfigurationServiceEvent
)
=>
this
.
updateFuzzyMatching
(
e
.
config
));
}
private
updateFuzzyMatching
(
configuration
:
any
):
void
{
this
.
fuzzyMatchingEnabled
=
configuration
.
picker
&&
configuration
.
picker
.
enableFuzzy
;
}
public
get
onShow
():
EventProvider
<
()
=>
void
>
{
...
...
@@ -117,6 +136,10 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
return
this
.
editorHistoryModel
;
}
public
isFuzzyMatchingEnabled
():
boolean
{
return
this
.
fuzzyMatchingEnabled
;
}
public
create
():
void
{
// Listen on Editor Input Changes to show in MRU List
...
...
@@ -829,6 +852,10 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
this
.
pickOpenWidget
.
dispose
();
}
if
(
this
.
configurationListenerUnbind
)
{
this
.
configurationListenerUnbind
();
}
super
.
dispose
();
}
}
...
...
src/vs/workbench/browser/workbench.ts
浏览文件 @
f9c0e7b7
...
...
@@ -29,6 +29,7 @@ import {HistoryService} from 'vs/workbench/services/history/browser/history';
import
{
ActivitybarPart
}
from
'
vs/workbench/browser/parts/activitybar/activitybarPart
'
;
import
{
EditorPart
}
from
'
vs/workbench/browser/parts/editor/editorPart
'
;
import
{
SidebarPart
}
from
'
vs/workbench/browser/parts/sidebar/sidebarPart
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
StatusbarPart
}
from
'
vs/workbench/browser/parts/statusbar/statusbarPart
'
;
import
{
WorkbenchLayout
,
LayoutOptions
}
from
'
vs/workbench/browser/layout
'
;
import
{
IActionBarRegistry
,
Extensions
as
ActionBarExtensions
}
from
'
vs/workbench/browser/actionBarRegistry
'
;
...
...
@@ -270,6 +271,7 @@ export class Workbench implements IPartService {
this
.
keybindingService
=
this
.
instantiationService
.
getInstance
(
IKeybindingService
);
this
.
contextService
=
this
.
instantiationService
.
getInstance
(
IWorkbenchWorkspaceContextService
);
this
.
telemetryService
=
this
.
instantiationService
.
getInstance
(
ITelemetryService
);
let
configurationService
=
this
.
instantiationService
.
getInstance
(
IConfigurationService
);
let
messageService
=
this
.
instantiationService
.
getInstance
(
IMessageService
);
if
(
this
.
keybindingService
instanceof
AbstractKeybindingService
)
{
(
<
AbstractKeybindingService
><
any
>
this
.
keybindingService
).
setMessageService
(
messageService
);
...
...
@@ -339,6 +341,7 @@ export class Workbench implements IPartService {
messageService
,
this
.
telemetryService
,
this
.
contextService
,
configurationService
,
this
.
keybindingService
);
this
.
toDispose
.
push
(
this
.
quickOpen
);
...
...
src/vs/workbench/electron-browser/main.contribution.ts
浏览文件 @
f9c0e7b7
...
...
@@ -79,4 +79,19 @@ configurationRegistry.registerConfiguration({
'
description
'
:
nls
.
localize
(
'
updateChannel
'
,
"
Configure the update channel to receive updates from. Requires a restart after change.
"
)
},
}
});
// Picker Configuration
configurationRegistry
.
registerConfiguration
({
'
id
'
:
'
picker
'
,
'
order
'
:
11
,
'
title
'
:
nls
.
localize
(
'
filterConfigurationTitle
'
,
"
Picker configuration
"
),
'
type
'
:
'
object
'
,
'
properties
'
:
{
'
picker.enableFuzzy
'
:
{
'
type
'
:
'
boolean
'
,
'
default
'
:
false
,
'
description
'
:
nls
.
localize
(
'
enableFuzzy
'
,
"
Enable or disable fuzzy matching and sorting in the picker.
"
)
}
}
});
\ No newline at end of file
src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts
浏览文件 @
f9c0e7b7
...
...
@@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
env
=
require
(
'
vs/base/common/platform
'
);
...
...
@@ -107,20 +107,4 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(GotoSymbolAction, Goto
HELP_PREFIX
,
nls
.
localize
(
'
helpDescription
'
,
"
Show Help
"
)
)
);
// Configuration
const
configurationRegistry
=
<
IConfigurationRegistry
>
Registry
.
as
(
ConfigurationExtensions
.
Configuration
);
configurationRegistry
.
registerConfiguration
({
'
id
'
:
'
filter
'
,
'
order
'
:
11
,
'
title
'
:
nls
.
localize
(
'
filterConfigurationTitle
'
,
"
Filter configuration
"
),
'
type
'
:
'
object
'
,
'
properties
'
:
{
'
filter.enableFuzzy
'
:
{
'
type
'
:
'
boolean
'
,
'
default
'
:
false
,
'
description
'
:
nls
.
localize
(
'
enableFuzzy
'
,
"
Enable or disable fuzzy matching in controls that narrow down while typing.
"
)
}
}
});
\ No newline at end of file
);
\ No newline at end of file
src/vs/workbench/services/quickopen/browser/quickOpenService.ts
浏览文件 @
f9c0e7b7
...
...
@@ -125,4 +125,9 @@ export interface IQuickOpenService {
* Allows to register on the event that quick open is hiding
*/
onHide
:
EventProvider
<
()
=>
void
>
;
/**
* A boolean to indicate if fuzzy matching is enabled or not.
*/
isFuzzyMatchingEnabled
():
boolean
;
}
\ No newline at end of file
src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts
浏览文件 @
f9c0e7b7
...
...
@@ -6,7 +6,7 @@
'
use strict
'
;
import
*
as
assert
from
'
assert
'
;
import
{
TestKeybindingService
,
TestContextService
,
TestStorageService
,
TestEventService
,
TestEditorService
,
TestQuickOpenService
}
from
'
vs/workbench/test/browser/servicesTestUtils
'
;
import
{
TestKeybindingService
,
TestCon
figurationService
,
TestCon
textService
,
TestStorageService
,
TestEventService
,
TestEditorService
,
TestQuickOpenService
}
from
'
vs/workbench/test/browser/servicesTestUtils
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
EditorHistoryModel
,
EditorHistoryEntry
}
from
'
vs/workbench/browser/parts/quickopen/editorHistoryModel
'
;
import
{
QuickOpenHandlerDescriptor
,
IQuickOpenRegistry
,
Extensions
as
QuickOpenExtensions
}
from
'
vs/workbench/browser/quickopen
'
;
...
...
@@ -216,6 +216,7 @@ suite('Workbench QuickOpen', () => {
null
,
null
,
contextService
,
new
TestConfigurationService
(),
new
TestKeybindingService
()
);
...
...
src/vs/workbench/test/browser/servicesTestUtils.ts
浏览文件 @
f9c0e7b7
...
...
@@ -27,6 +27,7 @@ import Severity from 'vs/base/common/severity';
import
Arrays
=
require
(
'
vs/base/common/arrays
'
);
import
Errors
=
require
(
'
vs/base/common/errors
'
);
import
http
=
require
(
'
vs/base/common/http
'
);
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
UntitledEditorService
=
require
(
'
vs/workbench/services/untitled/browser/untitledEditorService
'
);
import
WorkbenchEditorService
=
require
(
'
vs/workbench/services/editor/common/editorService
'
);
...
...
@@ -71,7 +72,11 @@ export class TestContextService implements WorkspaceContextService.IWorkspaceCon
constructor
(
workspace
:
any
=
TestWorkspace
,
configuration
:
any
=
TestConfiguration
,
options
:
any
=
null
)
{
this
.
workspace
=
workspace
;
this
.
configuration
=
configuration
;
this
.
options
=
options
;
this
.
options
=
options
||
{
globalSettings
:
{
settings
:
{}
}
};
}
public
getWorkspace
():
IWorkspace
{
...
...
@@ -500,6 +505,10 @@ export class TestQuickOpenService implements QuickOpenService.IQuickOpenService
return
null
;
}
public
isFuzzyMatchingEnabled
():
boolean
{
return
false
;
}
public
removeEditorHistoryEntry
(
input
:
WorkbenchEditorCommon
.
EditorInput
):
void
{}
public
dispose
()
{}
public
quickNavigate
():
void
{}
...
...
@@ -530,4 +539,16 @@ export const TestFileService = {
};
});
}
}
export
class
TestConfigurationService
extends
EventEmitter
.
EventEmitter
implements
IConfigurationService
{
public
serviceId
=
IConfigurationService
;
public
loadConfiguration
(
section
?:
string
):
TPromise
<
any
>
{
return
TPromise
.
as
({});
}
public
hasWorkspaceConfiguration
():
boolean
{
return
false
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录