Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7b37dbd6
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,发现更多精彩内容 >>
提交
7b37dbd6
编写于
11月 14, 2016
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#15361 Separate extension settings and recommendations
上级
a8f02202
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
60 addition
and
50 deletion
+60
-50
src/vs/platform/extensionManagement/common/extensionManagement.ts
...latform/extensionManagement/common/extensionManagement.ts
+1
-1
src/vs/workbench/parts/extensions/browser/extensionTipsService.ts
...orkbench/parts/extensions/browser/extensionTipsService.ts
+46
-35
src/vs/workbench/parts/extensions/browser/extensionsActions.ts
...s/workbench/parts/extensions/browser/extensionsActions.ts
+2
-2
src/vs/workbench/parts/extensions/common/extensions.ts
src/vs/workbench/parts/extensions/common/extensions.ts
+0
-1
src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts
...ch/parts/extensions/electron-browser/extensionsViewlet.ts
+10
-9
src/vs/workbench/services/configuration/common/configuration.ts
.../workbench/services/configuration/common/configuration.ts
+1
-2
未找到文件。
src/vs/platform/extensionManagement/common/extensionManagement.ts
浏览文件 @
7b37dbd6
...
...
@@ -285,7 +285,7 @@ export const IExtensionTipsService = createDecorator<IExtensionTipsService>('ext
export
interface
IExtensionTipsService
{
_serviceBrand
:
any
;
getRecommendations
():
string
[];
getWorkspaceRecommendations
():
string
[]
;
getWorkspaceRecommendations
():
TPromise
<
string
[]
>
;
}
export
const
ExtensionsLabel
=
localize
(
'
extensions
'
,
"
Extensions
"
);
...
...
src/vs/workbench/parts/extensions/browser/extensionTipsService.ts
浏览文件 @
7b37dbd6
...
...
@@ -4,11 +4,13 @@
*--------------------------------------------------------------------------------------------*/
import
{
localize
}
from
'
vs/nls
'
;
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
forEach
}
from
'
vs/base/common/collections
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
match
}
from
'
vs/base/common/glob
'
;
import
*
as
json
from
'
vs/base/common/json
'
;
import
{
IExtensionManagementService
,
IExtensionGalleryService
,
IExtensionTipsService
,
LocalExtensionType
,
EXTENSION_IDENTIFIER_PATTERN
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
IExtensionsConfiguration
,
ConfigurationKey
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
...
...
@@ -17,8 +19,13 @@ import { IChoiceService } from 'vs/platform/message/common/message';
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ShowRecommendedExtensionsAction
,
ShowWorkspaceRecommendedExtensionsAction
}
from
'
vs/workbench/parts/extensions/browser/extensionsActions
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
I
ConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
I
WorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
interface
IExtensionsContent
{
recommendations
:
string
[];
}
export
class
ExtensionTipsService
implements
IExtensionTipsService
{
...
...
@@ -37,7 +44,8 @@ export class ExtensionTipsService implements IExtensionTipsService {
@
IChoiceService
private
choiceService
:
IChoiceService
,
@
IExtensionManagementService
private
extensionsService
:
IExtensionManagementService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
@
IFileService
private
fileService
:
IFileService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
)
{
if
(
!
this
.
_galleryService
.
isEnabled
())
{
return
;
...
...
@@ -47,15 +55,17 @@ export class ExtensionTipsService implements IExtensionTipsService {
this
.
_suggestWorkspaceRecommendations
();
}
getWorkspaceRecommendations
():
string
[]
{
const
configuration
=
this
.
configurationService
.
getConfiguration
<
IExtensionsConfiguration
>
(
ConfigurationKey
);
if
(
configuration
.
recommendations
)
{
getWorkspaceRecommendations
():
TPromise
<
string
[]
>
{
return
this
.
fileService
.
resolveContent
(
this
.
contextService
.
toResource
(
paths
.
join
(
'
.vscode
'
,
'
extensions.json
'
))).
then
(
content
=>
{
const
extensionsContent
=
<
IExtensionsContent
>
json
.
parse
(
content
.
value
,
[]);
if
(
extensionsContent
.
recommendations
)
{
const
regEx
=
new
RegExp
(
EXTENSION_IDENTIFIER_PATTERN
);
return
configuration
.
recommendations
.
filter
((
element
,
position
)
=>
{
return
configuration
.
recommendations
.
indexOf
(
element
)
===
position
&&
regEx
.
test
(
element
);
return
extensionsContent
.
recommendations
.
filter
((
element
,
position
)
=>
{
return
extensionsContent
.
recommendations
.
indexOf
(
element
)
===
position
&&
regEx
.
test
(
element
);
});
}
return
configuration
.
recommendations
||
[];
return
[];
},
err
=>
[]);
}
getRecommendations
():
string
[]
{
...
...
@@ -166,8 +176,7 @@ export class ExtensionTipsService implements IExtensionTipsService {
return
;
}
const
allRecommendations
=
this
.
getWorkspaceRecommendations
();
this
.
getWorkspaceRecommendations
().
done
(
allRecommendations
=>
{
if
(
!
allRecommendations
.
length
)
{
return
;
}
...
...
@@ -196,6 +205,8 @@ export class ExtensionTipsService implements IExtensionTipsService {
}
});
});
});
}
dispose
()
{
...
...
src/vs/workbench/parts/extensions/browser/extensionsActions.ts
浏览文件 @
7b37dbd6
...
...
@@ -15,7 +15,7 @@ import Event from 'vs/base/common/event';
import
{
ActionItem
,
IActionItem
,
Separator
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IExtension
,
ExtensionState
,
IExtensionsWorkbenchService
,
VIEWLET_ID
,
IExtensionsViewlet
,
ConfigurationKey
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
IExtension
,
ExtensionState
,
IExtensionsWorkbenchService
,
VIEWLET_ID
,
IExtensionsViewlet
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
ExtensionsConfigurationInitialContent
}
from
'
vs/workbench/parts/extensions/common/extensionsFileTemplate
'
;
import
{
LocalExtensionType
,
IExtensionEnablementService
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -1092,7 +1092,7 @@ export class ConfigureWorkspaceRecommendedExtensionsAction extends Action {
}
private
getOrCreateExtensionsFile
():
TPromise
<
{
created
:
boolean
,
extensionsFileResource
:
URI
}
>
{
const
extensionsFileResource
=
URI
.
file
(
paths
.
join
(
this
.
contextService
.
getWorkspace
().
resource
.
fsPath
,
'
.vscode
'
,
`
${
ConfigurationKey
}
.json`
));
const
extensionsFileResource
=
URI
.
file
(
paths
.
join
(
this
.
contextService
.
getWorkspace
().
resource
.
fsPath
,
'
.vscode
'
,
'
extensions.json
'
));
return
this
.
fileService
.
resolveContent
(
extensionsFileResource
).
then
(
content
=>
{
return
{
created
:
false
,
extensionsFileResource
};
...
...
src/vs/workbench/parts/extensions/common/extensions.ts
浏览文件 @
7b37dbd6
...
...
@@ -81,5 +81,4 @@ export const ConfigurationKey = 'extensions';
export
interface
IExtensionsConfiguration
{
autoUpdate
:
boolean
;
recommendations
:
string
[];
}
\ No newline at end of file
src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts
浏览文件 @
7b37dbd6
...
...
@@ -302,9 +302,9 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet {
private
getWorkspaceRecommendationsModel
(
query
:
Query
,
options
:
IQueryOptions
):
TPromise
<
IPagedModel
<
IExtension
>>
{
const
value
=
query
.
value
.
replace
(
/@recommended:workspace/g
,
''
).
trim
().
toLowerCase
();
const
names
=
this
.
tipsService
.
getWorkspaceRecommendations
()
.
filter
(
name
=>
name
.
toLowerCase
().
indexOf
(
value
)
>
-
1
);
return
this
.
tipsService
.
getWorkspaceRecommendations
()
.
then
(
recommendations
=>
{
const
names
=
recommendations
.
filter
(
name
=>
name
.
toLowerCase
().
indexOf
(
value
)
>
-
1
);
this
.
telemetryService
.
publicLog
(
'
extensionWorkspaceRecommendations:open
'
,
{
count
:
names
.
length
});
if
(
!
names
.
length
)
{
...
...
@@ -313,6 +313,7 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet {
return
this
.
extensionsWorkbenchService
.
queryGallery
(
assign
(
options
,
{
names
,
pageSize
:
names
.
length
}))
.
then
(
result
=>
new
PagedModel
(
result
));
});
}
private
openExtension
(
extension
:
IExtension
):
void
{
...
...
src/vs/workbench/services/configuration/common/configuration.ts
浏览文件 @
7b37dbd6
...
...
@@ -40,8 +40,7 @@ export interface IWorkspaceConfigurationKeys extends IConfigurationKeys {
export
const
WORKSPACE_STANDALONE_CONFIGURATIONS
=
{
'
tasks
'
:
`
${
WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME
}
/tasks.json`
,
'
launch
'
:
`
${
WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME
}
/launch.json`
,
'
extensions
'
:
`
${
WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME
}
/extensions.json`
'
launch
'
:
`
${
WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME
}
/launch.json`
};
export
interface
WorkspaceConfigurationNode
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录