Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e8bdc1be
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,发现更多精彩内容 >>
提交
e8bdc1be
编写于
11月 08, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
repl: destructure imports
上级
ac17ca87
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
30 addition
and
30 deletion
+30
-30
src/vs/workbench/parts/debug/electron-browser/repl.ts
src/vs/workbench/parts/debug/electron-browser/repl.ts
+30
-30
未找到文件。
src/vs/workbench/parts/debug/electron-browser/repl.ts
浏览文件 @
e8bdc1be
...
...
@@ -4,20 +4,20 @@
*--------------------------------------------------------------------------------------------*/
import
'
vs/css!./../browser/media/repl
'
;
import
nls
=
require
(
'
vs/nls
'
)
;
import
*
as
nls
from
'
vs/nls
'
;
import
uri
from
'
vs/base/common/uri
'
;
import
{
wireCancellationToken
}
from
'
vs/base/common/async
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
errors
=
require
(
'
vs/base/common/errors
'
)
;
import
lifecycle
=
require
(
'
vs/base/common/lifecycle
'
)
;
import
actions
=
require
(
'
vs/base/common/actions
'
)
;
import
builder
=
require
(
'
vs/base/browser/builder
'
)
;
import
dom
=
require
(
'
vs/base/browser/dom
'
)
;
import
platform
=
require
(
'
vs/base/common/platform
'
)
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
*
as
lifecycle
from
'
vs/base/common/lifecycle
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
Dimension
,
Builder
}
from
'
vs/base/browser/builder
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
tree
=
require
(
'
vs/base/parts/tree/browser/tree
'
)
;
import
treeimpl
=
require
(
'
vs/base/parts/tree/browser/treeImpl
'
)
;
import
{
ITree
,
ITreeOptions
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
Tree
}
from
'
vs/base/parts/tree/browser/treeImpl
'
;
import
{
Context
as
SuggestContext
}
from
'
vs/editor/contrib/suggest/common/suggest
'
;
import
{
SuggestController
}
from
'
vs/editor/contrib/suggest/browser/suggestController
'
;
import
{
IEditorOptions
,
IReadOnlyModel
,
EditorContextKeys
,
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
...
...
@@ -31,18 +31,18 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
,
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
viewer
=
require
(
'
vs/workbench/parts/debug/electron-browser/replViewer
'
)
;
import
{
ReplExpressionsRenderer
,
ReplExpressionsController
,
ReplExpressionsDataSource
,
ReplExpressionsActionProvider
,
ReplExpressionsAccessibilityProvider
}
from
'
vs/workbench/parts/debug/electron-browser/replViewer
'
;
import
{
ReplEditor
}
from
'
vs/workbench/parts/debug/electron-browser/replEditor
'
;
import
debug
=
require
(
'
vs/workbench/parts/debug/common/debug
'
)
;
import
debugactions
=
require
(
'
vs/workbench/parts/debug/browser/debugActions
'
)
;
import
replhistory
=
require
(
'
vs/workbench/parts/debug/common/replHistory
'
)
;
import
*
as
debug
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
ClearReplAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
ReplHistory
}
from
'
vs/workbench/parts/debug/common/replHistory
'
;
import
{
Panel
}
from
'
vs/workbench/browser/panel
'
;
import
{
IThemeService
}
from
'
vs/workbench/services/themes/common/themeService
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
const
$
=
dom
.
$
;
const
replTreeOptions
:
tree
.
ITreeOptions
=
{
const
replTreeOptions
:
ITreeOptions
=
{
twistiePixels
:
20
,
ariaLabel
:
nls
.
localize
(
'
replAriaLabel
'
,
"
Read Eval Print Loop Panel
"
)
};
...
...
@@ -61,21 +61,21 @@ export class Repl extends Panel implements IPrivateReplService {
private
static
HALF_WIDTH_TYPICAL
=
'
n
'
;
private
static
HISTORY
:
replhistory
.
ReplHistory
;
private
static
HISTORY
:
ReplHistory
;
private
static
REFRESH_DELAY
=
500
;
// delay in ms to refresh the repl for new elements to show
private
static
REPL_INPUT_INITIAL_HEIGHT
=
19
;
private
static
REPL_INPUT_MAX_HEIGHT
=
170
;
private
toDispose
:
lifecycle
.
IDisposable
[];
private
tree
:
tree
.
ITree
;
private
renderer
:
viewer
.
ReplExpressionsRenderer
;
private
tree
:
ITree
;
private
renderer
:
ReplExpressionsRenderer
;
private
characterWidthSurveyor
:
HTMLElement
;
private
treeContainer
:
HTMLElement
;
private
replInput
:
ReplEditor
;
private
replInputContainer
:
HTMLElement
;
private
refreshTimeoutHandle
:
number
;
private
actions
:
actions
.
IAction
[];
private
dimension
:
builder
.
Dimension
;
private
actions
:
IAction
[];
private
dimension
:
Dimension
;
private
replInputHeight
:
number
;
constructor
(
...
...
@@ -125,7 +125,7 @@ export class Repl extends Panel implements IPrivateReplService {
}
}
public
create
(
parent
:
builder
.
Builder
):
TPromise
<
void
>
{
public
create
(
parent
:
Builder
):
TPromise
<
void
>
{
super
.
create
(
parent
);
const
container
=
dom
.
append
(
parent
.
getHTMLElement
(),
$
(
'
.repl
'
));
this
.
treeContainer
=
dom
.
append
(
container
,
$
(
'
.repl-tree
'
));
...
...
@@ -136,18 +136,18 @@ export class Repl extends Panel implements IPrivateReplService {
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
this
.
characterWidthSurveyor
.
textContent
+=
this
.
characterWidthSurveyor
.
textContent
;
}
this
.
characterWidthSurveyor
.
style
.
fontSize
=
platform
.
isMacintosh
?
'
12px
'
:
'
14px
'
;
this
.
characterWidthSurveyor
.
style
.
fontSize
=
isMacintosh
?
'
12px
'
:
'
14px
'
;
this
.
renderer
=
this
.
instantiationService
.
createInstance
(
viewer
.
ReplExpressionsRenderer
);
this
.
tree
=
new
treeimpl
.
Tree
(
this
.
treeContainer
,
{
dataSource
:
new
viewer
.
ReplExpressionsDataSource
(
this
.
debugService
),
this
.
renderer
=
this
.
instantiationService
.
createInstance
(
ReplExpressionsRenderer
);
this
.
tree
=
new
Tree
(
this
.
treeContainer
,
{
dataSource
:
new
ReplExpressionsDataSource
(
this
.
debugService
),
renderer
:
this
.
renderer
,
accessibilityProvider
:
new
viewer
.
ReplExpressionsAccessibilityProvider
(),
controller
:
new
viewer
.
ReplExpressionsController
(
this
.
debugService
,
this
.
contextMenuService
,
new
viewer
.
ReplExpressionsActionProvider
(
this
.
instantiationService
),
this
.
replInput
,
false
)
accessibilityProvider
:
new
ReplExpressionsAccessibilityProvider
(),
controller
:
new
ReplExpressionsController
(
this
.
debugService
,
this
.
contextMenuService
,
new
ReplExpressionsActionProvider
(
this
.
instantiationService
),
this
.
replInput
,
false
)
},
replTreeOptions
);
if
(
!
Repl
.
HISTORY
)
{
Repl
.
HISTORY
=
new
replhistory
.
ReplHistory
(
JSON
.
parse
(
this
.
storageService
.
get
(
HISTORY_STORAGE_KEY
,
StorageScope
.
WORKSPACE
,
'
[]
'
)));
Repl
.
HISTORY
=
new
ReplHistory
(
JSON
.
parse
(
this
.
storageService
.
get
(
HISTORY_STORAGE_KEY
,
StorageScope
.
WORKSPACE
,
'
[]
'
)));
}
return
this
.
tree
.
setInput
(
this
.
debugService
.
getModel
());
...
...
@@ -221,7 +221,7 @@ export class Repl extends Panel implements IPrivateReplService {
this
.
layout
(
this
.
dimension
);
}
public
layout
(
dimension
:
builder
.
Dimension
):
void
{
public
layout
(
dimension
:
Dimension
):
void
{
this
.
dimension
=
dimension
;
if
(
this
.
tree
)
{
this
.
renderer
.
setWidth
(
dimension
.
width
-
25
,
this
.
characterWidthSurveyor
.
clientWidth
/
this
.
characterWidthSurveyor
.
textContent
.
length
);
...
...
@@ -238,10 +238,10 @@ export class Repl extends Panel implements IPrivateReplService {
this
.
replInput
.
focus
();
}
public
getActions
():
actions
.
IAction
[]
{
public
getActions
():
IAction
[]
{
if
(
!
this
.
actions
)
{
this
.
actions
=
[
this
.
instantiationService
.
createInstance
(
debugactions
.
ClearReplAction
,
debugactions
.
ClearReplAction
.
ID
,
debugactions
.
ClearReplAction
.
LABEL
)
this
.
instantiationService
.
createInstance
(
ClearReplAction
,
ClearReplAction
.
ID
,
ClearReplAction
.
LABEL
)
];
this
.
actions
.
forEach
(
a
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录