Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
f8effd5f
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,发现更多精彩内容 >>
提交
f8effd5f
编写于
9月 13, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
api - introduce env.uiKind (web, desktop)
上级
3fd9684e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
55 addition
and
6 deletion
+55
-6
extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts
...sions/vscode-api-tests/src/singlefolder-tests/env.test.ts
+6
-1
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+30
-0
src/vs/workbench/api/common/extHost.api.impl.ts
src/vs/workbench/api/common/extHost.api.impl.ts
+6
-1
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+6
-0
src/vs/workbench/services/extensions/browser/webWorkerExtensionHostStarter.ts
...vices/extensions/browser/webWorkerExtensionHostStarter.ts
+2
-1
src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts
...h/services/extensions/common/remoteExtensionHostClient.ts
+2
-1
src/vs/workbench/services/extensions/electron-browser/extensionHost.ts
...nch/services/extensions/electron-browser/extensionHost.ts
+3
-2
未找到文件。
extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts
浏览文件 @
f8effd5f
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
env
,
extensions
,
ExtensionKind
}
from
'
vscode
'
;
import
{
env
,
extensions
,
ExtensionKind
,
UIKind
}
from
'
vscode
'
;
suite
(
'
env-namespace
'
,
()
=>
{
...
...
@@ -44,4 +44,9 @@ suite('env-namespace', () => {
assert
.
fail
();
}
});
test
(
'
env.uiKind
'
,
function
()
{
const
kind
=
env
.
uiKind
;
assert
.
equal
(
kind
,
UIKind
.
Desktop
);
});
});
src/vs/vscode.proposed.d.ts
浏览文件 @
f8effd5f
...
...
@@ -1011,6 +1011,36 @@ declare module 'vscode' {
//#endregion
// #region Ben - UIKind
/**
* Possible kinds of UI that can use extensions.
*/
export
enum
UIKind
{
/**
* Extensions are accessed from a desktop application.
*/
Desktop
=
1
,
/**
* Extensions are accessed from a web browser.
*/
Web
=
2
}
export
namespace
env
{
/**
* The UI kind property indicates from which UI extensions
* are accessed from. For example, extensions could be accessed
* from a desktop application or a web browser.
*/
export
const
uiKind
:
UIKind
;
}
//#endregion
//#region Custom editors, mjbvz
export
enum
WebviewEditorState
{
...
...
src/vs/workbench/api/common/extHost.api.impl.ts
浏览文件 @
f8effd5f
...
...
@@ -15,7 +15,7 @@ import { OverviewRulerLane } from 'vs/editor/common/model';
import
*
as
languageConfiguration
from
'
vs/editor/common/modes/languageConfiguration
'
;
import
{
score
}
from
'
vs/editor/common/modes/languageSelector
'
;
import
*
as
files
from
'
vs/platform/files/common/files
'
;
import
{
ExtHostContext
,
MainContext
,
ExtHostLogServiceShape
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ExtHostContext
,
MainContext
,
ExtHostLogServiceShape
,
UIKind
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ExtHostApiCommands
}
from
'
vs/workbench/api/common/extHostApiCommands
'
;
import
{
ExtHostClipboard
}
from
'
vs/workbench/api/common/extHostClipboard
'
;
import
{
IExtHostCommands
}
from
'
vs/workbench/api/common/extHostCommands
'
;
...
...
@@ -250,6 +250,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
},
get
remoteName
()
{
return
getRemoteName
(
initData
.
remote
.
authority
);
},
get
uiKind
()
{
checkProposedApiEnabled
(
extension
);
return
initData
.
uiKind
;
}
};
if
(
!
initData
.
environment
.
extensionTestsLocationURI
)
{
...
...
@@ -898,6 +902,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
CallHierarchyItem
:
extHostTypes
.
CallHierarchyItem
,
Decoration
:
extHostTypes
.
Decoration
,
WebviewEditorState
:
extHostTypes
.
WebviewEditorState
,
UIKind
:
UIKind
};
};
}
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
f8effd5f
...
...
@@ -87,6 +87,7 @@ export interface IInitData {
logsLocation
:
URI
;
autoStart
:
boolean
;
remote
:
{
isRemote
:
boolean
;
authority
:
string
|
undefined
;
};
uiKind
:
UIKind
;
}
export
interface
IConfigurationInitData
extends
IConfigurationData
{
...
...
@@ -105,6 +106,11 @@ export interface IExtHostContext extends IRPCProtocol {
export
interface
IMainContext
extends
IRPCProtocol
{
}
export
enum
UIKind
{
Desktop
=
1
,
Web
=
2
}
// --- main thread
export
interface
MainThreadClipboardShape
extends
IDisposable
{
...
...
src/vs/workbench/services/extensions/browser/webWorkerExtensionHostStarter.ts
浏览文件 @
f8effd5f
...
...
@@ -9,7 +9,7 @@ import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
import
{
IMessagePassingProtocol
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
{
createMessageOfType
,
MessageType
,
isMessageOfType
}
from
'
vs/workbench/services/extensions/common/extensionHostProtocol
'
;
import
{
IInitData
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
IInitData
,
UIKind
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
...
...
@@ -150,6 +150,7 @@ export class WebWorkerExtensionHostStarter implements IExtensionHostStarter {
authority
:
this
.
_environmentService
.
configuration
.
remoteAuthority
,
isRemote
:
false
},
uiKind
:
platform
.
isWeb
?
UIKind
.
Web
:
UIKind
.
Desktop
};
}
}
src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts
浏览文件 @
f8effd5f
...
...
@@ -11,7 +11,7 @@ import { ILogService } from 'vs/platform/log/common/log';
import
{
connectRemoteAgentExtensionHost
,
IRemoteExtensionHostStartParams
,
IConnectionOptions
,
ISocketFactory
}
from
'
vs/platform/remote/common/remoteAgentConnection
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IInitData
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
IInitData
,
UIKind
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
MessageType
,
createMessageOfType
,
isMessageOfType
}
from
'
vs/workbench/services/extensions/common/extensionHostProtocol
'
;
import
{
IExtensionHostStarter
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
parseExtensionDevOptions
}
from
'
vs/workbench/services/extensions/common/extensionDevOptions
'
;
...
...
@@ -215,6 +215,7 @@ export class RemoteExtensionHostClient extends Disposable implements IExtensionH
logLevel
:
this
.
_logService
.
getLevel
(),
logsLocation
:
remoteExtensionHostData
.
extensionHostLogsPath
,
autoStart
:
true
,
uiKind
:
platform
.
isWeb
?
UIKind
.
Web
:
UIKind
.
Desktop
};
return
r
;
});
...
...
src/vs/workbench/services/extensions/electron-browser/extensionHost.ts
浏览文件 @
f8effd5f
...
...
@@ -29,7 +29,7 @@ import { INotificationService, Severity } from 'vs/platform/notification/common/
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IWindowService
,
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IInitData
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
IInitData
,
UIKind
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
MessageType
,
createMessageOfType
,
isMessageOfType
}
from
'
vs/workbench/services/extensions/common/extensionHostProtocol
'
;
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
import
{
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
...
...
@@ -420,7 +420,8 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter {
telemetryInfo
,
logLevel
:
this
.
_logService
.
getLevel
(),
logsLocation
:
this
.
_extensionHostLogsLocation
,
autoStart
:
this
.
_autoStart
autoStart
:
this
.
_autoStart
,
uiKind
:
UIKind
.
Desktop
};
return
r
;
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录