Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5ba46755
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,发现更多精彩内容 >>
提交
5ba46755
编写于
8月 12, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean-up
上级
a9701d86
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
66 addition
and
60 deletion
+66
-60
src/vs/editor/browser/standalone/simpleServices.ts
src/vs/editor/browser/standalone/simpleServices.ts
+3
-3
src/vs/editor/browser/standalone/standaloneCodeEditor.ts
src/vs/editor/browser/standalone/standaloneCodeEditor.ts
+5
-5
src/vs/editor/browser/standalone/standaloneServices.ts
src/vs/editor/browser/standalone/standaloneServices.ts
+2
-2
src/vs/editor/test/common/mocks/mockCodeEditor.ts
src/vs/editor/test/common/mocks/mockCodeEditor.ts
+1
-0
src/vs/platform/contextkey/browser/contextKeyService.ts
src/vs/platform/contextkey/browser/contextKeyService.ts
+37
-19
src/vs/platform/contextkey/common/contextkey.ts
src/vs/platform/contextkey/common/contextkey.ts
+7
-11
src/vs/platform/keybinding/browser/keybindingServiceImpl.ts
src/vs/platform/keybinding/browser/keybindingServiceImpl.ts
+4
-13
src/vs/platform/keybinding/test/common/mockKeybindingService.ts
.../platform/keybinding/test/common/mockKeybindingService.ts
+3
-3
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+2
-2
src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts
...services/keybinding/electron-browser/keybindingService.ts
+2
-2
未找到文件。
src/vs/editor/browser/standalone/simpleServices.ts
浏览文件 @
5ba46755
...
...
@@ -15,7 +15,7 @@ import {IEditor, IEditorInput, IEditorOptions, IEditorService, IResourceInput, I
import
{
AbstractExtensionService
,
ActivatedExtension
}
from
'
vs/platform/extensions/common/abstractExtensionService
'
;
import
{
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
ICommandService
,
ICommandHandler
}
from
'
vs/platform/commands/common/commands
'
;
import
{
KeybindingService
2
}
from
'
vs/platform/keybinding/browser/keybindingServiceImpl
'
;
import
{
KeybindingService
}
from
'
vs/platform/keybinding/browser/keybindingServiceImpl
'
;
import
{
IOSupport
}
from
'
vs/platform/keybinding/common/keybindingResolver
'
;
import
{
IKeybindingItem
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
...
...
@@ -199,7 +199,7 @@ export class SimpleMessageService implements IMessageService {
}
}
export
class
StandaloneKeybindingService
2
extends
KeybindingService2
{
export
class
StandaloneKeybindingService
extends
KeybindingService
{
private
static
LAST_GENERATED_ID
=
0
;
private
_dynamicKeybindings
:
IKeybindingItem
[];
...
...
@@ -221,7 +221,7 @@ export class StandaloneKeybindingService2 extends KeybindingService2 {
public
addDynamicKeybinding
(
keybinding
:
number
,
handler
:
ICommandHandler
,
when
:
string
,
commandId
:
string
=
null
):
string
{
if
(
commandId
===
null
)
{
commandId
=
'
DYNAMIC_
'
+
(
++
StandaloneKeybindingService
2
.
LAST_GENERATED_ID
);
commandId
=
'
DYNAMIC_
'
+
(
++
StandaloneKeybindingService
.
LAST_GENERATED_ID
);
}
var
parsedContext
=
IOSupport
.
readKeybindingWhen
(
when
);
this
.
_dynamicKeybindings
.
push
({
...
...
src/vs/editor/browser/standalone/standaloneCodeEditor.ts
浏览文件 @
5ba46755
...
...
@@ -16,7 +16,7 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
import
{
IActionDescriptor
,
ICodeEditorWidgetCreationOptions
,
IDiffEditorOptions
,
IModel
,
IModelChangedEvent
,
EventType
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
IEditorWorkerService
}
from
'
vs/editor/common/services/editorWorkerService
'
;
import
{
StandaloneKeybindingService
2
}
from
'
vs/editor/browser/standalone/simpleServices
'
;
import
{
StandaloneKeybindingService
}
from
'
vs/editor/browser/standalone/simpleServices
'
;
import
{
IEditorContextViewService
,
IEditorOverrideServices
,
ensureStaticPlatformServices
,
getOrCreateStaticServices
}
from
'
vs/editor/browser/standalone/standaloneServices
'
;
import
{
CodeEditorWidget
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
import
{
DiffEditorWidget
}
from
'
vs/editor/browser/widget/diffEditorWidget
'
;
...
...
@@ -58,7 +58,7 @@ export interface IStandaloneDiffEditor extends IDiffEditor {
export
class
StandaloneEditor
extends
CodeEditorWidget
implements
IStandaloneCodeEditor
{
private
_standaloneKeybindingService
:
StandaloneKeybindingService
2
;
private
_standaloneKeybindingService
:
StandaloneKeybindingService
;
private
_contextViewService
:
IEditorContextViewService
;
private
_ownsModel
:
boolean
;
private
_toDispose2
:
IDisposable
[];
...
...
@@ -78,7 +78,7 @@ export class StandaloneEditor extends CodeEditorWidget implements IStandaloneCod
options
=
options
||
{};
super
(
domElement
,
options
,
instantiationService
,
codeEditorService
,
commandService
,
contextKeyService
.
createScoped
(
domElement
),
telemetryService
);
if
(
keybindingService
instanceof
StandaloneKeybindingService
2
)
{
if
(
keybindingService
instanceof
StandaloneKeybindingService
)
{
this
.
_standaloneKeybindingService
=
keybindingService
;
}
...
...
@@ -165,7 +165,7 @@ export class StandaloneEditor extends CodeEditorWidget implements IStandaloneCod
export
class
StandaloneDiffEditor
extends
DiffEditorWidget
implements
IStandaloneDiffEditor
{
private
_contextViewService
:
IEditorContextViewService
;
private
_standaloneKeybindingService
:
StandaloneKeybindingService
2
;
private
_standaloneKeybindingService
:
StandaloneKeybindingService
;
private
_toDispose2
:
IDisposable
[];
constructor
(
...
...
@@ -180,7 +180,7 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon
)
{
super
(
domElement
,
options
,
editorWorkerService
,
contextKeyService
,
instantiationService
);
if
(
keybindingService
instanceof
StandaloneKeybindingService
2
)
{
if
(
keybindingService
instanceof
StandaloneKeybindingService
)
{
this
.
_standaloneKeybindingService
=
keybindingService
;
}
...
...
src/vs/editor/browser/standalone/standaloneServices.ts
浏览文件 @
5ba46755
...
...
@@ -38,7 +38,7 @@ import {MainThreadModeServiceImpl} from 'vs/editor/common/services/modeServiceIm
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
ModelServiceImpl
}
from
'
vs/editor/common/services/modelServiceImpl
'
;
import
{
CodeEditorServiceImpl
}
from
'
vs/editor/browser/services/codeEditorServiceImpl
'
;
import
{
SimpleConfigurationService
,
SimpleMessageService
,
SimpleExtensionService
,
StandaloneKeybindingService
2
}
from
'
vs/editor/browser/standalone/simpleServices
'
;
import
{
SimpleConfigurationService
,
SimpleMessageService
,
SimpleExtensionService
,
StandaloneKeybindingService
}
from
'
vs/editor/browser/standalone/simpleServices
'
;
import
{
ContextKeyService
}
from
'
vs/platform/contextkey/browser/contextKeyService
'
;
import
{
IMenuService
}
from
'
vs/platform/actions/common/actions
'
;
import
{
MenuService
}
from
'
vs/platform/actions/common/menuService
'
;
...
...
@@ -204,7 +204,7 @@ export function ensureDynamicPlatformServices(domElement:HTMLElement, services:
contextKeyService
=
services
.
contextKeyService
;
}
if
(
typeof
services
.
keybindingService
===
'
undefined
'
)
{
let
keybindingService
=
new
StandaloneKeybindingService
2
(
contextKeyService
,
services
.
commandService
,
services
.
messageService
,
domElement
);
let
keybindingService
=
new
StandaloneKeybindingService
(
contextKeyService
,
services
.
commandService
,
services
.
messageService
,
domElement
);
r
.
push
(
keybindingService
);
services
.
keybindingService
=
keybindingService
;
}
...
...
src/vs/editor/test/common/mocks/mockCodeEditor.ts
浏览文件 @
5ba46755
...
...
@@ -66,6 +66,7 @@ export class MockCodeEditor extends CommonCodeEditor {
}
export
class
MockScopeLocation
implements
IContextKeyServiceTarget
{
parentElement
:
IContextKeyServiceTarget
=
null
;
setAttribute
(
attr
:
string
,
value
:
string
):
void
{
}
removeAttribute
(
attr
:
string
):
void
{
}
hasAttribute
(
attr
:
string
):
boolean
{
return
false
;
}
...
...
src/vs/platform/contextkey/browser/contextKeyService.ts
浏览文件 @
5ba46755
...
...
@@ -7,16 +7,18 @@
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
KeybindingResolver
}
from
'
vs/platform/keybinding/common/keybindingResolver
'
;
import
{
IContextKey
,
IContextKeyServiceTarget
,
IContextKeyService
,
SET_CONTEXT_COMMAND_ID
,
KEYBINDING_CONTEXT_ATTR
,
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IContextKey
,
IContextKeyServiceTarget
,
IContextKeyService
,
SET_CONTEXT_COMMAND_ID
,
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
Event
,
{
Emitter
,
debounceEvent
}
from
'
vs/base/common/event
'
;
export
class
ContextValuesProvider
{
protected
_parent
:
ContextValuesProvider
;
protected
_value
:
any
;
const
KEYBINDING_CONTEXT_ATTR
=
'
data-keybinding-context
'
;
export
class
ContextValuesContainer
{
protected
_parent
:
ContextValuesContainer
;
protected
_value
:
{[
key
:
string
]:
any
;};
protected
_id
:
number
;
constructor
(
id
:
number
,
parent
:
ContextValues
Provid
er
)
{
constructor
(
id
:
number
,
parent
:
ContextValues
Contain
er
)
{
this
.
_id
=
id
;
this
.
_parent
=
parent
;
this
.
_value
=
Object
.
create
(
null
);
...
...
@@ -54,7 +56,7 @@ export class ContextValuesProvider {
}
}
class
ConfigAwareContextValues
Provider
extends
ContextValuesProvid
er
{
class
ConfigAwareContextValues
Container
extends
ContextValuesContain
er
{
private
_emitter
:
Emitter
<
string
>
;
private
_subscription
:
IDisposable
;
...
...
@@ -127,7 +129,7 @@ class ContextKey<T> implements IContextKey<T> {
}
public
get
():
T
{
return
this
.
_parent
.
getContextValue
<
T
>
(
this
.
_key
);
return
this
.
_parent
.
getContext
Key
Value
<
T
>
(
this
.
_key
);
}
}
...
...
@@ -167,7 +169,7 @@ export abstract class AbstractContextKeyService {
public
contextMatchesRules
(
rules
:
ContextKeyExpr
):
boolean
{
const
ctx
=
Object
.
create
(
null
);
this
.
getContext
(
this
.
_myContextId
).
fillInContext
(
ctx
);
this
.
getContext
ValuesContainer
(
this
.
_myContextId
).
fillInContext
(
ctx
);
const
result
=
KeybindingResolver
.
contextMatchesRules
(
ctx
,
rules
);
// console.group(rules.serialize() + ' -> ' + result);
// rules.keys().forEach(key => { console.log(key, ctx[key]); });
...
...
@@ -175,23 +177,29 @@ export abstract class AbstractContextKeyService {
return
result
;
}
public
getContextValue
<
T
>
(
key
:
string
):
T
{
return
this
.
getContext
(
this
.
_myContextId
).
getValue
<
T
>
(
key
);
public
getContext
Key
Value
<
T
>
(
key
:
string
):
T
{
return
this
.
getContext
ValuesContainer
(
this
.
_myContextId
).
getValue
<
T
>
(
key
);
}
public
setContext
(
key
:
string
,
value
:
any
):
void
{
if
(
this
.
getContext
(
this
.
_myContextId
).
setValue
(
key
,
value
))
{
if
(
this
.
getContext
ValuesContainer
(
this
.
_myContextId
).
setValue
(
key
,
value
))
{
this
.
_onDidChangeContextKey
.
fire
(
key
);
}
}
public
removeContext
(
key
:
string
):
void
{
if
(
this
.
getContext
(
this
.
_myContextId
).
removeValue
(
key
))
{
if
(
this
.
getContext
ValuesContainer
(
this
.
_myContextId
).
removeValue
(
key
))
{
this
.
_onDidChangeContextKey
.
fire
(
key
);
}
}
public
abstract
getContext
(
contextId
:
number
):
ContextValuesProvider
;
public
getContextValue
(
target
:
IContextKeyServiceTarget
):
any
{
let
res
=
Object
.
create
(
null
);
this
.
getContextValuesContainer
(
findContextAttr
(
target
)).
fillInContext
(
res
);
return
res
;
}
public
abstract
getContextValuesContainer
(
contextId
:
number
):
ContextValuesContainer
;
public
abstract
createChildContext
(
parentContextId
?:
number
):
number
;
public
abstract
disposeContext
(
contextId
:
number
):
void
;
}
...
...
@@ -200,7 +208,7 @@ export class ContextKeyService extends AbstractContextKeyService implements ICon
private
_lastContextId
:
number
;
private
_contexts
:
{
[
contextId
:
string
]:
ContextValues
Provid
er
;
[
contextId
:
string
]:
ContextValues
Contain
er
;
};
private
_toDispose
:
IDisposable
[]
=
[];
...
...
@@ -210,7 +218,7 @@ export class ContextKeyService extends AbstractContextKeyService implements ICon
this
.
_lastContextId
=
0
;
this
.
_contexts
=
Object
.
create
(
null
);
const
myContext
=
new
ConfigAwareContextValues
Provid
er
(
this
.
_myContextId
,
configurationService
,
this
.
_onDidChangeContextKey
);
const
myContext
=
new
ConfigAwareContextValues
Contain
er
(
this
.
_myContextId
,
configurationService
,
this
.
_onDidChangeContextKey
);
this
.
_contexts
[
String
(
this
.
_myContextId
)]
=
myContext
;
this
.
_toDispose
.
push
(
myContext
);
...
...
@@ -230,13 +238,13 @@ export class ContextKeyService extends AbstractContextKeyService implements ICon
this
.
_toDispose
=
dispose
(
this
.
_toDispose
);
}
public
getContext
(
contextId
:
number
):
ContextValuesProvid
er
{
public
getContext
ValuesContainer
(
contextId
:
number
):
ContextValuesContain
er
{
return
this
.
_contexts
[
String
(
contextId
)];
}
public
createChildContext
(
parentContextId
:
number
=
this
.
_myContextId
):
number
{
let
id
=
(
++
this
.
_lastContextId
);
this
.
_contexts
[
String
(
id
)]
=
new
ContextValues
Provider
(
id
,
this
.
getContext
(
parentContextId
));
this
.
_contexts
[
String
(
id
)]
=
new
ContextValues
Container
(
id
,
this
.
getContextValuesContainer
(
parentContextId
));
return
id
;
}
...
...
@@ -267,8 +275,8 @@ class ScopedContextKeyService extends AbstractContextKeyService {
return
this
.
_parent
.
onDidChangeContext
;
}
public
getContext
(
contextId
:
number
):
ContextValuesProvid
er
{
return
this
.
_parent
.
getContext
(
contextId
);
public
getContext
ValuesContainer
(
contextId
:
number
):
ContextValuesContain
er
{
return
this
.
_parent
.
getContext
ValuesContainer
(
contextId
);
}
public
createChildContext
(
parentContextId
:
number
=
this
.
_myContextId
):
number
{
...
...
@@ -280,6 +288,16 @@ class ScopedContextKeyService extends AbstractContextKeyService {
}
}
function
findContextAttr
(
domNode
:
IContextKeyServiceTarget
):
number
{
while
(
domNode
)
{
if
(
domNode
.
hasAttribute
(
KEYBINDING_CONTEXT_ATTR
))
{
return
parseInt
(
domNode
.
getAttribute
(
KEYBINDING_CONTEXT_ATTR
),
10
);
}
domNode
=
domNode
.
parentElement
;
}
return
0
;
}
CommandsRegistry
.
registerCommand
(
SET_CONTEXT_COMMAND_ID
,
function
(
accessor
,
contextKey
:
any
,
contextValue
:
any
)
{
accessor
.
get
(
IContextKeyService
).
createKey
(
String
(
contextKey
),
contextValue
);
});
src/vs/platform/contextkey/common/contextkey.ts
浏览文件 @
5ba46755
...
...
@@ -7,8 +7,6 @@
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
Event
from
'
vs/base/common/event
'
;
export
const
KEYBINDING_CONTEXT_ATTR
=
'
data-keybinding-context
'
;
export
enum
ContextKeyExprType
{
Defined
=
1
,
Not
=
2
,
...
...
@@ -430,7 +428,7 @@ export class RawContextKey<T> extends ContextKeyDefinedExpr {
}
public
getValue
(
target
:
IContextKeyService
):
T
{
return
target
.
getContextValue
<
T
>
(
this
.
key
);
return
target
.
getContext
Key
Value
<
T
>
(
this
.
key
);
}
public
toNegated
():
ContextKeyExpr
{
...
...
@@ -449,12 +447,11 @@ export interface IContextKey<T> {
}
export
interface
IContextKeyServiceTarget
{
parentElement
:
IContextKeyServiceTarget
;
setAttribute
(
attr
:
string
,
value
:
string
):
void
;
removeAttribute
(
attr
:
string
):
void
;
}
export
interface
IContextValuesProvider
{
fillInContext
(
bucket
:
any
):
void
;
hasAttribute
(
attr
:
string
):
boolean
;
getAttribute
(
attr
:
string
):
string
;
}
export
let
IContextKeyService
=
createDecorator
<
IContextKeyService
>
(
'
contextKeyService
'
);
...
...
@@ -466,11 +463,10 @@ export interface IContextKeyService {
onDidChangeContext
:
Event
<
string
[]
>
;
createKey
<
T
>
(
key
:
string
,
defaultValue
:
T
):
IContextKey
<
T
>
;
contextMatchesRules
(
rules
:
ContextKeyExpr
):
boolean
;
getContextValue
<
T
>
(
key
:
string
):
T
;
createScoped
(
domNode
:
IContextKeyServiceTarget
):
IContextKeyService
;
getContextKeyValue
<
T
>
(
key
:
string
):
T
;
getContext
(
contextId
:
number
):
IContextValuesProvider
;
createScoped
(
target
:
IContextKeyServiceTarget
):
IContextKeyService
;
getContextValue
(
target
:
IContextKeyServiceTarget
):
any
;
}
export
const
SET_CONTEXT_COMMAND_ID
=
'
setContext
'
;
src/vs/platform/keybinding/browser/keybindingServiceImpl.ts
浏览文件 @
5ba46755
...
...
@@ -16,12 +16,12 @@ import {IKeyboardEvent, StandardKeyboardEvent} from 'vs/base/browser/keyboardEve
import
{
ICommandService
,
CommandsRegistry
,
ICommandHandler
,
ICommandHandlerDescription
}
from
'
vs/platform/commands/common/commands
'
;
import
{
KeybindingResolver
}
from
'
vs/platform/keybinding/common/keybindingResolver
'
;
import
{
IKeybindingItem
,
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IContextKeyService
,
KEYBINDING_CONTEXT_ATTR
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
KeybindingsRegistry
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
IStatusbarService
}
from
'
vs/platform/statusbar/common/statusbar
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
export
abstract
class
KeybindingService
2
implements
IKeybindingService
{
export
abstract
class
KeybindingService
implements
IKeybindingService
{
public
_serviceBrand
:
any
;
private
_toDispose
:
IDisposable
[]
=
[];
...
...
@@ -141,8 +141,7 @@ export abstract class KeybindingService2 implements IKeybindingService {
return
;
}
let
contextValue
=
Object
.
create
(
null
);
this
.
_contextKeyService
.
getContext
(
this
.
_findContextAttr
(
e
.
target
)).
fillInContext
(
contextValue
);
let
contextValue
=
this
.
_contextKeyService
.
getContextValue
(
e
.
target
);
// console.log(JSON.stringify(contextValue, null, '\t'));
let
resolveResult
=
this
.
_getResolver
().
resolve
(
contextValue
,
this
.
_currentChord
,
e
.
asKeybinding
());
...
...
@@ -182,13 +181,5 @@ export abstract class KeybindingService2 implements IKeybindingService {
}
}
private
_findContextAttr
(
domNode
:
HTMLElement
):
number
{
while
(
domNode
)
{
if
(
domNode
.
hasAttribute
(
KEYBINDING_CONTEXT_ATTR
))
{
return
parseInt
(
domNode
.
getAttribute
(
KEYBINDING_CONTEXT_ATTR
),
10
);
}
domNode
=
domNode
.
parentElement
;
}
return
0
;
}
}
src/vs/platform/keybinding/test/common/mockKeybindingService.ts
浏览文件 @
5ba46755
...
...
@@ -8,7 +8,7 @@ import {IHTMLContentElement} from 'vs/base/common/htmlContent';
import
{
Keybinding
}
from
'
vs/base/common/keyCodes
'
;
import
Event
from
'
vs/base/common/event
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IContextKey
,
IContextKeyService
,
IContextValuesProvider
,
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IContextKey
,
IContextKeyService
,
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
class
MockKeybindingContextKey
<
T
>
implements
IContextKey
<
T
>
{
private
_key
:
string
;
...
...
@@ -48,10 +48,10 @@ export class MockKeybindingService implements IContextKeyService {
public
get
onDidChangeContext
():
Event
<
string
[]
>
{
return
Event
.
None
;
}
public
getContextValue
(
key
:
string
)
{
public
getContext
Key
Value
(
key
:
string
)
{
return
;
}
public
getContext
(
contextId
:
number
):
IContextValuesProvider
{
public
getContext
Value
(
domNode
:
HTMLElement
):
any
{
return
null
;
}
public
createScoped
(
domNode
:
HTMLElement
):
IContextKeyService
{
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
5ba46755
...
...
@@ -44,7 +44,7 @@ import {Position, Parts, IPartService} from 'vs/workbench/services/part/common/p
import
{
IWorkspaceContextService
as
IWorkbenchWorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
ContextMenuService
}
from
'
vs/workbench/services/contextview/electron-browser/contextmenuService
'
;
import
{
WorkbenchKeybindingService
2
}
from
'
vs/workbench/services/keybinding/electron-browser/keybindingService
'
;
import
{
WorkbenchKeybindingService
}
from
'
vs/workbench/services/keybinding/electron-browser/keybindingService
'
;
import
{
ContextKeyService
}
from
'
vs/platform/contextkey/browser/contextKeyService
'
;
import
{
IWorkspace
,
IConfiguration
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
...
...
@@ -356,7 +356,7 @@ export class Workbench implements IPartService {
this
.
contextKeyService
=
this
.
instantiationService
.
createInstance
(
ContextKeyService
);
serviceCollection
.
set
(
IContextKeyService
,
this
.
contextKeyService
);
this
.
keybindingService
=
this
.
instantiationService
.
createInstance
(
WorkbenchKeybindingService
2
,
<
any
>
window
);
this
.
keybindingService
=
this
.
instantiationService
.
createInstance
(
WorkbenchKeybindingService
,
<
any
>
window
);
serviceCollection
.
set
(
IKeybindingService
,
this
.
keybindingService
);
// Context Menu
...
...
src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts
浏览文件 @
5ba46755
...
...
@@ -12,7 +12,7 @@ import * as platform from 'vs/base/common/platform';
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IExtensionMessageCollector
,
ExtensionsRegistry
}
from
'
vs/platform/extensions/common/extensionsRegistry
'
;
import
{
Extensions
,
IJSONContributionRegistry
}
from
'
vs/platform/jsonschemas/common/jsonContributionRegistry
'
;
import
{
KeybindingService
2
}
from
'
vs/platform/keybinding/browser/keybindingServiceImpl
'
;
import
{
KeybindingService
}
from
'
vs/platform/keybinding/browser/keybindingServiceImpl
'
;
import
{
IStatusbarService
}
from
'
vs/platform/statusbar/common/statusbar
'
;
import
{
IOSupport
}
from
'
vs/platform/keybinding/common/keybindingResolver
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
...
...
@@ -114,7 +114,7 @@ let keybindingsExtPoint = ExtensionsRegistry.registerExtensionPoint<ContributedK
]
});
export
class
WorkbenchKeybindingService
2
extends
KeybindingService2
{
export
class
WorkbenchKeybindingService
extends
KeybindingService
{
private
contextService
:
IWorkspaceContextService
;
private
eventService
:
IEventService
;
private
telemetryService
:
ITelemetryService
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录