Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4d01c750
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,发现更多精彩内容 >>
提交
4d01c750
编写于
2月 09, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
inspect context keys action
上级
698e2153
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
76 addition
and
2 deletion
+76
-2
src/vs/platform/contextkey/browser/contextKeyService.ts
src/vs/platform/contextkey/browser/contextKeyService.ts
+7
-0
src/vs/workbench/electron-browser/actions.ts
src/vs/workbench/electron-browser/actions.ts
+67
-1
src/vs/workbench/electron-browser/main.contribution.ts
src/vs/workbench/electron-browser/main.contribution.ts
+2
-1
未找到文件。
src/vs/platform/contextkey/browser/contextKeyService.ts
浏览文件 @
4d01c750
...
...
@@ -51,6 +51,13 @@ export class Context implements IContext {
}
return
ret
;
}
collectAllValues
():
{
[
key
:
string
]:
any
;
}
{
let
result
=
this
.
_parent
?
this
.
_parent
.
collectAllValues
()
:
Object
.
create
(
null
);
result
=
{
...
result
,
...
this
.
_value
};
delete
result
[
'
_contextId
'
];
return
result
;
}
}
class
ConfigAwareContextValuesContainer
extends
Context
{
...
...
src/vs/workbench/electron-browser/actions.ts
浏览文件 @
4d01c750
...
...
@@ -49,6 +49,12 @@ import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import
{
textLinkForeground
,
inputBackground
,
inputBorder
,
inputForeground
,
buttonBackground
,
buttonHoverBackground
,
buttonForeground
,
inputValidationErrorBorder
,
foreground
,
inputActiveOptionBorder
,
scrollbarSliderActiveBackground
,
scrollbarSliderBackground
,
scrollbarSliderHoverBackground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
SIDE_BAR_BACKGROUND
}
from
'
vs/workbench/common/theme
'
;
import
{
getGalleryExtensionIdFromLocal
}
from
'
vs/platform/extensionManagement/common/extensionManagementUtil
'
;
import
{
domEvent
}
from
'
vs/base/browser/event
'
;
import
{
once
}
from
'
vs/base/common/event
'
;
import
{
IDisposable
,
toDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
getDomNodePagePosition
,
createStyleSheet
,
createCSSRule
}
from
'
vs/base/browser/dom
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
Context
}
from
'
vs/platform/contextkey/browser/contextKeyService
'
;
// --- actions
...
...
@@ -1625,4 +1631,64 @@ export class ShowAboutDialogAction extends Action {
run
():
TPromise
<
void
>
{
return
this
.
windowsService
.
openAboutDialog
();
}
}
\ No newline at end of file
}
export
class
InspectContextKeysAction
extends
Action
{
public
static
readonly
ID
=
'
workbench.action.inspectContextKeys
'
;
public
static
LABEL
=
nls
.
localize
(
'
inspect context keys
'
,
"
Inspect Context Keys
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IContextKeyService
private
contextKeyService
:
IContextKeyService
,
@
IWindowService
private
windowService
:
IWindowService
,
)
{
super
(
id
,
label
);
}
run
():
TPromise
<
void
>
{
const
disposables
:
IDisposable
[]
=
[];
const
stylesheet
=
createStyleSheet
();
disposables
.
push
(
toDisposable
(()
=>
stylesheet
.
parentNode
.
removeChild
(
stylesheet
)));
createCSSRule
(
'
*
'
,
'
cursor: crosshair !important;
'
,
stylesheet
);
const
hoverFeedback
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
hoverFeedback
);
disposables
.
push
(
toDisposable
(()
=>
document
.
body
.
removeChild
(
hoverFeedback
)));
hoverFeedback
.
style
.
position
=
'
absolute
'
;
hoverFeedback
.
style
.
pointerEvents
=
'
none
'
;
hoverFeedback
.
style
.
backgroundColor
=
'
rgba(255, 0, 0, 0.5)
'
;
hoverFeedback
.
style
.
zIndex
=
'
1000
'
;
const
onMouseMove
=
domEvent
(
document
.
body
,
'
mousemove
'
,
true
);
disposables
.
push
(
onMouseMove
(
e
=>
{
const
target
=
e
.
target
as
HTMLElement
;
const
position
=
getDomNodePagePosition
(
target
);
hoverFeedback
.
style
.
top
=
`
${
position
.
top
}
px`
;
hoverFeedback
.
style
.
left
=
`
${
position
.
left
}
px`
;
hoverFeedback
.
style
.
width
=
`
${
position
.
width
}
px`
;
hoverFeedback
.
style
.
height
=
`
${
position
.
height
}
px`
;
}));
const
onMouseDown
=
once
(
domEvent
(
document
.
body
,
'
mousedown
'
,
true
));
onMouseDown
(
e
=>
{
e
.
preventDefault
();
e
.
stopPropagation
();
},
null
,
disposables
);
const
onMouseUp
=
once
(
domEvent
(
document
.
body
,
'
mouseup
'
,
true
));
onMouseUp
(
e
=>
{
e
.
preventDefault
();
e
.
stopPropagation
();
const
context
=
this
.
contextKeyService
.
getContext
(
e
.
target
as
HTMLElement
)
as
Context
;
console
.
log
(
context
.
collectAllValues
());
this
.
windowService
.
openDevTools
();
dispose
(
disposables
);
},
null
,
disposables
);
return
TPromise
.
as
(
null
);
}
}
src/vs/workbench/electron-browser/main.contribution.ts
浏览文件 @
4d01c750
...
...
@@ -14,7 +14,7 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'v
import
{
IWorkbenchActionRegistry
,
Extensions
}
from
'
vs/workbench/common/actions
'
;
import
{
KeyMod
,
KeyChord
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
isWindows
,
isLinux
,
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
KeybindingsReferenceAction
,
OpenDocumentationUrlAction
,
OpenIntroductoryVideosUrlAction
,
OpenTipsAndTricksUrlAction
,
OpenIssueReporterAction
,
ReportPerformanceIssueUsingReporterAction
,
ZoomResetAction
,
ZoomOutAction
,
ZoomInAction
,
ToggleFullScreenAction
,
ToggleMenuBarAction
,
CloseWorkspaceAction
,
CloseCurrentWindowAction
,
SwitchWindow
,
NewWindowAction
,
CloseMessagesAction
,
NavigateUpAction
,
NavigateDownAction
,
NavigateLeftAction
,
NavigateRightAction
,
IncreaseViewSizeAction
,
DecreaseViewSizeAction
,
ShowStartupPerformance
,
ToggleSharedProcessAction
,
QuickSwitchWindow
,
QuickOpenRecentAction
,
inRecentFilesPickerContextKey
,
ShowAboutDialogAction
}
from
'
vs/workbench/electron-browser/actions
'
;
import
{
KeybindingsReferenceAction
,
OpenDocumentationUrlAction
,
OpenIntroductoryVideosUrlAction
,
OpenTipsAndTricksUrlAction
,
OpenIssueReporterAction
,
ReportPerformanceIssueUsingReporterAction
,
ZoomResetAction
,
ZoomOutAction
,
ZoomInAction
,
ToggleFullScreenAction
,
ToggleMenuBarAction
,
CloseWorkspaceAction
,
CloseCurrentWindowAction
,
SwitchWindow
,
NewWindowAction
,
CloseMessagesAction
,
NavigateUpAction
,
NavigateDownAction
,
NavigateLeftAction
,
NavigateRightAction
,
IncreaseViewSizeAction
,
DecreaseViewSizeAction
,
ShowStartupPerformance
,
ToggleSharedProcessAction
,
QuickSwitchWindow
,
QuickOpenRecentAction
,
inRecentFilesPickerContextKey
,
ShowAboutDialogAction
,
InspectContextKeysAction
}
from
'
vs/workbench/electron-browser/actions
'
;
import
{
MessagesVisibleContext
}
from
'
vs/workbench/electron-browser/workbench
'
;
import
{
registerCommands
}
from
'
vs/workbench/electron-browser/commands
'
;
import
{
AddRootFolderAction
,
GlobalRemoveRootFolderAction
,
OpenWorkspaceAction
,
SaveWorkspaceAsAction
,
OpenWorkspaceConfigFileAction
,
OpenFolderAsWorkspaceInNewWindowAction
,
OpenFileFolderAction
,
OpenFileAction
,
OpenFolderAction
}
from
'
vs/workbench/browser/actions/workspaceActions
'
;
...
...
@@ -112,6 +112,7 @@ workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenFo
const
developerCategory
=
nls
.
localize
(
'
developer
'
,
"
Developer
"
);
workbenchActionsRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
ShowStartupPerformance
,
ShowStartupPerformance
.
ID
,
ShowStartupPerformance
.
LABEL
),
'
Developer: Startup Performance
'
,
developerCategory
);
workbenchActionsRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
ToggleSharedProcessAction
,
ToggleSharedProcessAction
.
ID
,
ToggleSharedProcessAction
.
LABEL
),
'
Developer: Toggle Shared Process
'
,
developerCategory
);
workbenchActionsRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
InspectContextKeysAction
,
InspectContextKeysAction
.
ID
,
InspectContextKeysAction
.
LABEL
),
'
Developer: Inspect Context Keys
'
,
developerCategory
);
const
recentFilesPickerContext
=
ContextKeyExpr
.
and
(
inQuickOpenContext
,
ContextKeyExpr
.
has
(
inRecentFilesPickerContextKey
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录