Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
29082247
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,体验更适合开发者的 AI 搜索 >>
提交
29082247
编写于
6月 18, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
extensions model: first steps
上级
bdb3bfef
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
122 addition
and
10 deletion
+122
-10
src/vs/platform/extensionManagement/common/extensionManagement.ts
...latform/extensionManagement/common/extensionManagement.ts
+2
-8
src/vs/platform/extensionManagement/node/extensionGalleryService.ts
...tform/extensionManagement/node/extensionGalleryService.ts
+3
-2
src/vs/workbench/parts/extensions/electron-browser/extensionsModel.ts
...ench/parts/extensions/electron-browser/extensionsModel.ts
+117
-0
未找到文件。
src/vs/platform/extensionManagement/common/extensionManagement.ts
浏览文件 @
29082247
...
...
@@ -8,6 +8,7 @@
import
nls
=
require
(
'
vs/nls
'
);
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
Event
from
'
vs/base/common/event
'
;
import
{
IPager
}
from
'
vs/base/common/paging
'
;
import
{
createDecorator
,
ServiceIdentifier
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
interface
IExtensionManifest
{
...
...
@@ -70,17 +71,10 @@ export interface IQueryOptions {
pageSize
?:
number
;
}
export
interface
IQueryResult
{
firstPage
:
IGalleryExtension
[];
total
:
number
;
pageSize
:
number
;
getPage
(
pageNumber
:
number
):
TPromise
<
IGalleryExtension
[]
>
;
}
export
interface
IExtensionGalleryService
{
serviceId
:
ServiceIdentifier
<
any
>
;
isEnabled
():
boolean
;
query
(
options
?:
IQueryOptions
):
TPromise
<
I
QueryResult
>
;
query
(
options
?:
IQueryOptions
):
TPromise
<
I
Pager
<
IGalleryExtension
>
>
;
}
export
type
DidInstallExtensionEvent
=
{
id
:
string
;
error
?:
Error
;
};
...
...
src/vs/platform/extensionManagement/node/extensionGalleryService.ts
浏览文件 @
29082247
...
...
@@ -4,11 +4,12 @@
*--------------------------------------------------------------------------------------------*/
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IGalleryExtension
,
IExtensionGalleryService
,
IGalleryVersion
,
IQueryOptions
,
IQueryResult
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
IGalleryExtension
,
IExtensionGalleryService
,
IGalleryVersion
,
IQueryOptions
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
isUndefined
}
from
'
vs/base/common/types
'
;
import
{
assign
,
getOrDefault
}
from
'
vs/base/common/objects
'
;
import
{
IRequestService
}
from
'
vs/platform/request/common/request
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IPager
}
from
'
vs/base/common/paging
'
;
import
pkg
from
'
vs/platform/package
'
;
import
product
from
'
vs/platform/product
'
;
...
...
@@ -208,7 +209,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
return
!!
this
.
extensionsGalleryUrl
;
}
query
(
options
:
IQueryOptions
=
{}):
TPromise
<
I
QueryResult
>
{
query
(
options
:
IQueryOptions
=
{}):
TPromise
<
I
Pager
<
IGalleryExtension
>
>
{
if
(
!
this
.
isEnabled
())
{
return
TPromise
.
wrapError
(
new
Error
(
'
No extension gallery service configured.
'
));
}
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionsModel.ts
0 → 100644
浏览文件 @
29082247
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
'
vs/css!./media/extensionsViewlet
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IPager
}
from
'
vs/base/common/paging
'
;
import
{
IExtensionManagementService
,
IExtensionGalleryService
,
ILocalExtension
,
IGalleryExtension
,
IQueryOptions
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
export
enum
ExtensionState
{
Installing
,
Installed
,
Uninstalling
,
Uninstalled
}
export
interface
IExtension
{
name
:
string
;
publisher
:
string
;
displayName
:
string
;
version
:
string
;
description
:
string
;
iconUrl
:
string
;
}
class
Extension
implements
IExtension
{
local
:
ILocalExtension
;
gallery
:
IGalleryExtension
;
constructor
()
{
}
get
name
():
string
{
return
this
.
local
?
this
.
local
.
manifest
.
name
:
this
.
gallery
.
name
;
}
get
publisher
():
string
{
if
(
this
.
local
)
{
if
(
this
.
local
.
metadata
&&
this
.
local
.
metadata
.
publisherDisplayName
)
{
return
this
.
local
.
metadata
.
publisherDisplayName
;
}
return
this
.
local
.
manifest
.
publisher
;
}
return
this
.
gallery
.
publisherDisplayName
||
this
.
gallery
.
publisher
;
}
get
displayName
():
string
{
if
(
this
.
local
)
{
return
this
.
local
.
manifest
.
displayName
||
this
.
local
.
manifest
.
name
;
}
return
this
.
gallery
.
displayName
||
this
.
gallery
.
name
;
}
get
version
():
string
{
return
this
.
local
?
this
.
local
.
manifest
.
version
:
this
.
gallery
.
versions
[
0
].
version
;
}
get
description
():
string
{
return
this
.
local
?
this
.
local
.
manifest
.
description
:
this
.
gallery
.
description
;
}
get
iconUrl
():
string
{
if
(
this
.
local
&&
this
.
local
.
manifest
.
icon
)
{
return
`file://
${
this
.
local
.
path
}
/
${
this
.
local
.
manifest
.
icon
}
`
;
}
if
(
this
.
gallery
&&
this
.
gallery
.
versions
[
0
].
iconUrl
)
{
return
this
.
gallery
.
versions
[
0
].
iconUrl
;
}
return
require
.
toUrl
(
'
./media/defaultIcon.png
'
);
}
}
export
class
ExtensionsModel
{
private
disposables
:
IDisposable
[]
=
[];
// private installing: Extension[];
// private installed: Extension[];
private
_onChange
:
Emitter
<
void
>
;
get
onChange
():
Event
<
void
>
{
return
this
.
_onChange
.
event
;
}
constructor
(
@
IExtensionManagementService
private
extensionService
:
IExtensionManagementService
,
@
IExtensionGalleryService
private
galleryService
:
IExtensionGalleryService
)
{
// todo
}
getInstalled
():
IExtension
[]
{
throw
new
Error
(
'
not implemented
'
);
}
queryGallery
(
options
:
IQueryOptions
=
{}):
TPromise
<
IPager
<
IExtension
>>
{
throw
new
Error
(
'
not implemented
'
);
}
getState
(
extension
:
IExtension
):
ExtensionState
{
throw
new
Error
(
'
not implemented
'
);
}
dispose
():
void
{
this
.
disposables
=
dispose
(
this
.
disposables
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录