Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3118955e
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,发现更多精彩内容 >>
提交
3118955e
编写于
9月 17, 2020
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: when the alt key is pressed show regular editor hover and hide the debug hover
#84561
上级
3808cb37
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
9 deletion
+35
-9
src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts
...orkbench/contrib/debug/browser/debugEditorContribution.ts
+35
-9
未找到文件。
src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts
浏览文件 @
3118955e
...
...
@@ -10,7 +10,7 @@ import { visit } from 'vs/base/common/json';
import
{
setProperty
}
from
'
vs/base/common/jsonEdit
'
;
import
{
Constants
}
from
'
vs/base/common/uint
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
IKeyboardEvent
,
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
StandardTokenType
}
from
'
vs/editor/common/modes
'
;
import
{
DEFAULT_WORD_REGEXP
}
from
'
vs/editor/common/model/wordHelper
'
;
import
{
ICodeEditor
,
IEditorMouseEvent
,
MouseTargetType
,
IPartialEditorMouseEvent
}
from
'
vs/editor/browser/editorBrowser
'
;
...
...
@@ -33,6 +33,7 @@ import { ITextModel } from 'vs/editor/common/model';
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
EditOperation
}
from
'
vs/editor/common/core/editOperation
'
;
import
{
basename
}
from
'
vs/base/common/path
'
;
import
{
domEvent
}
from
'
vs/base/browser/event
'
;
const
HOVER_DELAY
=
300
;
const
LAUNCH_JSON_REGEX
=
/
\.
vscode
\/
launch
\.
json$/
;
...
...
@@ -171,8 +172,9 @@ export class DebugEditorContribution implements IDebugEditorContribution {
private
static
readonly
MEMOIZER
=
createMemoizer
();
private
exceptionWidget
:
ExceptionWidget
|
undefined
;
private
configurationWidget
:
FloatingClickWidget
|
undefined
;
private
altListener
:
IDisposable
|
undefined
;
private
altPressed
=
false
;
constructor
(
private
editor
:
ICodeEditor
,
...
...
@@ -219,7 +221,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
const
stackFrame
=
this
.
debugService
.
getViewModel
().
focusedStackFrame
;
const
model
=
this
.
editor
.
getModel
();
if
(
model
)
{
this
.
_
applyHoverConfiguration
(
model
,
stackFrame
);
this
.
applyHoverConfiguration
(
model
,
stackFrame
);
}
this
.
toggleExceptionWidget
();
this
.
hideHoverWidget
();
...
...
@@ -240,14 +242,38 @@ export class DebugEditorContribution implements IDebugEditorContribution {
return
getWordToLineNumbersMap
(
this
.
editor
.
getModel
());
}
private
_
applyHoverConfiguration
(
model
:
ITextModel
,
stackFrame
:
IStackFrame
|
undefined
):
void
{
private
applyHoverConfiguration
(
model
:
ITextModel
,
stackFrame
:
IStackFrame
|
undefined
):
void
{
if
(
stackFrame
&&
model
.
uri
.
toString
()
===
stackFrame
.
source
.
uri
.
toString
())
{
this
.
editor
.
updateOptions
({
hover
:
{
enabled
:
false
if
(
this
.
altListener
)
{
this
.
altListener
.
dispose
();
}
// When the alt key is pressed show regular editor hover and hide the debug hover #84561
this
.
altListener
=
domEvent
(
document
,
'
keydown
'
)(
keydownEvent
=>
{
const
standardKeyboardEvent
=
new
StandardKeyboardEvent
(
keydownEvent
);
if
(
standardKeyboardEvent
.
keyCode
===
KeyCode
.
Alt
)
{
this
.
altPressed
=
true
;
this
.
hoverWidget
.
hide
();
this
.
enableEditorHover
();
const
listener
=
domEvent
(
document
,
'
keyup
'
)(
keyupEvent
=>
{
const
standardKeyboardEvent
=
new
StandardKeyboardEvent
(
keyupEvent
);
if
(
standardKeyboardEvent
.
keyCode
===
KeyCode
.
Alt
)
{
this
.
altPressed
=
false
;
this
.
editor
.
updateOptions
({
hover
:
{
enabled
:
false
}
});
listener
.
dispose
();
}
});
}
});
this
.
editor
.
updateOptions
({
hover
:
{
enabled
:
false
}
});
}
else
{
this
.
enableEditorHover
();
}
}
private
enableEditorHover
():
void
{
if
(
this
.
editor
.
hasModel
())
{
const
model
=
this
.
editor
.
getModel
();
let
overrides
=
{
resource
:
model
.
uri
,
overrideIdentifier
:
model
.
getLanguageIdentifier
().
language
...
...
@@ -266,7 +292,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
async
showHover
(
range
:
Range
,
focus
:
boolean
):
Promise
<
void
>
{
const
sf
=
this
.
debugService
.
getViewModel
().
focusedStackFrame
;
const
model
=
this
.
editor
.
getModel
();
if
(
sf
&&
model
&&
sf
.
source
.
uri
.
toString
()
===
model
.
uri
.
toString
())
{
if
(
sf
&&
model
&&
sf
.
source
.
uri
.
toString
()
===
model
.
uri
.
toString
()
&&
!
this
.
altPressed
)
{
return
this
.
hoverWidget
.
showAt
(
range
,
focus
);
}
}
...
...
@@ -274,7 +300,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
private
async
onFocusStackFrame
(
sf
:
IStackFrame
|
undefined
):
Promise
<
void
>
{
const
model
=
this
.
editor
.
getModel
();
if
(
model
)
{
this
.
_
applyHoverConfiguration
(
model
,
sf
);
this
.
applyHoverConfiguration
(
model
,
sf
);
if
(
sf
&&
sf
.
source
.
uri
.
toString
()
===
model
.
uri
.
toString
())
{
await
this
.
toggleExceptionWidget
();
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录