Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2d735515
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,发现更多精彩内容 >>
提交
2d735515
编写于
8月 14, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add authority and label to extension management server
上级
a057e321
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
22 addition
and
20 deletion
+22
-20
src/vs/platform/extensionManagement/common/extensionManagement.ts
...latform/extensionManagement/common/extensionManagement.ts
+3
-4
src/vs/platform/extensionManagement/common/multiExtensionManagement.ts
...rm/extensionManagement/common/multiExtensionManagement.ts
+3
-3
src/vs/workbench/parts/extensions/electron-browser/extensionsList.ts
...bench/parts/extensions/electron-browser/extensionsList.ts
+1
-1
src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts
...ch/parts/extensions/electron-browser/extensionsViewlet.ts
+3
-3
src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts
...bench/parts/extensions/node/extensionsWorkbenchService.ts
+1
-1
src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts
...xtensions/test/electron-browser/extensionsActions.test.ts
+2
-2
src/vs/workbench/services/extensions/node/extensionManagementServerService.ts
...vices/extensions/node/extensionManagementServerService.ts
+9
-6
未找到文件。
src/vs/platform/extensionManagement/common/extensionManagement.ts
浏览文件 @
2d735515
...
...
@@ -13,7 +13,6 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
import
{
ILocalization
}
from
'
vs/platform/localizations/common/localizations
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
IWorkspaceFolder
,
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
export
const
EXTENSION_IDENTIFIER_PATTERN
=
'
^([a-z0-9A-Z][a-z0-9
\
-A-Z]*)
\\
.([a-z0-9A-Z][a-z0-9
\
-A-Z]*)$
'
;
export
const
EXTENSION_IDENTIFIER_REGEX
=
new
RegExp
(
EXTENSION_IDENTIFIER_PATTERN
);
...
...
@@ -318,17 +317,17 @@ export interface IExtensionManagementService {
}
export
const
IExtensionManagementServerService
=
createDecorator
<
IExtensionManagementServerService
>
(
'
extensionManagementServerService
'
);
export
const
localExtensionManagementServerLocation
:
URI
=
URI
.
from
({
scheme
:
Schemas
.
file
});
export
interface
IExtensionManagementServer
{
extensionManagementService
:
IExtensionManagementService
;
location
:
URI
;
authority
:
string
;
label
:
string
;
}
export
interface
IExtensionManagementServerService
{
_serviceBrand
:
any
;
readonly
extensionManagementServers
:
IExtensionManagementServer
[];
get
Default
ExtensionManagementServer
():
IExtensionManagementServer
;
get
Local
ExtensionManagementServer
():
IExtensionManagementServer
;
getExtensionManagementServer
(
location
:
URI
):
IExtensionManagementServer
;
}
...
...
src/vs/platform/extensionManagement/common/multiExtensionManagement.ts
浏览文件 @
2d735515
...
...
@@ -7,7 +7,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
Event
,
EventMultiplexer
}
from
'
vs/base/common/event
'
;
import
{
IExtensionManagementService
,
ILocalExtension
,
IGalleryExtension
,
LocalExtensionType
,
InstallExtensionEvent
,
DidInstallExtensionEvent
,
IExtensionIdentifier
,
DidUninstallExtensionEvent
,
IReportedExtension
,
IGalleryMetadata
,
IExtensionManagementServerService
,
IExtensionManagementServer
,
localExtensionManagementServerLocation
IExtensionManagementServerService
,
IExtensionManagementServer
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
flatten
}
from
'
vs/base/common/arrays
'
;
...
...
@@ -50,7 +50,7 @@ export class MulitExtensionManagementService implements IExtensionManagementServ
}
install
(
zipPath
:
string
):
TPromise
<
void
>
{
return
this
.
extensionManagementServerService
.
get
ExtensionManagementServer
(
localExtensionManagementServerLocation
).
extensionManagementService
.
install
(
zipPath
);
return
this
.
extensionManagementServerService
.
get
LocalExtensionManagementServer
(
).
extensionManagementService
.
install
(
zipPath
);
}
installFromGallery
(
extension
:
IGalleryExtension
):
TPromise
<
void
>
{
...
...
@@ -58,7 +58,7 @@ export class MulitExtensionManagementService implements IExtensionManagementServ
}
getExtensionsReport
():
TPromise
<
IReportedExtension
[]
>
{
return
this
.
extensionManagementServerService
.
get
ExtensionManagementServer
(
localExtensionManagementServerLocation
).
extensionManagementService
.
getExtensionsReport
();
return
this
.
extensionManagementServerService
.
get
LocalExtensionManagementServer
(
).
extensionManagementService
.
getExtensionsReport
();
}
private
getServer
(
extension
:
ILocalExtension
):
IExtensionManagementServer
{
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionsList.ts
浏览文件 @
2d735515
...
...
@@ -148,7 +148,7 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
this
.
extensionService
.
getExtensions
().
then
(
runningExtensions
=>
{
if
(
installed
&&
installed
.
local
)
{
const
installedExtensionServer
=
this
.
extensionManagementServerService
.
getExtensionManagementServer
(
installed
.
local
.
location
);
const
isSameExtensionRunning
=
runningExtensions
.
some
(
e
=>
areSameExtensions
(
e
,
extension
)
&&
installedExtensionServer
.
location
.
toString
()
===
this
.
extensionManagementServerService
.
getExtensionManagementServer
(
e
.
extensionLocation
).
location
.
toString
()
);
const
isSameExtensionRunning
=
runningExtensions
.
some
(
e
=>
areSameExtensions
(
e
,
extension
)
&&
installedExtensionServer
.
authority
===
this
.
extensionManagementServerService
.
getExtensionManagementServer
(
e
.
extensionLocation
).
authority
);
toggleClass
(
data
.
root
,
'
disabled
'
,
!
isSameExtensionRunning
);
}
else
{
removeClass
(
data
.
root
,
'
disabled
'
);
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts
浏览文件 @
2d735515
...
...
@@ -152,8 +152,8 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
private
createExtensionsViewDescriptorsForServer
(
server
:
IExtensionManagementServer
):
IViewDescriptor
[]
{
return
[{
id
:
`server.extensionsList.
${
server
.
location
.
toString
()
}
`
,
name
:
server
.
l
ocation
.
authority
,
id
:
`server.extensionsList.
${
server
.
authority
}
`
,
name
:
server
.
l
abel
,
container
:
VIEW_CONTAINER
,
ctor
:
GroupByServerExtensionsView
,
when
:
ContextKeyExpr
.
has
(
'
groupByServersContext
'
),
...
...
@@ -449,7 +449,7 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio
protected
createView
(
viewDescriptor
:
IViewDescriptor
,
options
:
IViewletViewOptions
):
ViewletPanel
{
for
(
const
extensionManagementServer
of
this
.
extensionManagementServerService
.
extensionManagementServers
)
{
if
(
viewDescriptor
.
id
===
`server.extensionsList.
${
extensionManagementServer
.
location
.
toString
()
}
`
)
{
if
(
viewDescriptor
.
id
===
`server.extensionsList.
${
extensionManagementServer
.
authority
}
`
)
{
const
servicesCollection
:
ServiceCollection
=
new
ServiceCollection
();
servicesCollection
.
set
(
IExtensionManagementServerService
,
new
SingleServerExtensionManagementServerService
(
extensionManagementServer
));
servicesCollection
.
set
(
IExtensionManagementService
,
extensionManagementServer
.
extensionManagementService
);
...
...
src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts
浏览文件 @
2d735515
...
...
@@ -921,7 +921,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
const
installed
=
this
.
installed
.
filter
(
e
=>
e
.
id
===
extension
.
id
)[
0
];
if
(
installed
)
{
const
server
=
this
.
extensionManagementServerService
.
getExtensionManagementServer
(
local
.
location
);
const
existingLocal
=
installed
.
locals
.
filter
(
l
=>
this
.
extensionManagementServerService
.
getExtensionManagementServer
(
l
.
location
).
location
.
toString
()
===
server
.
location
.
toString
()
)[
0
];
const
existingLocal
=
installed
.
locals
.
filter
(
l
=>
this
.
extensionManagementServerService
.
getExtensionManagementServer
(
l
.
location
).
authority
===
server
.
authority
)[
0
];
if
(
existingLocal
)
{
const
locals
=
[...
installed
.
locals
];
locals
.
splice
(
installed
.
locals
.
indexOf
(
existingLocal
),
1
,
local
);
...
...
src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts
浏览文件 @
2d735515
...
...
@@ -14,7 +14,7 @@ import * as ExtensionsActions from 'vs/workbench/parts/extensions/electron-brows
import
{
ExtensionsWorkbenchService
}
from
'
vs/workbench/parts/extensions/node/extensionsWorkbenchService
'
;
import
{
IExtensionManagementService
,
IExtensionGalleryService
,
IExtensionEnablementService
,
IExtensionTipsService
,
ILocalExtension
,
LocalExtensionType
,
IGalleryExtension
,
DidInstallExtensionEvent
,
DidUninstallExtensionEvent
,
InstallExtensionEvent
,
IExtensionIdentifier
,
EnablementState
,
InstallOperation
,
IExtensionManagementServerService
,
IExtensionManagementServer
,
localExtensionManagementServerLocation
DidInstallExtensionEvent
,
DidUninstallExtensionEvent
,
InstallExtensionEvent
,
IExtensionIdentifier
,
EnablementState
,
InstallOperation
,
IExtensionManagementServerService
,
IExtensionManagementServer
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
getGalleryExtensionId
,
getGalleryExtensionIdFromLocal
}
from
'
vs/platform/extensionManagement/common/extensionManagementUtil
'
;
import
{
ExtensionManagementService
,
getLocalExtensionIdFromGallery
,
getLocalExtensionIdFromManifest
}
from
'
vs/platform/extensionManagement/node/extensionManagementService
'
;
...
...
@@ -71,7 +71,7 @@ suite('ExtensionsActions Test', () => {
instantiationService
.
stub
(
IExtensionManagementService
,
'
onUninstallExtension
'
,
uninstallEvent
.
event
);
instantiationService
.
stub
(
IExtensionManagementService
,
'
onDidUninstallExtension
'
,
didUninstallEvent
.
event
);
instantiationService
.
stub
(
IExtensionManagementServerService
,
instantiationService
.
createInstance
(
SingleServerExtensionManagementServerService
,
<
IExtensionManagementServer
>
{
location
:
localExtensionManagementServerLocation
,
extensionManagementService
:
instantiationService
.
get
(
IExtensionManagementService
)
}));
instantiationService
.
stub
(
IExtensionManagementServerService
,
instantiationService
.
createInstance
(
SingleServerExtensionManagementServerService
,
<
IExtensionManagementServer
>
{
authority
:
'
vscode-local
'
,
extensionManagementService
:
instantiationService
.
get
(
IExtensionManagementService
),
label
:
'
local
'
}));
instantiationService
.
stub
(
IExtensionEnablementService
,
new
TestExtensionEnablementService
(
instantiationService
));
...
...
src/vs/workbench/services/extensions/node/extensionManagementServerService.ts
浏览文件 @
2d735515
...
...
@@ -3,9 +3,12 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
IExtensionManagementService
,
IExtensionManagementServerService
,
IExtensionManagementServer
,
localExtensionManagementServerLocation
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
IExtensionManagementService
,
IExtensionManagementServerService
,
IExtensionManagementServer
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
localize
}
from
'
vs/nls
'
;
const
localExtensionManagementServerAuthority
:
string
=
'
vscode-local
'
;
export
class
ExtensionManagementServerService
implements
IExtensionManagementServerService
{
...
...
@@ -16,14 +19,14 @@ export class ExtensionManagementServerService implements IExtensionManagementSer
constructor
(
localExtensionManagementService
:
IExtensionManagementService
)
{
this
.
extensionManagementServers
=
[{
extensionManagementService
:
localExtensionManagementService
,
location
:
localExtensionManagementServerLocation
}];
this
.
extensionManagementServers
=
[{
extensionManagementService
:
localExtensionManagementService
,
authority
:
localExtensionManagementServerAuthority
,
label
:
localize
(
'
local
'
,
"
Local
"
)
}];
}
getExtensionManagementServer
(
location
:
URI
):
IExtensionManagementServer
{
return
this
.
extensionManagementServers
[
0
];
}
get
Default
ExtensionManagementServer
():
IExtensionManagementServer
{
get
Local
ExtensionManagementServer
():
IExtensionManagementServer
{
return
this
.
extensionManagementServers
[
0
];
}
}
...
...
@@ -41,11 +44,11 @@ export class SingleServerExtensionManagementServerService implements IExtensionM
}
getExtensionManagementServer
(
location
:
URI
):
IExtensionManagementServer
{
location
=
location
.
scheme
===
Schemas
.
file
?
URI
.
from
({
scheme
:
Schemas
.
file
})
:
location
;
return
this
.
extensionManagementServers
.
filter
(
server
=>
location
.
authority
===
server
.
location
.
authority
)[
0
];
const
authority
=
location
.
scheme
===
Schemas
.
file
?
localExtensionManagementServerAuthority
:
location
.
authority
;
return
this
.
extensionManagementServers
.
filter
(
server
=>
authority
===
server
.
authority
)[
0
];
}
get
Default
ExtensionManagementServer
():
IExtensionManagementServer
{
get
Local
ExtensionManagementServer
():
IExtensionManagementServer
{
return
this
.
extensionManagementServers
[
0
];
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录