Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
cf2b8f69
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,发现更多精彩内容 >>
提交
cf2b8f69
编写于
1月 04, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adopt fileResultsNavigation in debug callstack
#27458
上级
c583be11
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
37 addition
and
50 deletion
+37
-50
src/vs/workbench/parts/debug/electron-browser/baseDebugView.ts
...s/workbench/parts/debug/electron-browser/baseDebugView.ts
+0
-2
src/vs/workbench/parts/debug/electron-browser/callStackView.ts
...s/workbench/parts/debug/electron-browser/callStackView.ts
+26
-43
src/vs/workbench/parts/files/browser/fileResultsNavigation.ts
...vs/workbench/parts/files/browser/fileResultsNavigation.ts
+9
-3
src/vs/workbench/parts/markers/browser/markersPanel.ts
src/vs/workbench/parts/markers/browser/markersPanel.ts
+1
-1
src/vs/workbench/parts/search/browser/searchViewlet.ts
src/vs/workbench/parts/search/browser/searchViewlet.ts
+1
-1
未找到文件。
src/vs/workbench/parts/debug/electron-browser/baseDebugView.ts
浏览文件 @
cf2b8f69
...
...
@@ -13,7 +13,6 @@ import { InputBox, IInputValidationOptions } from 'vs/base/browser/ui/inputbox/i
import
{
attachInputBoxStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
once
}
from
'
vs/base/common/functional
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IMenuService
,
MenuId
,
IMenu
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ClickBehavior
,
DefaultController
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
...
...
@@ -199,7 +198,6 @@ export class BaseDebugController extends DefaultController {
private
actionProvider
:
IActionProvider
,
menuId
:
MenuId
,
@
IDebugService
protected
debugService
:
IDebugService
,
@
IWorkbenchEditorService
protected
editorService
:
IWorkbenchEditorService
,
@
IContextMenuService
private
contextMenuService
:
IContextMenuService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IMenuService
menuService
:
IMenuService
...
...
src/vs/workbench/parts/debug/electron-browser/callStackView.ts
浏览文件 @
cf2b8f69
...
...
@@ -18,7 +18,6 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
BaseDebugController
,
twistiePixels
,
renderViewTree
}
from
'
vs/workbench/parts/debug/electron-browser/baseDebugView
'
;
import
{
ITree
,
IActionProvider
,
IDataSource
,
IRenderer
,
IAccessibilityProvider
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
IMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
IAction
,
IActionItem
}
from
'
vs/base/common/actions
'
;
import
{
RestartAction
,
StopAction
,
ContinueAction
,
StepOverAction
,
StepIntoAction
,
StepOutAction
,
PauseAction
,
RestartFrameAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
CopyStackTraceAction
}
from
'
vs/workbench/parts/debug/electron-browser/electronDebugActions
'
;
...
...
@@ -28,6 +27,8 @@ import { Source } from 'vs/workbench/parts/debug/common/debugSource';
import
{
basenameOrAuthority
}
from
'
vs/base/common/resources
'
;
import
{
WorkbenchTree
,
IListService
}
from
'
vs/platform/list/browser/listService
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
FileResultsNavigation
from
'
vs/workbench/parts/files/browser/fileResultsNavigation
'
;
const
$
=
dom
.
$
;
...
...
@@ -48,7 +49,8 @@ export class CallStackView extends TreeViewsViewletPanel {
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IThemeService
private
themeService
:
IThemeService
,
@
IListService
private
listService
:
IListService
@
IListService
private
listService
:
IListService
,
@
IWorkbenchEditorService
private
editorService
:
IWorkbenchEditorService
,
)
{
super
({
...(
options
as
IViewOptions
),
ariaHeaderLabel
:
nls
.
localize
(
'
callstackSection
'
,
"
Call Stack Section
"
)
},
keybindingService
,
contextMenuService
);
this
.
settings
=
options
.
viewletSettings
;
...
...
@@ -108,10 +110,28 @@ export class CallStackView extends TreeViewsViewletPanel {
keyboardSupport
:
false
},
this
.
contextKeyService
,
this
.
listService
,
this
.
themeService
);
this
.
disposables
.
push
(
this
.
tree
.
onDidChangeSelection
(
event
=>
{
if
(
event
&&
event
.
payload
&&
event
.
payload
.
origin
===
'
keyboard
'
)
{
const
element
=
this
.
tree
.
getFocus
();
controller
.
handleSelectionChange
(
this
.
tree
,
element
,
false
,
event
);
const
fileResultsNavigation
=
new
FileResultsNavigation
(
this
.
tree
);
this
.
disposables
.
push
(
fileResultsNavigation
);
this
.
disposables
.
push
(
fileResultsNavigation
.
openFile
(
e
=>
{
const
element
=
e
.
element
;
if
(
element
instanceof
StackFrame
)
{
this
.
debugService
.
focusStackFrame
(
element
,
element
.
thread
,
element
.
thread
.
process
,
true
);
element
.
openInEditor
(
this
.
editorService
,
e
.
editorOptions
.
preserveFocus
,
e
.
sideBySide
).
done
(
undefined
,
errors
.
onUnexpectedError
);
}
if
(
element
instanceof
Thread
)
{
this
.
debugService
.
focusStackFrame
(
undefined
,
element
,
element
.
process
,
true
);
}
if
(
element
instanceof
Process
)
{
this
.
debugService
.
focusStackFrame
(
undefined
,
undefined
,
element
,
true
);
}
if
(
element
instanceof
ThreadAndProcessIds
)
{
const
process
=
this
.
debugService
.
getModel
().
getProcesses
().
filter
(
p
=>
p
.
getId
()
===
element
.
processId
).
pop
();
const
thread
=
process
&&
process
.
getThread
(
element
.
threadId
);
if
(
thread
)
{
(
<
Thread
>
thread
).
fetchCallStack
()
.
done
(()
=>
this
.
tree
.
refresh
(),
errors
.
onUnexpectedError
);
}
}
}));
...
...
@@ -178,14 +198,6 @@ export class CallStackView extends TreeViewsViewletPanel {
}
class
CallStackController
extends
BaseDebugController
{
protected
onLeftClick
(
tree
:
ITree
,
element
:
any
,
event
:
IMouseEvent
):
boolean
{
super
.
onLeftClick
(
tree
,
element
,
event
);
this
.
handleSelectionChange
(
tree
,
element
,
event
.
detail
!==
2
,
event
);
return
true
;
}
protected
getContext
(
element
:
any
):
any
{
if
(
element
instanceof
StackFrame
)
{
if
(
element
.
source
.
inMemory
)
{
...
...
@@ -198,35 +210,6 @@ class CallStackController extends BaseDebugController {
return
element
.
threadId
;
}
}
// user clicked / pressed on 'Load More Stack Frames', get those stack frames and refresh the tree.
public
showMoreStackFrames
(
tree
:
ITree
,
threadAndProcessIds
:
ThreadAndProcessIds
):
boolean
{
const
process
=
this
.
debugService
.
getModel
().
getProcesses
().
filter
(
p
=>
p
.
getId
()
===
threadAndProcessIds
.
processId
).
pop
();
const
thread
=
process
&&
process
.
getThread
(
threadAndProcessIds
.
threadId
);
if
(
thread
)
{
(
<
Thread
>
thread
).
fetchCallStack
()
.
done
(()
=>
tree
.
refresh
(),
errors
.
onUnexpectedError
);
}
return
true
;
}
public
handleSelectionChange
(
tree
:
ITree
,
element
:
any
,
preserveFocus
:
boolean
,
event
:
any
):
void
{
if
(
element
instanceof
StackFrame
)
{
this
.
debugService
.
focusStackFrame
(
element
,
element
.
thread
,
element
.
thread
.
process
,
true
);
const
sideBySide
=
(
event
&&
(
event
.
ctrlKey
||
event
.
metaKey
));
element
.
openInEditor
(
this
.
editorService
,
preserveFocus
,
sideBySide
).
done
(
undefined
,
errors
.
onUnexpectedError
);
}
if
(
element
instanceof
Thread
)
{
this
.
debugService
.
focusStackFrame
(
undefined
,
element
,
element
.
process
,
true
);
}
if
(
element
instanceof
Process
)
{
this
.
debugService
.
focusStackFrame
(
undefined
,
undefined
,
element
,
true
);
}
if
(
element
instanceof
ThreadAndProcessIds
)
{
this
.
showMoreStackFrames
(
tree
,
element
);
}
}
}
...
...
src/vs/workbench/parts/files/browser/fileResultsNavigation.ts
浏览文件 @
cf2b8f69
...
...
@@ -15,14 +15,20 @@ export interface IOpenFileOptions {
payload
:
any
;
}
export
interface
IFileResultsNavigationOptions
{
openOnFocus
:
boolean
;
}
export
default
class
FileResultsNavigation
extends
Disposable
{
private
_openFile
:
Emitter
<
IOpenFileOptions
>
=
new
Emitter
<
IOpenFileOptions
>
();
public
readonly
openFile
:
Event
<
IOpenFileOptions
>
=
this
.
_openFile
.
event
;
constructor
(
private
tree
:
ITree
)
{
constructor
(
private
tree
:
ITree
,
options
?:
IFileResultsNavigationOptions
)
{
super
();
if
(
options
&&
options
.
openOnFocus
)
{
this
.
_register
(
this
.
tree
.
onDidChangeFocus
(
e
=>
this
.
onFocus
(
e
)));
}
this
.
_register
(
this
.
tree
.
onDidChangeSelection
(
e
=>
this
.
onSelection
(
e
)));
}
...
...
src/vs/workbench/parts/markers/browser/markersPanel.ts
浏览文件 @
cf2b8f69
...
...
@@ -231,7 +231,7 @@ export class MarkersPanel extends Panel {
Constants
.
MarkerFocusContextKey
.
bindTo
(
this
.
tree
.
contextKeyService
);
const
fileResultsNavigation
=
this
.
_register
(
new
FileResultsNavigation
(
this
.
tree
));
const
fileResultsNavigation
=
this
.
_register
(
new
FileResultsNavigation
(
this
.
tree
,
{
openOnFocus
:
true
}
));
this
.
_register
(
debounceEvent
(
fileResultsNavigation
.
openFile
,
(
last
,
event
)
=>
event
,
75
,
true
)(
options
=>
{
this
.
openFileAtElement
(
options
.
element
,
options
.
editorOptions
.
preserveFocus
,
options
.
editorOptions
.
pinned
,
options
.
sideBySide
);
}));
...
...
src/vs/workbench/parts/search/browser/searchViewlet.ts
浏览文件 @
cf2b8f69
...
...
@@ -514,7 +514,7 @@ export class SearchViewlet extends Viewlet {
this
.
tree
.
setInput
(
this
.
viewModel
.
searchResult
);
this
.
toUnbind
.
push
(
renderer
);
const
fileResultsNavigation
=
this
.
_register
(
new
FileResultsNavigation
(
this
.
tree
));
const
fileResultsNavigation
=
this
.
_register
(
new
FileResultsNavigation
(
this
.
tree
,
{
openOnFocus
:
true
}
));
this
.
_register
(
debounceEvent
(
fileResultsNavigation
.
openFile
,
(
last
,
event
)
=>
event
,
75
,
true
)(
options
=>
{
if
(
options
.
element
instanceof
Match
)
{
let
selectedMatch
:
Match
=
options
.
element
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录