Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
c4729628
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c4729628
编写于
5月 04, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
type converters, use namespace for ViewColumn
上级
d52bf577
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
38 addition
and
37 deletion
+38
-37
src/vs/workbench/api/node/apiCommands.ts
src/vs/workbench/api/node/apiCommands.ts
+4
-4
src/vs/workbench/api/node/extHostDocumentsAndEditors.ts
src/vs/workbench/api/node/extHostDocumentsAndEditors.ts
+1
-1
src/vs/workbench/api/node/extHostTextEditor.ts
src/vs/workbench/api/node/extHostTextEditor.ts
+1
-1
src/vs/workbench/api/node/extHostTextEditors.ts
src/vs/workbench/api/node/extHostTextEditors.ts
+3
-3
src/vs/workbench/api/node/extHostTypeConverters.ts
src/vs/workbench/api/node/extHostTypeConverters.ts
+24
-23
src/vs/workbench/api/node/extHostWebview.ts
src/vs/workbench/api/node/extHostWebview.ts
+5
-5
未找到文件。
src/vs/workbench/api/node/apiCommands.ts
浏览文件 @
c4729628
...
...
@@ -32,7 +32,7 @@ export class PreviewHTMLAPICommand {
public
static
execute
(
executor
:
ICommandsExecutor
,
uri
:
URI
,
position
?:
vscode
.
ViewColumn
,
label
?:
string
,
options
?:
any
):
Thenable
<
any
>
{
return
executor
.
executeCommand
(
'
_workbench.previewHtml
'
,
uri
,
typeof
position
===
'
number
'
&&
typeConverters
.
fromViewColumn
(
position
),
typeof
position
===
'
number
'
&&
typeConverters
.
ViewColumn
.
from
(
position
),
label
,
options
);
...
...
@@ -60,7 +60,7 @@ export class DiffAPICommand {
label
,
undefined
,
typeConverters
.
toTextEditorOptions
(
options
),
options
?
typeConverters
.
fromViewColumn
(
options
.
viewColumn
)
:
undefined
options
?
typeConverters
.
ViewColumn
.
from
(
options
.
viewColumn
)
:
undefined
]);
}
}
...
...
@@ -74,10 +74,10 @@ export class OpenAPICommand {
if
(
columnOrOptions
)
{
if
(
typeof
columnOrOptions
===
'
number
'
)
{
column
=
typeConverters
.
fromViewColumn
(
columnOrOptions
);
column
=
typeConverters
.
ViewColumn
.
from
(
columnOrOptions
);
}
else
{
options
=
typeConverters
.
toTextEditorOptions
(
columnOrOptions
);
column
=
typeConverters
.
fromViewColumn
(
columnOrOptions
.
viewColumn
);
column
=
typeConverters
.
ViewColumn
.
from
(
columnOrOptions
.
viewColumn
);
}
}
...
...
src/vs/workbench/api/node/extHostDocumentsAndEditors.ts
浏览文件 @
c4729628
...
...
@@ -98,7 +98,7 @@ export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsSha
data
.
selections
.
map
(
typeConverters
.
Selection
.
to
),
data
.
options
,
data
.
visibleRanges
.
map
(
typeConverters
.
Range
.
to
),
typeConverters
.
toViewColumn
(
data
.
editorPosition
)
typeConverters
.
ViewColumn
.
to
(
data
.
editorPosition
)
);
this
.
_editors
.
set
(
data
.
id
,
editor
);
}
...
...
src/vs/workbench/api/node/extHostTextEditor.ts
浏览文件 @
c4729628
...
...
@@ -345,7 +345,7 @@ export class ExtHostTextEditor implements vscode.TextEditor {
}
@
deprecated
(
'
TextEditor.show
'
)
show
(
column
:
vscode
.
ViewColumn
)
{
this
.
_proxy
.
$tryShowEditor
(
this
.
_id
,
TypeConverters
.
fromViewColumn
(
column
));
this
.
_proxy
.
$tryShowEditor
(
this
.
_id
,
TypeConverters
.
ViewColumn
.
from
(
column
));
}
@
deprecated
(
'
TextEditor.hide
'
)
hide
()
{
...
...
src/vs/workbench/api/node/extHostTextEditors.ts
浏览文件 @
c4729628
...
...
@@ -61,12 +61,12 @@ export class ExtHostEditors implements ExtHostEditorsShape {
let
options
:
ITextDocumentShowOptions
;
if
(
typeof
columnOrOptions
===
'
number
'
)
{
options
=
{
position
:
TypeConverters
.
fromViewColumn
(
columnOrOptions
),
position
:
TypeConverters
.
ViewColumn
.
from
(
columnOrOptions
),
preserveFocus
};
}
else
if
(
typeof
columnOrOptions
===
'
object
'
)
{
options
=
{
position
:
TypeConverters
.
fromViewColumn
(
columnOrOptions
.
viewColumn
),
position
:
TypeConverters
.
ViewColumn
.
from
(
columnOrOptions
.
viewColumn
),
preserveFocus
:
columnOrOptions
.
preserveFocus
,
selection
:
typeof
columnOrOptions
.
selection
===
'
object
'
?
TypeConverters
.
Range
.
from
(
columnOrOptions
.
selection
)
:
undefined
,
pinned
:
typeof
columnOrOptions
.
preview
===
'
boolean
'
?
!
columnOrOptions
.
preview
:
undefined
...
...
@@ -159,7 +159,7 @@ export class ExtHostEditors implements ExtHostEditorsShape {
$acceptEditorPositionData
(
data
:
ITextEditorPositionData
):
void
{
for
(
let
id
in
data
)
{
let
textEditor
=
this
.
_extHostDocumentsAndEditors
.
getEditor
(
id
);
let
viewColumn
=
TypeConverters
.
toViewColumn
(
data
[
id
]);
let
viewColumn
=
TypeConverters
.
ViewColumn
.
to
(
data
[
id
]);
if
(
textEditor
.
viewColumn
!==
viewColumn
)
{
textEditor
.
_acceptViewColumn
(
viewColumn
);
this
.
_onDidChangeTextEditorViewColumn
.
fire
({
textEditor
,
viewColumn
});
...
...
src/vs/workbench/api/node/extHostTypeConverters.ts
浏览文件 @
c4729628
...
...
@@ -144,33 +144,34 @@ export namespace DiagnosticSeverity {
}
}
export
function
fromViewColumn
(
column
?:
vscode
.
ViewColumn
):
EditorPosition
{
let
editorColumn
=
EditorPosition
.
ONE
;
if
(
typeof
column
!==
'
number
'
)
{
// stick with ONE
}
else
if
(
column
===
<
number
>
types
.
ViewColumn
.
Two
)
{
editorColumn
=
EditorPosition
.
TWO
;
}
else
if
(
column
===
<
number
>
types
.
ViewColumn
.
Three
)
{
editorColumn
=
EditorPosition
.
THREE
;
}
else
if
(
column
===
<
number
>
types
.
ViewColumn
.
Active
)
{
editorColumn
=
undefined
;
export
namespace
ViewColumn
{
export
function
from
(
column
?:
vscode
.
ViewColumn
):
EditorPosition
{
let
editorColumn
=
EditorPosition
.
ONE
;
if
(
typeof
column
!==
'
number
'
)
{
// stick with ONE
}
else
if
(
column
===
<
number
>
types
.
ViewColumn
.
Two
)
{
editorColumn
=
EditorPosition
.
TWO
;
}
else
if
(
column
===
<
number
>
types
.
ViewColumn
.
Three
)
{
editorColumn
=
EditorPosition
.
THREE
;
}
else
if
(
column
===
<
number
>
types
.
ViewColumn
.
Active
)
{
editorColumn
=
undefined
;
}
return
editorColumn
;
}
return
editorColumn
;
}
export
function
toViewColumn
(
position
?:
EditorPosition
):
vscode
.
ViewColumn
{
if
(
typeof
position
!==
'
number
'
)
{
export
function
to
(
position
?:
EditorPosition
):
vscode
.
ViewColumn
{
if
(
typeof
position
!==
'
number
'
)
{
return
undefined
;
}
if
(
position
===
EditorPosition
.
ONE
)
{
return
<
number
>
types
.
ViewColumn
.
One
;
}
else
if
(
position
===
EditorPosition
.
TWO
)
{
return
<
number
>
types
.
ViewColumn
.
Two
;
}
else
if
(
position
===
EditorPosition
.
THREE
)
{
return
<
number
>
types
.
ViewColumn
.
Three
;
}
return
undefined
;
}
if
(
position
===
EditorPosition
.
ONE
)
{
return
<
number
>
types
.
ViewColumn
.
One
;
}
else
if
(
position
===
EditorPosition
.
TWO
)
{
return
<
number
>
types
.
ViewColumn
.
Two
;
}
else
if
(
position
===
EditorPosition
.
THREE
)
{
return
<
number
>
types
.
ViewColumn
.
Three
;
}
return
undefined
;
}
function
isDecorationOptions
(
something
:
any
):
something
is
vscode
.
DecorationOptions
{
...
...
src/vs/workbench/api/node/extHostWebview.ts
浏览文件 @
c4729628
...
...
@@ -174,7 +174,7 @@ export class ExtHostWebviewPanel implements vscode.WebviewPanel {
public
reveal
(
viewColumn
?:
vscode
.
ViewColumn
,
preserveFocus
?:
boolean
):
void
{
this
.
assertNotDisposed
();
this
.
_proxy
.
$reveal
(
this
.
_handle
,
viewColumn
?
typeConverters
.
fromViewColumn
(
viewColumn
)
:
undefined
,
viewColumn
?
typeConverters
.
ViewColumn
.
from
(
viewColumn
)
:
undefined
,
!!
preserveFocus
);
}
...
...
@@ -210,7 +210,7 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
const
viewColumn
=
typeof
showOptions
===
'
object
'
?
showOptions
.
viewColumn
:
showOptions
;
const
webviewShowOptions
=
{
viewColumn
:
typeConverters
.
fromViewColumn
(
viewColumn
),
viewColumn
:
typeConverters
.
ViewColumn
.
from
(
viewColumn
),
preserveFocus
:
typeof
showOptions
===
'
object
'
&&
!!
showOptions
.
preserveFocus
};
...
...
@@ -250,7 +250,7 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
$onDidChangeWebviewPanelViewState
(
handle
:
WebviewPanelHandle
,
visible
:
boolean
,
position
:
Position
):
void
{
const
panel
=
this
.
getWebviewPanel
(
handle
);
if
(
panel
)
{
const
viewColumn
=
typeConverters
.
toViewColumn
(
position
);
const
viewColumn
=
typeConverters
.
ViewColumn
.
to
(
position
);
if
(
panel
.
visible
!==
visible
||
panel
.
viewColumn
!==
viewColumn
)
{
panel
.
_setVisible
(
visible
);
panel
.
_setViewColumn
(
viewColumn
);
...
...
@@ -282,7 +282,7 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
}
const
webview
=
new
ExtHostWebview
(
webviewHandle
,
this
.
_proxy
,
options
);
const
revivedPanel
=
new
ExtHostWebviewPanel
(
webviewHandle
,
this
.
_proxy
,
viewType
,
title
,
typeConverters
.
toViewColumn
(
position
),
options
,
webview
);
const
revivedPanel
=
new
ExtHostWebviewPanel
(
webviewHandle
,
this
.
_proxy
,
viewType
,
title
,
typeConverters
.
ViewColumn
.
to
(
position
),
options
,
webview
);
this
.
_webviewPanels
.
set
(
webviewHandle
,
revivedPanel
);
return
serializer
.
deserializeWebviewPanel
(
revivedPanel
,
state
);
}
...
...
@@ -306,4 +306,4 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
private
getWebviewPanel
(
handle
:
WebviewPanelHandle
):
ExtHostWebviewPanel
|
undefined
{
return
this
.
_webviewPanels
.
get
(
handle
);
}
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录