Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
df93ca01
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,发现更多精彩内容 >>
提交
df93ca01
编写于
12月 11, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use keybindingService.mightProducePrintableCharacter in workbench lists/trees
上级
bb2da0c7
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
48 addition
and
27 deletion
+48
-27
src/vs/base/browser/ui/list/list.ts
src/vs/base/browser/ui/list/list.ts
+2
-0
src/vs/base/browser/ui/list/listWidget.ts
src/vs/base/browser/ui/list/listWidget.ts
+12
-10
src/vs/platform/list/browser/listService.ts
src/vs/platform/list/browser/listService.ts
+22
-9
src/vs/workbench/parts/debug/browser/loadedScriptsView.ts
src/vs/workbench/parts/debug/browser/loadedScriptsView.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/callStackView.ts
...s/workbench/parts/debug/electron-browser/callStackView.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/debugHover.ts
src/vs/workbench/parts/debug/electron-browser/debugHover.ts
+4
-2
src/vs/workbench/parts/debug/electron-browser/repl.ts
src/vs/workbench/parts/debug/electron-browser/repl.ts
+4
-2
src/vs/workbench/parts/debug/electron-browser/variablesView.ts
...s/workbench/parts/debug/electron-browser/variablesView.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts
...ench/parts/debug/electron-browser/watchExpressionsView.ts
+1
-1
未找到文件。
src/vs/base/browser/ui/list/list.ts
浏览文件 @
df93ca01
...
...
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
GestureEvent
}
from
'
vs/base/browser/touch
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
export
interface
IListVirtualDelegate
<
T
>
{
getHeight
(
element
:
T
):
number
;
...
...
@@ -56,4 +57,5 @@ export interface IIdentityProvider<T> {
export
interface
ITypeLabelProvider
<
T
>
{
getTypeLabel
(
element
:
T
):
{
toString
():
string
;
};
mightProducePrintableCharacter
?(
event
:
IKeyboardEvent
):
boolean
;
}
\ No newline at end of file
src/vs/base/browser/ui/list/listWidget.ts
浏览文件 @
df93ca01
...
...
@@ -13,7 +13,7 @@ import * as DOM from 'vs/base/browser/dom';
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
Gesture
}
from
'
vs/base/browser/touch
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
StandardKeyboardEvent
,
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
Event
,
Emitter
,
EventBufferer
}
from
'
vs/base/common/event
'
;
import
{
domEvent
}
from
'
vs/base/browser/event
'
;
import
{
IListVirtualDelegate
,
IListRenderer
,
IListEvent
,
IListContextMenuEvent
,
IListMouseEvent
,
IListTouchEvent
,
IListGestureEvent
,
IIdentityProvider
,
ITypeLabelProvider
}
from
'
./list
'
;
...
...
@@ -330,6 +330,16 @@ enum TypeLabelControllerState {
class
TypeLabelController
<
T
>
implements
IDisposable
{
private
static
mightProducePrintableCharacter
(
event
:
IKeyboardEvent
):
boolean
{
if
(
event
.
ctrlKey
||
event
.
metaKey
||
event
.
altKey
)
{
return
false
;
}
return
(
event
.
keyCode
>=
KeyCode
.
KEY_A
&&
event
.
keyCode
<=
KeyCode
.
KEY_Z
)
||
(
event
.
keyCode
>=
KeyCode
.
KEY_0
&&
event
.
keyCode
<=
KeyCode
.
KEY_9
)
||
(
event
.
keyCode
>=
KeyCode
.
US_SEMICOLON
&&
event
.
keyCode
<=
KeyCode
.
US_QUOTE
);
}
private
state
:
TypeLabelControllerState
=
TypeLabelControllerState
.
Idle
;
private
disposables
:
IDisposable
[]
=
[];
...
...
@@ -340,15 +350,7 @@ class TypeLabelController<T> implements IDisposable {
)
{
const
onChar
=
Event
.
chain
(
domEvent
(
view
.
domNode
,
'
keydown
'
))
.
map
(
event
=>
new
StandardKeyboardEvent
(
event
))
.
filter
(
event
=>
{
if
(
event
.
ctrlKey
||
event
.
metaKey
||
event
.
altKey
)
{
return
false
;
}
return
(
event
.
keyCode
>=
KeyCode
.
KEY_A
&&
event
.
keyCode
<=
KeyCode
.
KEY_Z
)
||
(
event
.
keyCode
>=
KeyCode
.
KEY_0
&&
event
.
keyCode
<=
KeyCode
.
KEY_9
)
||
(
event
.
keyCode
>=
KeyCode
.
US_SEMICOLON
&&
event
.
keyCode
<=
KeyCode
.
US_QUOTE
);
})
.
filter
(
typeLabelProvider
.
mightProducePrintableCharacter
?
e
=>
typeLabelProvider
.
mightProducePrintableCharacter
!
(
e
)
:
e
=>
TypeLabelController
.
mightProducePrintableCharacter
(
e
))
.
map
(
event
=>
event
.
browserEvent
.
key
)
.
event
;
...
...
src/vs/platform/list/browser/listService.ts
浏览文件 @
df93ca01
...
...
@@ -161,13 +161,22 @@ class WorkbenchOpenController implements IOpenController {
}
}
function
handleListControllers
<
T
>
(
options
:
IListOptions
<
T
>
,
configurationService
:
IConfiguration
Service
):
IListOptions
<
T
>
{
function
toWorkbenchListOptions
<
T
>
(
options
:
IListOptions
<
T
>
,
configurationService
:
IConfigurationService
,
keybindingService
:
IKeybinding
Service
):
IListOptions
<
T
>
{
if
(
options
.
multipleSelectionSupport
!==
false
&&
!
options
.
multipleSelectionController
)
{
options
.
multipleSelectionController
=
new
MultipleSelectionController
(
configurationService
);
}
options
.
openController
=
new
WorkbenchOpenController
(
configurationService
,
options
.
openController
);
if
(
options
.
typeLabelProvider
)
{
const
tlp
=
options
.
typeLabelProvider
;
options
.
typeLabelProvider
=
{
getTypeLabel
(
e
)
{
return
tlp
.
getTypeLabel
(
e
);
},
mightProducePrintableCharacter
(
e
)
{
return
keybindingService
.
mightProducePrintableCharacter
(
e
);
}
};
}
return
options
;
}
...
...
@@ -219,7 +228,8 @@ export class WorkbenchList<T> extends List<T> {
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IListService
listService
:
IListService
,
@
IThemeService
themeService
:
IThemeService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
container
,
delegate
,
renderers
,
{
...
...
@@ -227,7 +237,7 @@ export class WorkbenchList<T> extends List<T> {
selectOnMouseDown
:
true
,
styleController
:
new
DefaultStyleController
(
getSharedListStyleSheet
()),
...
computeStyles
(
themeService
.
getTheme
(),
defaultListStyles
),
...
handleListControllers
(
options
,
configuration
Service
)
...
toWorkbenchListOptions
(
options
,
configurationService
,
keybinding
Service
)
}
as
IListOptions
<
T
>
);
...
...
@@ -294,7 +304,8 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IListService
listService
:
IListService
,
@
IThemeService
themeService
:
IThemeService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
container
,
delegate
,
renderers
,
{
...
...
@@ -302,7 +313,7 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
selectOnMouseDown
:
true
,
styleController
:
new
DefaultStyleController
(
getSharedListStyleSheet
()),
...
computeStyles
(
themeService
.
getTheme
(),
defaultListStyles
),
...
handleListControllers
(
options
,
configuration
Service
)
...
toWorkbenchListOptions
(
options
,
configurationService
,
keybinding
Service
)
}
as
IListOptions
<
T
>
);
...
...
@@ -885,14 +896,15 @@ export class WorkbenchObjectTree<T extends NonNullable<any>, TFilterData = void>
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IListService
listService
:
IListService
,
@
IThemeService
themeService
:
IThemeService
,
@
IConfigurationService
configurationService
:
IConfigurationService
@
IConfigurationService
configurationService
:
IConfigurationService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
container
,
delegate
,
renderers
,
{
keyboardSupport
:
false
,
selectOnMouseDown
:
true
,
styleController
:
new
DefaultStyleController
(
getSharedListStyleSheet
()),
...
computeStyles
(
themeService
.
getTheme
(),
defaultListStyles
),
...
handleListControllers
(
options
,
configuration
Service
)
...
toWorkbenchListOptions
(
options
,
configurationService
,
keybinding
Service
)
});
this
.
contextKeyService
=
createScopedContextKeyService
(
contextKeyService
,
this
);
...
...
@@ -948,14 +960,15 @@ export class WorkbenchAsyncDataTree<T extends NonNullable<any>, TFilterData = vo
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IListService
listService
:
IListService
,
@
IThemeService
themeService
:
IThemeService
,
@
IConfigurationService
configurationService
:
IConfigurationService
@
IConfigurationService
configurationService
:
IConfigurationService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
container
,
delegate
,
renderers
,
dataSource
,
{
keyboardSupport
:
false
,
selectOnMouseDown
:
true
,
styleController
:
new
DefaultStyleController
(
getSharedListStyleSheet
()),
...
computeStyles
(
themeService
.
getTheme
(),
defaultListStyles
),
...
handleListControllers
(
options
,
configuration
Service
)
...
toWorkbenchListOptions
(
options
,
configurationService
,
keybinding
Service
)
});
this
.
contextKeyService
=
createScopedContextKeyService
(
contextKeyService
,
this
);
...
...
src/vs/workbench/parts/debug/browser/loadedScriptsView.ts
浏览文件 @
df93ca01
...
...
@@ -409,7 +409,7 @@ export class LoadedScriptsView extends ViewletPanel {
accessibilityProvider
:
new
LoadedSciptsAccessibilityProvider
(),
ariaLabel
:
nls
.
localize
({
comment
:
[
'
Debug is a noun in this context, not a verb.
'
],
key
:
'
loadedScriptsAriaLabel
'
},
"
Debug Loaded Scripts
"
),
},
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
,
this
.
configurationService
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
,
this
.
configurationService
,
this
.
keybindingService
);
this
.
changeScheduler
=
new
RunOnceScheduler
(()
=>
{
...
...
src/vs/workbench/parts/debug/electron-browser/callStackView.ts
浏览文件 @
df93ca01
...
...
@@ -125,7 +125,7 @@ export class CallStackView extends ViewletPanel {
return
element
.
getId
();
}
}
},
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
,
this
.
configurationService
);
},
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
,
this
.
configurationService
,
this
.
keybindingService
);
const
callstackNavigator
=
new
TreeResourceNavigator2
(
this
.
tree
);
this
.
disposables
.
push
(
callstackNavigator
);
...
...
src/vs/workbench/parts/debug/electron-browser/debugHover.ts
浏览文件 @
df93ca01
...
...
@@ -31,6 +31,7 @@ import { WorkbenchAsyncDataTree, IListService } from 'vs/platform/list/browser/l
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
coalesce
}
from
'
vs/base/common/arrays
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
const
$
=
dom
.
$
;
const
MAX_TREE_HEIGHT
=
324
;
...
...
@@ -61,7 +62,8 @@ export class DebugHoverWidget implements IContentWidget {
@
IThemeService
private
themeService
:
IThemeService
,
@
IContextKeyService
private
contextKeyService
:
IContextKeyService
,
@
IListService
private
listService
:
IListService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IKeybindingService
private
keybindingService
:
IKeybindingService
)
{
this
.
toDispose
=
[];
...
...
@@ -83,7 +85,7 @@ export class DebugHoverWidget implements IContentWidget {
ariaLabel
:
nls
.
localize
(
'
treeAriaLabel
'
,
"
Debug Hover
"
),
accessibilityProvider
:
new
DebugHoverAccessibilityProvider
(),
mouseSupport
:
false
},
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
,
this
.
configurationService
);
},
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
,
this
.
configurationService
,
this
.
keybindingService
);
this
.
valueContainer
=
$
(
'
.value
'
);
this
.
valueContainer
.
tabIndex
=
0
;
...
...
src/vs/workbench/parts/debug/electron-browser/repl.ts
浏览文件 @
df93ca01
...
...
@@ -67,6 +67,7 @@ import { WorkbenchAsyncDataTree, IListService } from 'vs/platform/list/browser/l
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
ITextResourcePropertiesService
}
from
'
vs/editor/common/services/resourceConfiguration
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
const
$
=
dom
.
$
;
...
...
@@ -122,7 +123,8 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
@
IContextMenuService
private
contextMenuService
:
IContextMenuService
,
@
IListService
private
listService
:
IListService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
ITextResourcePropertiesService
private
textResourcePropertiesService
:
ITextResourcePropertiesService
@
ITextResourcePropertiesService
private
textResourcePropertiesService
:
ITextResourcePropertiesService
,
@
IKeybindingService
private
keybindingService
:
IKeybindingService
)
{
super
(
REPL_ID
,
telemetryService
,
themeService
,
storageService
);
...
...
@@ -360,7 +362,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
accessibilityProvider
:
new
ReplAccessibilityProvider
(),
identityProvider
:
{
getId
:
element
=>
element
.
getId
()
},
mouseSupport
:
false
},
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
,
this
.
configurationService
);
},
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
,
this
.
configurationService
,
this
.
keybindingService
);
this
.
toDispose
.
push
(
this
.
tree
.
onContextMenu
(
e
=>
this
.
onContextMenu
(
e
)));
// Make sure to select the session if debugging is already active
...
...
src/vs/workbench/parts/debug/electron-browser/variablesView.ts
浏览文件 @
df93ca01
...
...
@@ -80,7 +80,7 @@ export class VariablesView extends ViewletPanel {
ariaLabel
:
nls
.
localize
(
'
variablesAriaTreeLabel
'
,
"
Debug Variables
"
),
accessibilityProvider
:
new
VariablesAccessibilityProvider
(),
identityProvider
:
{
getId
:
element
=>
element
.
getId
()
}
},
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
,
this
.
configurationService
);
},
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
,
this
.
configurationService
,
this
.
keybindingService
);
CONTEXT_VARIABLES_FOCUSED
.
bindTo
(
this
.
contextKeyService
.
createScoped
(
treeContainer
));
...
...
src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts
浏览文件 @
df93ca01
...
...
@@ -68,7 +68,7 @@ export class WatchExpressionsView extends ViewletPanel {
ariaLabel
:
nls
.
localize
({
comment
:
[
'
Debug is a noun in this context, not a verb.
'
],
key
:
'
watchAriaTreeLabel
'
},
"
Debug Watch Expressions
"
),
accessibilityProvider
:
new
WatchExpressionsAccessibilityProvider
(),
identityProvider
:
{
getId
:
element
=>
element
.
getId
()
}
},
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
,
this
.
configurationService
);
},
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
,
this
.
configurationService
,
this
.
keybindingService
);
this
.
tree
.
refresh
(
null
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录