Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b3f39bf7
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 搜索 >>
提交
b3f39bf7
编写于
9月 15, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove extensionsWorkbenchExtension!
上级
9dea7369
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
17 addition
and
123 deletion
+17
-123
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+0
-6
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+9
-22
src/vs/code/node/sharedProcessMain.ts
src/vs/code/node/sharedProcessMain.ts
+4
-2
src/vs/platform/environment/node/argv.ts
src/vs/platform/environment/node/argv.ts
+3
-9
src/vs/workbench/common/options.ts
src/vs/workbench/common/options.ts
+0
-5
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+1
-4
src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts
...ts/extensions/electron-browser/extensions.contribution.ts
+0
-5
src/vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchExtension.ts
...tensions/electron-browser/extensionsWorkbenchExtension.ts
+0
-70
未找到文件。
src/vs/code/electron-main/window.ts
浏览文件 @
b3f39bf7
...
...
@@ -84,9 +84,6 @@ export interface IPath {
// indicator to create the file path in the VSCode instance
createFilePath
?:
boolean
;
// indicator to install the extension (path to .vsix) in the VSCode instance
installExtensionPath
?:
boolean
;
}
export
interface
IWindowConfiguration
extends
ICommandLineArguments
{
...
...
@@ -102,8 +99,6 @@ export interface IWindowConfiguration extends ICommandLineArguments {
filesToOpen
?:
IPath
[];
filesToCreate
?:
IPath
[];
filesToDiff
?:
IPath
[];
extensionsToInstall
:
string
[];
}
export
interface
IWindowSettings
{
...
...
@@ -388,7 +383,6 @@ export class VSCodeWindow {
delete
configuration
.
filesToOpen
;
delete
configuration
.
filesToCreate
;
delete
configuration
.
filesToDiff
;
delete
configuration
.
extensionsToInstall
;
// Some configuration things get inherited if the window is being reloaded and we are
// in plugin development mode. These options are all development related.
...
...
src/vs/code/electron-main/windows.ts
浏览文件 @
b3f39bf7
...
...
@@ -576,13 +576,12 @@ export class WindowsManager implements IWindowsService {
let
filesToOpen
:
IPath
[]
=
[];
let
filesToDiff
:
IPath
[]
=
[];
let
foldersToOpen
=
iPathsToOpen
.
filter
(
iPath
=>
iPath
.
workspacePath
&&
!
iPath
.
filePath
&&
!
iPath
.
installExtensionPath
);
let
emptyToOpen
=
iPathsToOpen
.
filter
(
iPath
=>
!
iPath
.
workspacePath
&&
!
iPath
.
filePath
&&
!
iPath
.
installExtensionPath
);
let
extensionsToInstall
=
iPathsToOpen
.
filter
(
iPath
=>
iPath
.
installExtensionPath
).
map
(
ipath
=>
ipath
.
filePath
);
let
filesToCreate
=
iPathsToOpen
.
filter
(
iPath
=>
!!
iPath
.
filePath
&&
iPath
.
createFilePath
&&
!
iPath
.
installExtensionPath
);
let
foldersToOpen
=
iPathsToOpen
.
filter
(
iPath
=>
iPath
.
workspacePath
&&
!
iPath
.
filePath
);
let
emptyToOpen
=
iPathsToOpen
.
filter
(
iPath
=>
!
iPath
.
workspacePath
&&
!
iPath
.
filePath
);
let
filesToCreate
=
iPathsToOpen
.
filter
(
iPath
=>
!!
iPath
.
filePath
&&
iPath
.
createFilePath
);
// Diff mode needs special care
const
candidates
=
iPathsToOpen
.
filter
(
iPath
=>
!!
iPath
.
filePath
&&
!
iPath
.
createFilePath
&&
!
iPath
.
installExtensionPath
);
const
candidates
=
iPathsToOpen
.
filter
(
iPath
=>
!!
iPath
.
filePath
&&
!
iPath
.
createFilePath
);
if
(
openConfig
.
diffMode
)
{
if
(
candidates
.
length
===
2
)
{
filesToDiff
=
candidates
;
...
...
@@ -599,7 +598,7 @@ export class WindowsManager implements IWindowsService {
let
configuration
:
IWindowConfiguration
;
// Handle files to open/diff or to create when we dont open a folder
if
(
!
foldersToOpen
.
length
&&
(
filesToOpen
.
length
>
0
||
filesToCreate
.
length
>
0
||
filesToDiff
.
length
>
0
||
extensionsToInstall
.
length
>
0
))
{
if
(
!
foldersToOpen
.
length
&&
(
filesToOpen
.
length
>
0
||
filesToCreate
.
length
>
0
||
filesToDiff
.
length
>
0
))
{
// const the user settings override how files are open in a new window or same window unless we are forced
let
openFilesInNewWindow
:
boolean
;
...
...
@@ -621,10 +620,6 @@ export class WindowsManager implements IWindowsService {
lastActiveWindow
.
focus
();
lastActiveWindow
.
ready
().
then
(
readyWindow
=>
{
readyWindow
.
send
(
'
vscode:openFiles
'
,
{
filesToOpen
,
filesToCreate
,
filesToDiff
});
if
(
extensionsToInstall
.
length
)
{
readyWindow
.
send
(
'
vscode:installExtensions
'
,
{
extensionsToInstall
});
}
});
usedWindows
.
push
(
lastActiveWindow
);
...
...
@@ -632,7 +627,7 @@ export class WindowsManager implements IWindowsService {
// Otherwise open instance with files
else
{
configuration
=
this
.
toConfiguration
(
this
.
getWindowUserEnv
(
openConfig
),
openConfig
.
cli
,
null
,
filesToOpen
,
filesToCreate
,
filesToDiff
,
extensionsToInstall
);
configuration
=
this
.
toConfiguration
(
this
.
getWindowUserEnv
(
openConfig
),
openConfig
.
cli
,
null
,
filesToOpen
,
filesToCreate
,
filesToDiff
);
const
browserWindow
=
this
.
openInBrowserWindow
(
configuration
,
true
/* new window */
);
usedWindows
.
push
(
browserWindow
);
...
...
@@ -651,10 +646,6 @@ export class WindowsManager implements IWindowsService {
browserWindow
.
focus
();
// just focus one of them
browserWindow
.
ready
().
then
(
readyWindow
=>
{
readyWindow
.
send
(
'
vscode:openFiles
'
,
{
filesToOpen
,
filesToCreate
,
filesToDiff
});
if
(
extensionsToInstall
.
length
)
{
readyWindow
.
send
(
'
vscode:installExtensions
'
,
{
extensionsToInstall
});
}
});
usedWindows
.
push
(
browserWindow
);
...
...
@@ -663,7 +654,6 @@ export class WindowsManager implements IWindowsService {
filesToOpen
=
[];
filesToCreate
=
[];
filesToDiff
=
[];
extensionsToInstall
=
[];
openInNewWindow
=
true
;
// any other folders to open must open in new window then
}
...
...
@@ -674,7 +664,7 @@ export class WindowsManager implements IWindowsService {
return
;
// ignore folders that are already open
}
configuration
=
this
.
toConfiguration
(
this
.
getWindowUserEnv
(
openConfig
),
openConfig
.
cli
,
folderToOpen
.
workspacePath
,
filesToOpen
,
filesToCreate
,
filesToDiff
,
extensionsToInstall
);
configuration
=
this
.
toConfiguration
(
this
.
getWindowUserEnv
(
openConfig
),
openConfig
.
cli
,
folderToOpen
.
workspacePath
,
filesToOpen
,
filesToCreate
,
filesToDiff
);
const
browserWindow
=
this
.
openInBrowserWindow
(
configuration
,
openInNewWindow
,
openInNewWindow
?
void
0
:
openConfig
.
windowToUse
);
usedWindows
.
push
(
browserWindow
);
...
...
@@ -682,7 +672,6 @@ export class WindowsManager implements IWindowsService {
filesToOpen
=
[];
filesToCreate
=
[];
filesToDiff
=
[];
extensionsToInstall
=
[];
openInNewWindow
=
true
;
// any other folders to open must open in new window then
});
...
...
@@ -826,7 +815,7 @@ export class WindowsManager implements IWindowsService {
this
.
open
({
cli
:
openConfig
.
cli
,
forceNewWindow
:
true
,
forceEmpty
:
openConfig
.
cli
.
paths
.
length
===
0
});
}
private
toConfiguration
(
userEnv
:
IProcessEnvironment
,
cli
:
ICommandLineArguments
,
workspacePath
?:
string
,
filesToOpen
?:
IPath
[],
filesToCreate
?:
IPath
[],
filesToDiff
?:
IPath
[]
,
extensionsToInstall
?:
string
[]
):
IWindowConfiguration
{
private
toConfiguration
(
userEnv
:
IProcessEnvironment
,
cli
:
ICommandLineArguments
,
workspacePath
?:
string
,
filesToOpen
?:
IPath
[],
filesToCreate
?:
IPath
[],
filesToDiff
?:
IPath
[]):
IWindowConfiguration
{
const
configuration
:
IWindowConfiguration
=
mixin
({},
cli
);
// inherit all properties from CLI
configuration
.
appRoot
=
this
.
envService
.
appRoot
;
configuration
.
execPath
=
process
.
execPath
;
...
...
@@ -835,7 +824,6 @@ export class WindowsManager implements IWindowsService {
configuration
.
filesToOpen
=
filesToOpen
;
configuration
.
filesToCreate
=
filesToCreate
;
configuration
.
filesToDiff
=
filesToDiff
;
configuration
.
extensionsToInstall
=
extensionsToInstall
;
return
configuration
;
}
...
...
@@ -859,8 +847,7 @@ export class WindowsManager implements IWindowsService {
{
filePath
:
candidate
,
lineNumber
:
gotoLineMode
?
parsedPath
.
line
:
void
0
,
columnNumber
:
gotoLineMode
?
parsedPath
.
column
:
void
0
,
installExtensionPath
:
/
\.
vsix$/i
.
test
(
candidate
)
columnNumber
:
gotoLineMode
?
parsedPath
.
column
:
void
0
}
:
{
workspacePath
:
candidate
};
}
...
...
src/vs/code/node/sharedProcessMain.ts
浏览文件 @
b3f39bf7
...
...
@@ -8,6 +8,7 @@ import * as platform from 'vs/base/common/platform';
import
product
from
'
vs/platform/product
'
;
import
pkg
from
'
vs/platform/package
'
;
import
{
serve
,
Server
,
connect
}
from
'
vs/base/parts/ipc/node/ipc.net
'
;
import
{
coalesce
}
from
'
vs/base/common/arrays
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
...
...
@@ -112,8 +113,9 @@ function main(server: Server, initData: ISharedProcessInitData): void {
(
extensionManagementService
as
ExtensionManagementService
).
removeDeprecatedExtensions
();
// install vsix
environmentService
.
args
[
'
install-vsix
'
]
.
forEach
(
vsix
=>
extensionManagementService
.
install
(
vsix
));
const
vsixArg
=
environmentService
.
args
[
'
install-vsix
'
];
const
vsix
=
typeof
vsixArg
===
'
string
'
?
[
vsixArg
]
:
vsixArg
;
coalesce
(
vsix
||
[]).
forEach
(
vsix
=>
extensionManagementService
.
install
(
vsix
));
});
});
}
...
...
src/vs/platform/environment/node/argv.ts
浏览文件 @
b3f39bf7
...
...
@@ -7,7 +7,6 @@ import * as os from 'os';
import
*
as
minimist
from
'
minimist
'
;
import
*
as
assert
from
'
assert
'
;
import
{
firstIndex
}
from
'
vs/base/common/arrays
'
;
import
{
not
}
from
'
vs/base/common/functional
'
;
import
{
localize
}
from
'
vs/nls
'
;
export
interface
ParsedArgs
extends
minimist
.
ParsedArgs
{
...
...
@@ -32,7 +31,7 @@ export interface ParsedArgs extends minimist.ParsedArgs {
'
list-extensions
'
?:
boolean
;
'
install-extension
'
?:
string
|
string
[];
'
uninstall-extension
'
?:
string
|
string
[];
'
install-vsix
'
?:
string
[];
'
install-vsix
'
?:
string
|
string
[];
}
const
options
:
minimist
.
Opts
=
{
...
...
@@ -44,6 +43,7 @@ const options: minimist.Opts = {
'
extensionTestsPath
'
,
'
install-extension
'
,
'
uninstall-extension
'
,
'
install-vsix
'
,
'
debugBrkPluginHost
'
,
'
debugPluginHost
'
],
...
...
@@ -121,13 +121,7 @@ export function parseCLIProcessArgv(processArgv: string[]): ParsedArgs {
* Use this to parse code arguments such as `--verbose --wait`
*/
export
function
parseArgs
(
args
:
string
[]):
ParsedArgs
{
const
result
=
minimist
(
args
,
options
)
as
ParsedArgs
;
const
isVSIX
=
a
=>
/
\.
vsix$/i
.
test
(
a
);
result
[
'
install-vsix
'
]
=
result
.
_
.
filter
(
isVSIX
);
result
.
_
=
result
.
_
.
filter
(
not
(
isVSIX
));
return
result
;
return
minimist
(
args
,
options
)
as
ParsedArgs
;
}
export
const
optionsHelp
:
{
[
name
:
string
]:
string
;
}
=
{
...
...
src/vs/workbench/common/options.ts
浏览文件 @
b3f39bf7
...
...
@@ -22,9 +22,4 @@ export interface IOptions {
* Instructs the workbench to open a diff of the provided files right after startup.
*/
filesToDiff
?:
IResourceInput
[];
/**
* Instructs the workbench to install the extensions from the provided local paths.
*/
extensionsToInstall
?:
string
[];
}
\ No newline at end of file
src/vs/workbench/electron-browser/main.ts
浏览文件 @
b3f39bf7
...
...
@@ -40,8 +40,6 @@ export interface IWindowConfiguration extends ParsedArgs, IOpenFileRequest {
userEnv
:
any
;
/* vs/code/electron-main/env/IProcessEnvironment*/
workspacePath
?:
string
;
extensionsToInstall
?:
string
[];
}
export
function
startup
(
configuration
:
IWindowConfiguration
):
TPromise
<
void
>
{
...
...
@@ -53,8 +51,7 @@ export function startup(configuration: IWindowConfiguration): TPromise<void> {
const
shellOptions
:
IOptions
=
{
filesToOpen
,
filesToCreate
,
filesToDiff
,
extensionsToInstall
:
configuration
.
extensionsToInstall
filesToDiff
};
if
(
configuration
.
performance
)
{
...
...
src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts
浏览文件 @
b3f39bf7
...
...
@@ -14,7 +14,6 @@ import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/ex
import
{
IWorkbenchActionRegistry
,
Extensions
as
WorkbenchActionExtensions
}
from
'
vs/workbench/common/actionRegistry
'
;
import
{
ExtensionTipsService
}
from
'
vs/workbench/parts/extensions/electron-browser/extensionTipsService
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
ExtensionsWorkbenchExtension
}
from
'
vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchExtension
'
;
import
{
IOutputChannelRegistry
,
Extensions
as
OutputExtensions
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
EditorDescriptor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
}
from
'
vs/workbench/common/editor
'
;
...
...
@@ -36,10 +35,6 @@ registerSingleton(IExtensionGalleryService, ExtensionGalleryService);
registerSingleton
(
IExtensionTipsService
,
ExtensionTipsService
);
registerSingleton
(
IExtensionsWorkbenchService
,
ExtensionsWorkbenchService
);
// Workbench contributions
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
)
.
registerWorkbenchContribution
(
ExtensionsWorkbenchExtension
);
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
)
.
registerWorkbenchContribution
(
StatusUpdater
);
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchExtension.ts
已删除
100644 → 0
浏览文件 @
9dea7369
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
IExtensionManagementService
,
IExtensionGalleryService
,
IExtensionTipsService
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
LegacyWorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
ReloadWindowAction
}
from
'
vs/workbench/electron-browser/actions
'
;
import
{
ipcRenderer
as
ipc
}
from
'
electron
'
;
interface
IInstallExtensionsRequest
{
extensionsToInstall
:
string
[];
}
// TODO@Joao retire this beast
export
class
ExtensionsWorkbenchExtension
implements
IWorkbenchContribution
{
constructor
(
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IExtensionManagementService
private
extensionManagementService
:
IExtensionManagementService
,
@
IMessageService
private
messageService
:
IMessageService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IExtensionTipsService
extenstionTips
:
IExtensionTipsService
,
// this is to eagerly start the service
@
IExtensionGalleryService
galleryService
:
IExtensionGalleryService
)
{
this
.
registerListeners
();
const
options
=
(
<
LegacyWorkspaceContextService
>
contextService
).
getOptions
();
if
(
options
.
extensionsToInstall
&&
options
.
extensionsToInstall
.
length
)
{
this
.
install
(
options
.
extensionsToInstall
).
done
(
null
,
onUnexpectedError
);
}
//actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(InstallExtensionAction, InstallExtensionAction.ID, InstallExtensionAction.LABEL), 'Extensions: Install Extension', ExtensionsLabel);
}
private
registerListeners
():
void
{
ipc
.
on
(
'
vscode:installExtensions
'
,
(
event
,
request
:
IInstallExtensionsRequest
)
=>
{
if
(
request
.
extensionsToInstall
)
{
this
.
install
(
request
.
extensionsToInstall
).
done
(
null
,
onUnexpectedError
);
}
});
}
private
install
(
extensions
:
string
[]):
TPromise
<
void
>
{
return
TPromise
.
join
(
extensions
.
map
(
extPath
=>
this
.
extensionManagementService
.
install
(
extPath
)))
.
then
(()
=>
{
this
.
messageService
.
show
(
Severity
.
Info
,
{
message
:
extensions
.
length
>
1
?
localize
(
'
success
'
,
"
Extensions were successfully installed. Restart to enable them.
"
)
:
localize
(
'
successSingle
'
,
"
Extension was successfully installed. Restart to enable it.
"
),
actions
:
[
this
.
instantiationService
.
createInstance
(
ReloadWindowAction
,
ReloadWindowAction
.
ID
,
localize
(
'
reloadNow
'
,
"
Restart Now
"
))]
}
);
});
}
public
getId
():
string
{
return
'
vs.extensions.workbenchextension
'
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录