Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
826cace1
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,发现更多精彩内容 >>
提交
826cace1
编写于
3月 18, 2016
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove extension assistant, fixes #4403
上级
dd52cb34
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
125 deletion
+0
-125
src/vs/workbench/parts/extensions/electron-browser/extensionsAssistant.ts
.../parts/extensions/electron-browser/extensionsAssistant.ts
+0
-123
src/vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchExtension.ts
...tensions/electron-browser/extensionsWorkbenchExtension.ts
+0
-2
未找到文件。
src/vs/workbench/parts/extensions/electron-browser/extensionsAssistant.ts
已删除
100644 → 0
浏览文件 @
dd52cb34
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
nls
=
require
(
'
vs/nls
'
);
import
Severity
from
'
vs/base/common/severity
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
{
forEach
}
from
'
vs/base/common/collections
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
IInstantiationService
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
InstallAction
}
from
'
vs/workbench/parts/extensions/electron-browser/extensionsActions
'
;
import
{
IExtensionsService
,
IGalleryService
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
EventType
,
EditorEvent
}
from
'
vs/workbench/common/events
'
;
import
{
getUntitledOrFileResource
}
from
'
vs/workbench/common/editor
'
;
import
{
IDebugService
,
ServiceEvents
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
match
}
from
'
vs/base/common/glob
'
;
// --- check for extensions we don't bundle by default anymore but the user might expect
interface
LegacyExtensionChecker
{
(
accessor
:
ServicesAccessor
,
callback
:
Function
):
any
;
}
function
omnisharpChecker
(
accessor
,
callback
)
{
const
subscription
=
accessor
.
get
(
IEventService
).
addListener2
(
EventType
.
EDITOR_INPUT_CHANGED
,
(
e
:
EditorEvent
)
=>
{
if
(
!
e
.
editor
||
!
e
.
editor
.
input
)
{
return
;
}
const
uri
=
getUntitledOrFileResource
(
e
.
editor
.
input
);
if
(
!
uri
)
{
return
;
}
if
(
match
(
'
{**/*.cs,**/project.json,**/global.json,**/*.csproj,**/*.sln}
'
,
uri
.
fsPath
))
{
subscription
.
dispose
();
callback
();
}
});
}
function
monoDebugChecker
(
accessor
,
callback
)
{
const
debugService
=
(
<
IDebugService
>
accessor
.
get
(
IDebugService
));
const
subscription
=
debugService
.
addListener2
(
ServiceEvents
.
TYPE_NOT_SUPPORTED
,
(
type
:
string
)
=>
{
// mono debugging is not supported on windows, so do not offer an extension install if on windows
if
(
type
===
'
mono
'
&&
!
platform
.
isWindows
)
{
subscription
.
dispose
();
callback
();
}
});
}
const
extensionChecker
:
{
[
id
:
string
]:
LegacyExtensionChecker
}
=
Object
.
create
(
null
);
extensionChecker
[
'
ms-vscode.csharp
'
]
=
omnisharpChecker
;
extensionChecker
[
'
ms-vscode.mono-debug
'
]
=
monoDebugChecker
;
export
function
checkForLegacyExtensionNeeds
(
accessor
:
ServicesAccessor
):
void
{
const
instantiationService
=
accessor
.
get
(
IInstantiationService
);
const
extensionService
=
accessor
.
get
(
IExtensionsService
);
const
storageService
=
accessor
.
get
(
IStorageService
);
const
messageService
=
accessor
.
get
(
IMessageService
);
const
availableExtensions
=
accessor
.
get
(
IGalleryService
).
query
();
extensionService
.
getInstalled
().
then
(
extensions
=>
{
// in case of manual installation
for
(
let
ext
of
extensions
)
{
delete
extensionChecker
[
`
${
ext
.
publisher
}
.
${
ext
.
name
}
`
];
}
forEach
(
extensionChecker
,
entry
=>
{
// check if we asked already once
const
key
=
`extensionsAssistant/legacy/
${
entry
.
key
}
`
;
const
value
=
storageService
.
get
(
key
,
StorageScope
.
GLOBAL
);
if
(
value
)
{
return
;
}
instantiationService
.
invokeFunction
(
entry
.
value
,
()
=>
{
availableExtensions
.
then
(
extensions
=>
{
for
(
let
ext
of
extensions
)
{
if
(
`
${
ext
.
publisher
}
.
${
ext
.
name
}
`
===
entry
.
key
)
{
return
ext
;
}
}
}).
then
(
extension
=>
{
if
(
!
extension
)
{
return
;
}
let
message
=
nls
.
localize
(
'
hint
'
,
"
'{0}' is now an extension. Would you like to install it?
"
,
extension
.
displayName
);
let
actions
=
[
new
Action
(
'
ext.later
'
,
nls
.
localize
(
'
later
'
,
"
Later
"
),
undefined
,
true
,
()
=>
TPromise
.
as
(
true
)),
new
Action
(
'
ext.no
'
,
nls
.
localize
(
'
no
'
,
"
No
"
),
undefined
,
true
,
()
=>
{
storageService
.
store
(
key
,
'
OK
'
,
StorageScope
.
GLOBAL
);
return
TPromise
.
as
(
true
);
}),
new
Action
(
'
ext.install
'
,
nls
.
localize
(
'
yes
'
,
"
Yes
"
),
undefined
,
undefined
,
()
=>
{
let
actualInstall
=
instantiationService
.
createInstance
(
InstallAction
,
nls
.
localize
(
'
yes
'
,
"
Yes
"
));
actualInstall
.
run
(
extension
);
return
TPromise
.
as
(
true
).
then
(()
=>
{
messageService
.
hideAll
();
messageService
.
show
(
Severity
.
Info
,
nls
.
localize
(
'
extensionsInstalled
'
,
"
Extension '{0}' is being installed...
"
,
extension
.
displayName
));
});
})
];
// inform user and remember
messageService
.
show
(
Severity
.
Info
,
{
message
,
actions
});
},
onUnexpectedError
);
});
});
});
}
src/vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchExtension.ts
浏览文件 @
826cace1
...
...
@@ -19,7 +19,6 @@ import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import
{
ListExtensionsAction
,
InstallExtensionAction
,
ListOutdatedExtensionsAction
,
ListSuggestedExtensionsAction
}
from
'
./extensionsActions
'
;
import
{
ExtensionTipsService
}
from
'
./extensionTipsService
'
;
import
{
IQuickOpenRegistry
,
Extensions
,
QuickOpenHandlerDescriptor
}
from
'
vs/workbench/browser/quickopen
'
;
import
{
checkForLegacyExtensionNeeds
}
from
'
./extensionsAssistant
'
;
import
{
ipcRenderer
as
ipc
}
from
'
electron
'
;
interface
IInstallExtensionsRequest
{
...
...
@@ -59,7 +58,6 @@ export class ExtensionsWorkbenchExtension implements IWorkbenchContribution {
);
if
(
galleryService
.
isEnabled
())
{
this
.
instantiationService
.
invokeFunction
(
checkForLegacyExtensionNeeds
);
actionRegistry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
InstallExtensionAction
,
InstallExtensionAction
.
ID
,
InstallExtensionAction
.
LABEL
),
ExtensionsLabel
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录