Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
249da81b
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,发现更多精彩内容 >>
提交
249da81b
编写于
5月 20, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
grid - move EditorPosition to exthost
上级
41d65ec2
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
76 addition
and
78 deletion
+76
-78
src/vs/platform/editor/common/editor.ts
src/vs/platform/editor/common/editor.ts
+0
-19
src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts
...nch/api/electron-browser/mainThreadDocumentsAndEditors.ts
+1
-1
src/vs/workbench/api/electron-browser/mainThreadEditors.ts
src/vs/workbench/api/electron-browser/mainThreadEditors.ts
+36
-2
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
+3
-3
src/vs/workbench/api/node/apiCommands.ts
src/vs/workbench/api/node/apiCommands.ts
+6
-5
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-1
src/vs/workbench/api/node/extHostTextEditors.ts
src/vs/workbench/api/node/extHostTextEditors.ts
+2
-2
src/vs/workbench/api/node/extHostTypeConverters.ts
src/vs/workbench/api/node/extHostTypeConverters.ts
+8
-7
src/vs/workbench/api/node/extHostWebview.ts
src/vs/workbench/api/node/extHostWebview.ts
+3
-3
src/vs/workbench/api/shared/editor.ts
src/vs/workbench/api/shared/editor.ts
+11
-0
src/vs/workbench/electron-browser/commands.ts
src/vs/workbench/electron-browser/commands.ts
+0
-28
src/vs/workbench/parts/backup/common/backupRestorer.ts
src/vs/workbench/parts/backup/common/backupRestorer.ts
+1
-1
src/vs/workbench/parts/html/electron-browser/html.contribution.ts
...orkbench/parts/html/electron-browser/html.contribution.ts
+1
-1
src/vs/workbench/parts/webview/electron-browser/webviewEditorService.ts
...ch/parts/webview/electron-browser/webviewEditorService.ts
+0
-2
src/vs/workbench/test/electron-browser/api/extHostWebview.test.ts
...orkbench/test/electron-browser/api/extHostWebview.test.ts
+3
-3
未找到文件。
src/vs/platform/editor/common/editor.ts
浏览文件 @
249da81b
...
...
@@ -128,22 +128,3 @@ export interface ITextEditorOptions extends IEditorOptions {
*/
revealInCenterIfOutsideViewport
?:
boolean
;
}
//#region TODO@grid obsolete
/**
* Possible locations for opening an editor.
*/
export
enum
Position
{
/** Opens the editor in the first position replacing the input currently showing */
ONE
=
0
,
/** Opens the editor in the second position replacing the input currently showing */
TWO
=
1
,
/** Opens the editor in the third most position replacing the input currently showing */
THREE
=
2
}
//#endregion
\ No newline at end of file
src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts
浏览文件 @
249da81b
...
...
@@ -13,7 +13,7 @@ import { ExtHostContext, ExtHostDocumentsAndEditorsShape, IModelAddedData, IText
import
{
MainThreadTextEditor
}
from
'
./mainThreadEditor
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/group/common/editorGroupsService
'
;
import
{
Position
as
EditorPosition
}
from
'
vs/platform/editor/common
/editor
'
;
import
{
EditorPosition
}
from
'
vs/workbench/api/shared
/editor
'
;
import
{
IEditor
}
from
'
vs/workbench/common/editor
'
;
import
{
extHostCustomer
}
from
'
vs/workbench/api/electron-browser/extHostCustomers
'
;
import
{
MainThreadDocuments
}
from
'
vs/workbench/api/electron-browser/mainThreadDocuments
'
;
...
...
src/vs/workbench/api/electron-browser/mainThreadEditors.ts
浏览文件 @
249da81b
...
...
@@ -4,6 +4,9 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IEditorOptions
,
ITextEditorOptions
}
from
'
vs/platform/editor/common/editor
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
disposed
}
from
'
vs/base/common/errors
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
equals
as
objectEquals
}
from
'
vs/base/common/objects
'
;
...
...
@@ -15,7 +18,8 @@ import { IRange } from 'vs/editor/common/core/range';
import
{
ISelection
}
from
'
vs/editor/common/core/selection
'
;
import
{
IDecorationOptions
,
IDecorationRenderOptions
,
ILineChange
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ISingleEditOperation
}
from
'
vs/editor/common/model
'
;
import
{
ITextEditorOptions
,
Position
as
EditorPosition
}
from
'
vs/platform/editor/common/editor
'
;
import
{
EditorPosition
}
from
'
vs/workbench/api/shared/editor
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IApplyEditsOptions
,
ITextEditorConfigurationUpdate
,
IUndoStopOptions
,
TextEditorRevealType
,
WorkspaceEditDto
,
reviveWorkspaceEditDto
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
import
{
IEditorService
,
SIDE_GROUP
,
ACTIVE_GROUP
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/group/common/editorGroupsService
'
;
...
...
@@ -127,7 +131,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
});
}
$tryShowEditor
(
id
:
string
,
position
:
EditorPosition
):
TPromise
<
void
>
{
$tryShowEditor
(
id
:
string
,
position
?
:
EditorPosition
):
TPromise
<
void
>
{
let
mainThreadEditor
=
this
.
_documentsAndEditors
.
getEditor
(
id
);
if
(
mainThreadEditor
)
{
let
model
=
mainThreadEditor
.
getModel
();
...
...
@@ -241,6 +245,36 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
}
}
// --- commands
CommandsRegistry
.
registerCommand
(
'
_workbench.open
'
,
function
(
accessor
:
ServicesAccessor
,
args
:
[
URI
,
IEditorOptions
,
EditorPosition
])
{
const
editorService
=
accessor
.
get
(
IEditorService
);
const
editorGroupService
=
accessor
.
get
(
IEditorGroupsService
);
const
[
resource
,
options
,
position
]
=
args
;
return
editorService
.
openEditor
({
resource
,
options
},
findEditorGroup
(
editorGroupService
,
position
)).
then
(()
=>
void
0
);
});
CommandsRegistry
.
registerCommand
(
'
_workbench.diff
'
,
function
(
accessor
:
ServicesAccessor
,
args
:
[
URI
,
URI
,
string
,
string
,
IEditorOptions
,
EditorPosition
])
{
const
editorService
=
accessor
.
get
(
IEditorService
);
const
editorGroupService
=
accessor
.
get
(
IEditorGroupsService
);
let
[
leftResource
,
rightResource
,
label
,
description
,
options
,
position
]
=
args
;
if
(
!
options
||
typeof
options
!==
'
object
'
)
{
options
=
{
preserveFocus
:
false
};
}
if
(
!
label
)
{
label
=
localize
(
'
diffLeftRightLabel
'
,
"
{0} ⟷ {1}
"
,
leftResource
.
toString
(
true
),
rightResource
.
toString
(
true
));
}
return
editorService
.
openEditor
({
leftResource
,
rightResource
,
label
,
description
,
options
},
findEditorGroup
(
editorGroupService
,
position
)).
then
(()
=>
void
0
);
});
export
function
findEditorGroup
(
editorGroupService
:
IEditorGroupsService
,
position
?:
EditorPosition
):
GroupIdentifier
{
if
(
typeof
position
!==
'
number
'
)
{
return
ACTIVE_GROUP
;
// prefer active group when position is undefined
...
...
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
浏览文件 @
249da81b
...
...
@@ -8,7 +8,7 @@ import URI, { UriComponents } from 'vs/base/common/uri';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
Position
}
from
'
vs/platform/editor/common
/editor
'
;
import
{
EditorPosition
}
from
'
vs/workbench/api/shared
/editor
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
ExtHostContext
,
ExtHostWebviewsShape
,
IExtHostContext
,
MainContext
,
MainThreadWebviewsShape
,
WebviewPanelHandle
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
...
...
@@ -69,7 +69,7 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv
handle
:
WebviewPanelHandle
,
viewType
:
string
,
title
:
string
,
showOptions
:
{
viewColumn
:
Position
,
preserveFocus
:
boolean
},
showOptions
:
{
viewColumn
:
EditorPosition
|
null
,
preserveFocus
:
boolean
},
options
:
WebviewInputOptions
,
extensionLocation
:
UriComponents
):
void
{
...
...
@@ -104,7 +104,7 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv
webview
.
html
=
value
;
}
$reveal
(
handle
:
WebviewPanelHandle
,
viewColumn
:
Position
|
null
,
preserveFocus
:
boolean
):
void
{
$reveal
(
handle
:
WebviewPanelHandle
,
viewColumn
:
Editor
Position
|
null
,
preserveFocus
:
boolean
):
void
{
const
webview
=
this
.
getWebview
(
handle
);
if
(
webview
.
isDisposed
())
{
return
;
...
...
src/vs/workbench/api/node/apiCommands.ts
浏览文件 @
249da81b
...
...
@@ -8,7 +8,8 @@ import URI from 'vs/base/common/uri';
import
*
as
vscode
from
'
vscode
'
;
import
*
as
typeConverters
from
'
vs/workbench/api/node/extHostTypeConverters
'
;
import
{
CommandsRegistry
,
ICommandService
,
ICommandHandler
}
from
'
vs/platform/commands/common/commands
'
;
import
{
Position
as
EditorPosition
,
ITextEditorOptions
}
from
'
vs/platform/editor/common/editor
'
;
import
{
ITextEditorOptions
}
from
'
vs/platform/editor/common/editor
'
;
import
{
EditorPosition
}
from
'
vs/workbench/api/shared/editor
'
;
// -----------------------------------------------------------------
// The following commands are registered on both sides separately.
...
...
@@ -70,21 +71,21 @@ export class OpenAPICommand {
public
static
ID
=
'
vscode.open
'
;
public
static
execute
(
executor
:
ICommandsExecutor
,
resource
:
URI
,
columnOrOptions
?:
vscode
.
ViewColumn
|
vscode
.
TextDocumentShowOptions
):
Thenable
<
any
>
{
let
options
:
ITextEditorOptions
;
let
colum
n
:
EditorPosition
;
let
positio
n
:
EditorPosition
;
if
(
columnOrOptions
)
{
if
(
typeof
columnOrOptions
===
'
number
'
)
{
colum
n
=
typeConverters
.
ViewColumn
.
from
(
columnOrOptions
);
positio
n
=
typeConverters
.
ViewColumn
.
from
(
columnOrOptions
);
}
else
{
options
=
typeConverters
.
TextEditorOptions
.
from
(
columnOrOptions
);
colum
n
=
typeConverters
.
ViewColumn
.
from
(
columnOrOptions
.
viewColumn
);
positio
n
=
typeConverters
.
ViewColumn
.
from
(
columnOrOptions
.
viewColumn
);
}
}
return
executor
.
executeCommand
(
'
_workbench.open
'
,
[
resource
,
options
,
colum
n
positio
n
]);
}
}
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
249da81b
...
...
@@ -13,7 +13,7 @@ import Severity from 'vs/base/common/severity';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IMarkerData
}
from
'
vs/platform/markers/common/markers
'
;
import
{
Position
as
EditorPosition
}
from
'
vs/platform/editor/common
/editor
'
;
import
{
EditorPosition
}
from
'
vs/workbench/api/shared
/editor
'
;
import
{
IExtensionDescription
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
StatusbarAlignment
as
MainThreadStatusBarAlignment
}
from
'
vs/platform/statusbar/common/statusbar
'
;
import
{
ITelemetryInfo
}
from
'
vs/platform/telemetry/common/telemetry
'
;
...
...
src/vs/workbench/api/node/extHostTextEditors.ts
浏览文件 @
249da81b
...
...
@@ -11,7 +11,7 @@ import { TextEditorSelectionChangeKind } from './extHostTypes';
import
*
as
TypeConverters
from
'
./extHostTypeConverters
'
;
import
{
TextEditorDecorationType
,
ExtHostTextEditor
}
from
'
./extHostTextEditor
'
;
import
{
ExtHostDocumentsAndEditors
}
from
'
./extHostDocumentsAndEditors
'
;
import
{
Position
as
EditorPosition
}
from
'
vs/platform/editor/common
/editor
'
;
import
{
EditorPosition
}
from
'
vs/workbench/api/shared
/editor
'
;
import
{
MainContext
,
MainThreadTextEditorsShape
,
ExtHostEditorsShape
,
ITextDocumentShowOptions
,
ITextEditorPositionData
,
IMainContext
,
WorkspaceEditDto
,
IEditorPropertiesChangeData
}
from
'
./extHost.protocol
'
;
import
*
as
vscode
from
'
vscode
'
;
...
...
@@ -73,7 +73,7 @@ export class ExtHostEditors implements ExtHostEditorsShape {
};
}
else
{
options
=
{
position
:
EditorPosition
.
ONE
,
position
:
0
as
EditorPosition
,
preserveFocus
:
false
};
}
...
...
src/vs/workbench/api/node/extHostTypeConverters.ts
浏览文件 @
249da81b
...
...
@@ -6,7 +6,8 @@
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
*
as
types
from
'
./extHostTypes
'
;
import
{
Position
as
EditorPosition
,
ITextEditorOptions
}
from
'
vs/platform/editor/common/editor
'
;
import
{
ITextEditorOptions
}
from
'
vs/platform/editor/common/editor
'
;
import
{
EditorPosition
}
from
'
vs/workbench/api/shared/editor
'
;
import
{
IDecorationOptions
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EndOfLineSequence
}
from
'
vs/editor/common/model
'
;
import
*
as
vscode
from
'
vscode
'
;
...
...
@@ -157,13 +158,13 @@ export namespace DiagnosticSeverity {
export
namespace
ViewColumn
{
export
function
from
(
column
?:
vscode
.
ViewColumn
):
EditorPosition
{
let
editorColumn
=
EditorPosition
.
ONE
;
let
editorColumn
=
0
;
if
(
typeof
column
!==
'
number
'
)
{
// stick with ONE
}
else
if
(
column
===
<
number
>
types
.
ViewColumn
.
Two
)
{
editorColumn
=
EditorPosition
.
TWO
;
editorColumn
=
1
;
}
else
if
(
column
===
<
number
>
types
.
ViewColumn
.
Three
)
{
editorColumn
=
EditorPosition
.
THREE
;
editorColumn
=
2
;
}
else
if
(
column
===
<
number
>
types
.
ViewColumn
.
Active
)
{
editorColumn
=
undefined
;
}
...
...
@@ -174,11 +175,11 @@ export namespace ViewColumn {
if
(
typeof
position
!==
'
number
'
)
{
return
undefined
;
}
if
(
position
===
EditorPosition
.
ONE
)
{
if
(
position
===
0
)
{
return
<
number
>
types
.
ViewColumn
.
One
;
}
else
if
(
position
===
EditorPosition
.
TWO
)
{
}
else
if
(
position
===
1
)
{
return
<
number
>
types
.
ViewColumn
.
Two
;
}
else
if
(
position
===
EditorPosition
.
THREE
)
{
}
else
if
(
position
===
2
)
{
return
<
number
>
types
.
ViewColumn
.
Three
;
}
return
undefined
;
...
...
src/vs/workbench/api/node/extHostWebview.ts
浏览文件 @
249da81b
...
...
@@ -7,7 +7,7 @@ import { MainContext, MainThreadWebviewsShape, IMainContext, ExtHostWebviewsShap
import
*
as
vscode
from
'
vscode
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
*
as
typeConverters
from
'
vs/workbench/api/node/extHostTypeConverters
'
;
import
{
Position
}
from
'
vs/platform/editor/common
/editor
'
;
import
{
EditorPosition
}
from
'
vs/workbench/api/shared
/editor
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Disposable
}
from
'
./extHostTypes
'
;
import
URI
from
'
vs/base/common/uri
'
;
...
...
@@ -248,7 +248,7 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
}
}
$onDidChangeWebviewPanelViewState
(
handle
:
WebviewPanelHandle
,
visible
:
boolean
,
position
:
Position
):
void
{
$onDidChangeWebviewPanelViewState
(
handle
:
WebviewPanelHandle
,
visible
:
boolean
,
position
:
Editor
Position
):
void
{
const
panel
=
this
.
getWebviewPanel
(
handle
);
if
(
panel
)
{
const
viewColumn
=
typeConverters
.
ViewColumn
.
to
(
position
);
...
...
@@ -274,7 +274,7 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
viewType
:
string
,
title
:
string
,
state
:
any
,
position
:
Position
,
position
:
Editor
Position
,
options
:
vscode
.
WebviewOptions
&
vscode
.
WebviewPanelOptions
):
Thenable
<
void
>
{
const
serializer
=
this
.
_serializers
.
get
(
viewType
);
...
...
src/vs/workbench/api/shared/editor.ts
0 → 100644
浏览文件 @
249da81b
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
// TODO@api this was previously a hardcoded list of editor positions (ONE, TWO, THREE)
// that with the introduction of grid editor feature is now unbounded. This should be
// revisited when the grid functionality is exposed to extensions
export
type
EditorPosition
=
number
;
\ No newline at end of file
src/vs/workbench/electron-browser/commands.ts
浏览文件 @
249da81b
...
...
@@ -5,7 +5,6 @@
'
use strict
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
KeyMod
,
KeyChord
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
KeybindingsRegistry
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
...
...
@@ -14,9 +13,6 @@ import { IWindowsService, IWindowService } from 'vs/platform/windows/common/wind
import
{
List
}
from
'
vs/base/browser/ui/list/listWidget
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
IEditorOptions
,
Position
as
EditorPosition
}
from
'
vs/platform/editor/common/editor
'
;
import
{
WorkbenchListFocusContextKey
,
IListService
,
WorkbenchListSupportsMultiSelectContextKey
,
ListWidget
}
from
'
vs/platform/list/browser/listService
'
;
import
{
PagedList
}
from
'
vs/base/browser/ui/list/listPaging
'
;
import
{
range
}
from
'
vs/base/common/arrays
'
;
...
...
@@ -535,30 +531,6 @@ export function registerCommands(): void {
win
:
{
primary
:
void
0
}
});
CommandsRegistry
.
registerCommand
(
'
_workbench.diff
'
,
function
(
accessor
:
ServicesAccessor
,
args
:
[
URI
,
URI
,
string
,
string
,
IEditorOptions
,
EditorPosition
])
{
const
editorService
=
accessor
.
get
(
IEditorService
);
let
[
leftResource
,
rightResource
,
label
,
description
,
options
,
position
]
=
args
;
if
(
!
options
||
typeof
options
!==
'
object
'
)
{
options
=
{
preserveFocus
:
false
};
}
if
(
!
label
)
{
label
=
nls
.
localize
(
'
diffLeftRightLabel
'
,
"
{0} ⟷ {1}
"
,
leftResource
.
toString
(
true
),
rightResource
.
toString
(
true
));
}
return
editorService
.
openEditor
({
leftResource
,
rightResource
,
label
,
description
,
options
},
position
).
then
(()
=>
void
0
);
});
CommandsRegistry
.
registerCommand
(
'
_workbench.open
'
,
function
(
accessor
:
ServicesAccessor
,
args
:
[
URI
,
IEditorOptions
,
EditorPosition
])
{
const
editorService
=
accessor
.
get
(
IEditorService
);
const
[
resource
,
options
,
column
]
=
args
;
return
editorService
.
openEditor
({
resource
,
options
},
column
).
then
(()
=>
void
0
);
});
CommandsRegistry
.
registerCommand
(
'
_workbench.removeFromRecentlyOpened
'
,
function
(
accessor
:
ServicesAccessor
,
path
:
string
)
{
const
windowsService
=
accessor
.
get
(
IWindowsService
);
...
...
src/vs/workbench/parts/backup/common/backupRestorer.ts
浏览文件 @
249da81b
...
...
@@ -47,7 +47,7 @@ export class BackupRestorer implements IWorkbenchContribution {
// Find all files and untitled with backups
return
this
.
backupFileService
.
getWorkspaceFileBackups
().
then
(
backups
=>
{
// Resolve backups that are opened
in stacks model
// Resolve backups that are opened
return
this
.
doResolveOpenedBackups
(
backups
).
then
(
unresolved
=>
{
// Some failed to restore or were not opened at all so we open and resolve them manually
...
...
src/vs/workbench/parts/html/electron-browser/html.contribution.ts
浏览文件 @
249da81b
...
...
@@ -9,7 +9,7 @@ import { localize } from 'vs/nls';
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IInstantiationService
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
Position
as
EditorPosition
}
from
'
vs/platform/editor/common
/editor
'
;
import
{
EditorPosition
}
from
'
vs/workbench/api/shared
/editor
'
;
import
{
HtmlInput
,
HtmlInputOptions
}
from
'
../common/htmlInput
'
;
import
{
HtmlPreviewPart
}
from
'
./htmlPreviewPart
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
...
...
src/vs/workbench/parts/webview/electron-browser/webviewEditorService.ts
浏览文件 @
249da81b
...
...
@@ -6,7 +6,6 @@
import
{
IDisposable
,
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Position
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IInstantiationService
,
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IEditorService
,
ACTIVE_GROUP_TYPE
,
SIDE_GROUP_TYPE
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorGroupsService
,
IEditorGroup
}
from
'
vs/workbench/services/group/common/editorGroupsService
'
;
...
...
@@ -69,7 +68,6 @@ export interface WebviewReviver {
export
interface
WebviewEvents
{
onMessage
?(
message
:
any
):
void
;
onDidChangePosition
?(
newPosition
:
Position
):
void
;
onDispose
?():
void
;
onDidClickLink
?(
link
:
URI
,
options
:
vscode
.
WebviewOptions
):
void
;
}
...
...
src/vs/workbench/test/electron-browser/api/extHostWebview.test.ts
浏览文件 @
249da81b
...
...
@@ -11,7 +11,7 @@ import { ExtHostWebviews } from 'vs/workbench/api/node/extHostWebview';
import
{
mock
}
from
'
vs/workbench/test/electron-browser/api/mock
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
SingleProxyRPCProtocol
}
from
'
./testRPCProtocol
'
;
import
{
Position
as
EditorPosition
}
from
'
vs/platform/editor/common
/editor
'
;
import
{
EditorPosition
}
from
'
vs/workbench/api/shared
/editor
'
;
suite
(
'
ExtHostWebview
'
,
function
()
{
...
...
@@ -34,7 +34,7 @@ suite('ExtHostWebview', function () {
const
serializerARegistration
=
extHostWebviews
.
registerWebviewPanelSerializer
(
viewType
,
serializerA
);
await
extHostWebviews
.
$deserializeWebviewPanel
(
'
x
'
,
viewType
,
'
title
'
,
{},
EditorPosition
.
ONE
,
{});
await
extHostWebviews
.
$deserializeWebviewPanel
(
'
x
'
,
viewType
,
'
title
'
,
{},
0
as
EditorPosition
,
{});
assert
.
strictEqual
(
lastInvokedDeserializer
,
serializerA
);
assert
.
throws
(
...
...
@@ -45,7 +45,7 @@ suite('ExtHostWebview', function () {
extHostWebviews
.
registerWebviewPanelSerializer
(
viewType
,
serializerB
);
await
extHostWebviews
.
$deserializeWebviewPanel
(
'
x
'
,
viewType
,
'
title
'
,
{},
EditorPosition
.
ONE
,
{});
await
extHostWebviews
.
$deserializeWebviewPanel
(
'
x
'
,
viewType
,
'
title
'
,
{},
0
as
EditorPosition
,
{});
assert
.
strictEqual
(
lastInvokedDeserializer
,
serializerB
);
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录