Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7dbe3bfa
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,发现更多精彩内容 >>
提交
7dbe3bfa
编写于
3月 19, 2019
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
disallow vscode-dependency in extHost.protocol, #70319
上级
57474cfa
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
52 addition
and
24 deletion
+52
-24
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+41
-9
src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts
src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts
+2
-3
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
+5
-6
src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts
src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts
+2
-3
tslint.json
tslint.json
+2
-3
未找到文件。
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
7dbe3bfa
...
...
@@ -39,7 +39,6 @@ import { ExtensionActivationError } from 'vs/workbench/services/extensions/commo
import
{
IRPCProtocol
,
createExtHostContextProxyIdentifier
as
createExtId
,
createMainContextProxyIdentifier
as
createMainId
}
from
'
vs/workbench/services/extensions/common/proxyIdentifier
'
;
import
{
IProgressOptions
,
IProgressStep
}
from
'
vs/platform/progress/common/progress
'
;
import
{
SaveReason
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
IMarkdownString
}
from
'
vs/base/common/htmlContent
'
;
import
{
ResolvedAuthority
}
from
'
vs/platform/remote/common/remoteAuthorityResolver
'
;
import
{
ExtensionIdentifier
,
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
...
...
@@ -302,11 +301,13 @@ export interface ISerializedLanguageConfiguration {
};
}
export
type
GlobPattern
=
string
|
{
base
:
string
;
pattern
:
string
};
export
interface
ISerializedDocumentFilter
{
$serialized
:
true
;
language
?:
string
;
scheme
?:
string
;
pattern
?:
vscode
.
GlobPattern
;
pattern
?:
GlobPattern
;
exclusive
?:
boolean
;
}
...
...
@@ -464,11 +465,20 @@ export interface TransferInputBox extends BaseTransferQuickInput {
validationMessage
?:
string
;
}
export
interface
IInputBoxOptions
{
value
?:
string
;
valueSelection
?:
[
number
,
number
];
prompt
?:
string
;
placeHolder
?:
string
;
password
?:
boolean
;
ignoreFocusOut
?:
boolean
;
}
export
interface
MainThreadQuickOpenShape
extends
IDisposable
{
$show
(
instance
:
number
,
options
:
quickInput
.
IPickOptions
<
TransferQuickPickItems
>
,
token
:
CancellationToken
):
Promise
<
number
|
number
[]
|
undefined
>
;
$setItems
(
instance
:
number
,
items
:
TransferQuickPickItems
[]):
Promise
<
void
>
;
$setError
(
instance
:
number
,
error
:
Error
):
Promise
<
void
>
;
$input
(
options
:
vscode
.
InputBoxOptions
|
undefined
,
validateInput
:
boolean
,
token
:
CancellationToken
):
Promise
<
string
>
;
$input
(
options
:
I
InputBoxOptions
|
undefined
,
validateInput
:
boolean
,
token
:
CancellationToken
):
Promise
<
string
>
;
$createOrUpdate
(
params
:
TransferQuickInput
):
Promise
<
void
>
;
$dispose
(
id
:
number
):
Promise
<
void
>
;
}
...
...
@@ -496,16 +506,27 @@ export interface WebviewPanelShowOptions {
readonly
preserveFocus
?:
boolean
;
}
export
interface
IWebviewPanelOptions
{
readonly
enableFindWidget
?:
boolean
;
readonly
retainContextWhenHidden
?:
boolean
;
}
export
interface
IWebviewOptions
{
readonly
enableScripts
?:
boolean
;
readonly
enableCommandUris
?:
boolean
;
readonly
localResourceRoots
?:
ReadonlyArray
<
UriComponents
>
;
}
export
interface
MainThreadWebviewsShape
extends
IDisposable
{
$createWebviewPanel
(
handle
:
WebviewPanelHandle
,
viewType
:
string
,
title
:
string
,
showOptions
:
WebviewPanelShowOptions
,
options
:
vscode
.
WebviewPanelOptions
&
vscode
.
WebviewOptions
,
extensionId
:
ExtensionIdentifier
,
extensionLocation
:
UriComponents
):
void
;
$createWebviewCodeInset
(
handle
:
WebviewInsetHandle
,
symbolId
:
string
,
options
:
vscode
.
WebviewOptions
,
extensionLocation
:
UriComponents
|
undefined
):
void
;
$createWebviewPanel
(
handle
:
WebviewPanelHandle
,
viewType
:
string
,
title
:
string
,
showOptions
:
WebviewPanelShowOptions
,
options
:
IWebviewPanelOptions
&
I
WebviewOptions
,
extensionId
:
ExtensionIdentifier
,
extensionLocation
:
UriComponents
):
void
;
$createWebviewCodeInset
(
handle
:
WebviewInsetHandle
,
symbolId
:
string
,
options
:
I
WebviewOptions
,
extensionLocation
:
UriComponents
|
undefined
):
void
;
$disposeWebview
(
handle
:
WebviewPanelHandle
):
void
;
$reveal
(
handle
:
WebviewPanelHandle
,
showOptions
:
WebviewPanelShowOptions
):
void
;
$setTitle
(
handle
:
WebviewPanelHandle
,
value
:
string
):
void
;
$setIconPath
(
handle
:
WebviewPanelHandle
,
value
:
{
light
:
UriComponents
,
dark
:
UriComponents
}
|
undefined
):
void
;
$setHtml
(
handle
:
WebviewPanelHandle
|
WebviewInsetHandle
,
value
:
string
):
void
;
$setOptions
(
handle
:
WebviewPanelHandle
|
WebviewInsetHandle
,
options
:
vscode
.
WebviewOptions
):
void
;
$setOptions
(
handle
:
WebviewPanelHandle
|
WebviewInsetHandle
,
options
:
I
WebviewOptions
):
void
;
$postMessage
(
handle
:
WebviewPanelHandle
|
WebviewInsetHandle
,
value
:
any
):
Promise
<
boolean
>
;
$registerSerializer
(
viewType
:
string
):
void
;
...
...
@@ -522,7 +543,7 @@ export interface ExtHostWebviewsShape {
$onMessage
(
handle
:
WebviewPanelHandle
,
message
:
any
):
void
;
$onDidChangeWebviewPanelViewState
(
handle
:
WebviewPanelHandle
,
newState
:
WebviewPanelViewState
):
void
;
$onDidDisposeWebviewPanel
(
handle
:
WebviewPanelHandle
):
Promise
<
void
>
;
$deserializeWebviewPanel
(
newWebviewHandle
:
WebviewPanelHandle
,
viewType
:
string
,
title
:
string
,
state
:
any
,
position
:
EditorViewColumn
,
options
:
vscode
.
WebviewOptions
):
Promise
<
void
>
;
$deserializeWebviewPanel
(
newWebviewHandle
:
WebviewPanelHandle
,
viewType
:
string
,
title
:
string
,
state
:
any
,
position
:
EditorViewColumn
,
options
:
I
WebviewOptions
):
Promise
<
void
>
;
}
export
interface
MainThreadUrlsShape
extends
IDisposable
{
...
...
@@ -534,9 +555,13 @@ export interface ExtHostUrlsShape {
$handleExternalUri
(
handle
:
number
,
uri
:
UriComponents
):
Promise
<
void
>
;
}
export
interface
ITextSearchComplete
{
limitHit
?:
boolean
;
}
export
interface
MainThreadWorkspaceShape
extends
IDisposable
{
$startFileSearch
(
includePattern
:
string
|
undefined
,
includeFolder
:
UriComponents
|
undefined
,
excludePatternOrDisregardExcludes
:
string
|
false
|
undefined
,
maxResults
:
number
|
undefined
,
token
:
CancellationToken
):
Promise
<
UriComponents
[]
|
undefined
>
;
$startTextSearch
(
query
:
search
.
IPatternInfo
,
options
:
ITextQueryBuilderOptions
,
requestId
:
number
,
token
:
CancellationToken
):
Promise
<
vscode
.
TextSearchComplete
>
;
$startTextSearch
(
query
:
search
.
IPatternInfo
,
options
:
ITextQueryBuilderOptions
,
requestId
:
number
,
token
:
CancellationToken
):
Promise
<
I
TextSearchComplete
>
;
$checkExists
(
includes
:
string
[],
token
:
CancellationToken
):
Promise
<
boolean
>
;
$saveAll
(
includeUntitled
?:
boolean
):
Promise
<
boolean
>
;
$updateWorkspaceFolders
(
extensionName
:
string
,
index
:
number
,
deleteCount
:
number
,
workspaceFoldersToAdd
:
{
uri
:
UriComponents
,
name
?:
string
}[]):
Promise
<
void
>
;
...
...
@@ -640,6 +665,13 @@ export interface MainThreadSCMShape extends IDisposable {
export
type
DebugSessionUUID
=
string
;
export
interface
IDebugConfiguration
{
type
:
string
;
name
:
string
;
request
:
string
;
[
key
:
string
]:
any
;
}
export
interface
MainThreadDebugServiceShape
extends
IDisposable
{
$registerDebugTypes
(
debugTypes
:
string
[]):
void
;
$sessionCached
(
sessionID
:
string
):
void
;
...
...
@@ -652,7 +684,7 @@ export interface MainThreadDebugServiceShape extends IDisposable {
$unregisterDebugConfigurationProvider
(
handle
:
number
):
void
;
$unregisterDebugAdapterDescriptorFactory
(
handle
:
number
):
void
;
$unregisterDebugAdapterTrackerFactory
(
handle
:
number
):
void
;
$startDebugging
(
folder
:
UriComponents
|
undefined
,
nameOrConfig
:
string
|
vscode
.
DebugConfiguration
,
parentSessionID
:
string
|
undefined
):
Promise
<
boolean
>
;
$startDebugging
(
folder
:
UriComponents
|
undefined
,
nameOrConfig
:
string
|
I
DebugConfiguration
,
parentSessionID
:
string
|
undefined
):
Promise
<
boolean
>
;
$customDebugAdapterRequest
(
id
:
DebugSessionUUID
,
command
:
string
,
args
:
any
):
Promise
<
any
>
;
$appendDebugConsole
(
value
:
string
):
void
;
$startBreakpointEvents
():
void
;
...
...
src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts
浏览文件 @
7dbe3bfa
...
...
@@ -4,8 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
IPickOptions
,
IInputOptions
,
IQuickInputService
,
IQuickInput
}
from
'
vs/platform/quickinput/common/quickInput
'
;
import
{
InputBoxOptions
}
from
'
vscode
'
;
import
{
ExtHostContext
,
MainThreadQuickOpenShape
,
ExtHostQuickOpenShape
,
TransferQuickPickItems
,
MainContext
,
IExtHostContext
,
TransferQuickInput
,
TransferQuickInputButton
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ExtHostContext
,
MainThreadQuickOpenShape
,
ExtHostQuickOpenShape
,
TransferQuickPickItems
,
MainContext
,
IExtHostContext
,
TransferQuickInput
,
TransferQuickInputButton
,
IInputBoxOptions
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
'
vs/workbench/api/common/extHostCustomers
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
...
...
@@ -85,7 +84,7 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape {
// ---- input
$input
(
options
:
InputBoxOptions
|
undefined
,
validateInput
:
boolean
,
token
:
CancellationToken
):
Promise
<
string
>
{
$input
(
options
:
I
I
nputBoxOptions
|
undefined
,
validateInput
:
boolean
,
token
:
CancellationToken
):
Promise
<
string
>
{
const
inputOptions
:
IInputOptions
=
Object
.
create
(
null
);
if
(
options
)
{
...
...
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
浏览文件 @
7dbe3bfa
...
...
@@ -13,7 +13,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ExtHostContext
,
ExtHostWebviewsShape
,
IExtHostContext
,
MainContext
,
MainThreadWebviewsShape
,
WebviewInsetHandle
,
WebviewPanelHandle
,
WebviewPanelShowOptions
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ExtHostContext
,
ExtHostWebviewsShape
,
IExtHostContext
,
MainContext
,
MainThreadWebviewsShape
,
WebviewInsetHandle
,
WebviewPanelHandle
,
WebviewPanelShowOptions
,
IWebviewOptions
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
editorGroupToViewColumn
,
EditorViewColumn
,
viewColumnToEditorGroup
}
from
'
vs/workbench/api/common/shared/editor
'
;
import
{
CodeInsetController
}
from
'
vs/workbench/contrib/codeinset/electron-browser/codeInset.contribution
'
;
import
{
WebviewEditor
}
from
'
vs/workbench/contrib/webview/electron-browser/webviewEditor
'
;
...
...
@@ -24,7 +24,6 @@ import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editor
import
{
ACTIVE_GROUP
,
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IWorkbenchLayoutService
,
Parts
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
extHostNamedCustomer
}
from
'
../common/extHostCustomers
'
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadWebviews
)
...
...
@@ -111,7 +110,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
this
.
_telemetryService
.
publicLog
(
'
webviews:createWebviewPanel
'
,
{
extensionId
:
extensionId
.
value
});
}
$createWebviewCodeInset
(
handle
:
WebviewInsetHandle
,
symbolId
:
string
,
options
:
vscode
.
WebviewOptions
,
extensionLocation
:
UriComponents
):
void
{
$createWebviewCodeInset
(
handle
:
WebviewInsetHandle
,
symbolId
:
string
,
options
:
I
WebviewOptions
,
extensionLocation
:
UriComponents
):
void
{
// todo@joh main is for the lack of a code-inset service
// which we maybe wanna have... this is how it now works
// 1) create webview element
...
...
@@ -173,12 +172,12 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
}
}
public
$setOptions
(
handle
:
WebviewPanelHandle
|
WebviewInsetHandle
,
options
:
vscode
.
WebviewOptions
):
void
{
public
$setOptions
(
handle
:
WebviewPanelHandle
|
WebviewInsetHandle
,
options
:
I
WebviewOptions
):
void
{
if
(
typeof
handle
===
'
number
'
)
{
this
.
getWebviewElement
(
handle
).
options
=
reviveWebviewOptions
(
options
);
this
.
getWebviewElement
(
handle
).
options
=
reviveWebviewOptions
(
options
as
any
/*todo@mat */
);
}
else
{
const
webview
=
this
.
getWebview
(
handle
);
webview
.
setOptions
(
reviveWebviewOptions
(
options
));
webview
.
setOptions
(
reviveWebviewOptions
(
options
as
any
/*todo@mat */
));
}
}
...
...
src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts
浏览文件 @
7dbe3bfa
...
...
@@ -21,8 +21,7 @@ import { ITextQueryBuilderOptions, QueryBuilder } from 'vs/workbench/contrib/sea
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IWorkspaceEditingService
}
from
'
vs/workbench/services/workspace/common/workspaceEditing
'
;
import
{
ExtHostContext
,
ExtHostWorkspaceShape
,
IExtHostContext
,
MainContext
,
MainThreadWorkspaceShape
,
IWorkspaceData
}
from
'
../common/extHost.protocol
'
;
import
{
TextSearchComplete
}
from
'
vscode
'
;
import
{
ExtHostContext
,
ExtHostWorkspaceShape
,
IExtHostContext
,
MainContext
,
MainThreadWorkspaceShape
,
IWorkspaceData
,
ITextSearchComplete
}
from
'
../common/extHost.protocol
'
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadWorkspace
)
export
class
MainThreadWorkspace
implements
MainThreadWorkspaceShape
{
...
...
@@ -148,7 +147,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape {
});
}
$startTextSearch
(
pattern
:
IPatternInfo
,
options
:
ITextQueryBuilderOptions
,
requestId
:
number
,
token
:
CancellationToken
):
Promise
<
TextSearchComplete
>
{
$startTextSearch
(
pattern
:
IPatternInfo
,
options
:
ITextQueryBuilderOptions
,
requestId
:
number
,
token
:
CancellationToken
):
Promise
<
I
TextSearchComplete
>
{
const
workspace
=
this
.
_contextService
.
getWorkspace
();
const
folders
=
workspace
.
folders
.
map
(
folder
=>
folder
.
uri
);
...
...
tslint.json
浏览文件 @
7dbe3bfa
...
...
@@ -376,7 +376,7 @@
]
},
{
"target"
:
"**/vs/workbench/api/common/
extHost.protocol.ts
"
,
"target"
:
"**/vs/workbench/api/common/
**
"
,
"restrictions"
:
[
"**/vs/base/common/**"
,
"**/vs/platform/*/common/**"
,
...
...
@@ -385,8 +385,7 @@
"**/vs/workbench/api/common/**"
,
"**/vs/workbench/common/**"
,
"**/vs/workbench/services/*/common/**"
,
"**/vs/workbench/contrib/*/common/**"
,
"vscode"
"**/vs/workbench/contrib/*/common/**"
]
},
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录