Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
817a0355
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,发现更多精彩内容 >>
提交
817a0355
编写于
7月 20, 2018
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adopt IWindowInfo to folderURIs
上级
e6c64eff
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
56 addition
and
48 deletion
+56
-48
src/vs/code/electron-main/diagnostics.ts
src/vs/code/electron-main/diagnostics.ts
+48
-35
src/vs/code/electron-main/launch.ts
src/vs/code/electron-main/launch.ts
+8
-13
未找到文件。
src/vs/code/electron-main/diagnostics.ts
浏览文件 @
817a0355
...
...
@@ -16,6 +16,7 @@ import { repeat, pad } from 'vs/base/common/strings';
import
{
isWindows
}
from
'
vs/base/common/platform
'
;
import
{
app
}
from
'
electron
'
;
import
{
basename
}
from
'
path
'
;
import
URI
from
'
vs/base/common/uri
'
;
export
interface
VersionInfo
{
vscodeVersion
:
string
;
...
...
@@ -50,29 +51,35 @@ export function getPerformanceInfo(info: IMainProcessInfo): Promise<PerformanceI
// Workspace Stats
const
workspaceStatPromises
=
[];
if
(
info
.
windows
.
some
(
window
=>
window
.
folder
s
&&
window
.
folder
s
.
length
>
0
))
{
if
(
info
.
windows
.
some
(
window
=>
window
.
folder
URIs
&&
window
.
folderURI
s
.
length
>
0
))
{
info
.
windows
.
forEach
(
window
=>
{
if
(
window
.
folders
.
length
===
0
)
{
if
(
window
.
folder
URI
s
.
length
===
0
)
{
return
;
}
workspaceInfoMessages
.
push
(
`| Window (
${
window
.
title
}
)`
);
window
.
folders
.
forEach
(
folder
=>
{
workspaceStatPromises
.
push
(
collectWorkspaceStats
(
folder
,
[
'
node_modules
'
,
'
.git
'
]).
then
(
async
stats
=>
{
let
countMessage
=
`
${
stats
.
fileCount
}
files`
;
if
(
stats
.
maxFilesReached
)
{
countMessage
=
`more than
${
countMessage
}
`
;
}
workspaceInfoMessages
.
push
(
`| Folder (
${
basename
(
folder
)}
):
${
countMessage
}
`
);
workspaceInfoMessages
.
push
(
formatWorkspaceStats
(
stats
));
const
launchConfigs
=
await
collectLaunchConfigs
(
folder
);
if
(
launchConfigs
.
length
>
0
)
{
workspaceInfoMessages
.
push
(
formatLaunchConfigs
(
launchConfigs
));
}
}));
window
.
folderURIs
.
forEach
(
uriComponents
=>
{
const
folderUri
=
URI
.
revive
(
uriComponents
);
if
(
folderUri
.
scheme
===
'
file
'
)
{
const
folder
=
folderUri
.
fsPath
;
workspaceStatPromises
.
push
(
collectWorkspaceStats
(
folder
,
[
'
node_modules
'
,
'
.git
'
]).
then
(
async
stats
=>
{
let
countMessage
=
`
${
stats
.
fileCount
}
files`
;
if
(
stats
.
maxFilesReached
)
{
countMessage
=
`more than
${
countMessage
}
`
;
}
workspaceInfoMessages
.
push
(
`| Folder (
${
basename
(
folder
)}
):
${
countMessage
}
`
);
workspaceInfoMessages
.
push
(
formatWorkspaceStats
(
stats
));
const
launchConfigs
=
await
collectLaunchConfigs
(
folder
);
if
(
launchConfigs
.
length
>
0
)
{
workspaceInfoMessages
.
push
(
formatLaunchConfigs
(
launchConfigs
));
}
}));
}
else
{
workspaceInfoMessages
.
push
(
`| Folder (
${
folderUri
.
toString
()}
): RPerformance stats not available.`
);
}
});
});
}
...
...
@@ -129,33 +136,39 @@ export function printDiagnostics(info: IMainProcessInfo): Promise<any> {
// Workspace Stats
const
workspaceStatPromises
=
[];
if
(
info
.
windows
.
some
(
window
=>
window
.
folder
s
&&
window
.
folder
s
.
length
>
0
))
{
if
(
info
.
windows
.
some
(
window
=>
window
.
folder
URIs
&&
window
.
folderURI
s
.
length
>
0
))
{
console
.
log
(
''
);
console
.
log
(
'
Workspace Stats:
'
);
info
.
windows
.
forEach
(
window
=>
{
if
(
window
.
folders
.
length
===
0
)
{
if
(
window
.
folder
URI
s
.
length
===
0
)
{
return
;
}
console
.
log
(
`| Window (
${
window
.
title
}
)`
);
window
.
folders
.
forEach
(
folder
=>
{
workspaceStatPromises
.
push
(
collectWorkspaceStats
(
folder
,
[
'
node_modules
'
,
'
.git
'
]).
then
(
async
stats
=>
{
let
countMessage
=
`
${
stats
.
fileCount
}
files`
;
if
(
stats
.
maxFilesReached
)
{
countMessage
=
`more than
${
countMessage
}
`
;
}
console
.
log
(
`| Folder (
${
basename
(
folder
)}
):
${
countMessage
}
`
);
console
.
log
(
formatWorkspaceStats
(
stats
));
await
collectLaunchConfigs
(
folder
).
then
(
launchConfigs
=>
{
if
(
launchConfigs
.
length
>
0
)
{
console
.
log
(
formatLaunchConfigs
(
launchConfigs
));
window
.
folderURIs
.
forEach
(
uriComponents
=>
{
const
folderUri
=
URI
.
revive
(
uriComponents
);
if
(
folderUri
.
scheme
===
'
file
'
)
{
const
folder
=
folderUri
.
fsPath
;
workspaceStatPromises
.
push
(
collectWorkspaceStats
(
folder
,
[
'
node_modules
'
,
'
.git
'
]).
then
(
async
stats
=>
{
let
countMessage
=
`
${
stats
.
fileCount
}
files`
;
if
(
stats
.
maxFilesReached
)
{
countMessage
=
`more than
${
countMessage
}
`
;
}
});
}).
catch
(
error
=>
{
console
.
log
(
`| Error: Unable to collect workpsace stats for folder
${
folder
}
(
${
error
.
toString
()}
)`
);
}));
console
.
log
(
`| Folder (
${
basename
(
folder
)}
):
${
countMessage
}
`
);
console
.
log
(
formatWorkspaceStats
(
stats
));
await
collectLaunchConfigs
(
folder
).
then
(
launchConfigs
=>
{
if
(
launchConfigs
.
length
>
0
)
{
console
.
log
(
formatLaunchConfigs
(
launchConfigs
));
}
});
}).
catch
(
error
=>
{
console
.
log
(
`| Error: Unable to collect workspace stats for folder
${
folder
}
(
${
error
.
toString
()}
)`
);
}));
}
else
{
console
.
log
(
`| Folder (
${
folderUri
.
toString
()}
): Workspace stats not available.`
);
}
});
});
}
...
...
src/vs/code/electron-main/launch.ts
浏览文件 @
817a0355
...
...
@@ -16,9 +16,8 @@ import { OpenContext, IWindowSettings } from 'vs/platform/windows/common/windows
import
{
IWindowsMainService
,
ICodeWindow
}
from
'
vs/platform/windows/electron-main/windows
'
;
import
{
whenDeleted
}
from
'
vs/base/node/pfs
'
;
import
{
IWorkspacesMainService
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
,
{
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
BrowserWindow
}
from
'
electron
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
...
...
@@ -33,7 +32,7 @@ export interface IStartArguments {
export
interface
IWindowInfo
{
pid
:
number
;
title
:
string
;
folder
s
:
string
[];
folder
URIs
:
UriComponents
[];
}
export
interface
IMainProcessInfo
{
...
...
@@ -275,29 +274,25 @@ export class LaunchService implements ILaunchService {
}
private
codeWindowToInfo
(
window
:
ICodeWindow
):
IWindowInfo
{
const
folder
s
:
string
[]
=
[];
const
folder
URIs
:
URI
[]
=
[];
if
(
window
.
openedFolderUri
)
{
if
(
window
.
openedFolderUri
.
scheme
===
Schemas
.
file
)
{
folders
.
push
(
window
.
openedFolderUri
.
fsPath
);
// todo@remote signal remote folders?
}
folderURIs
.
push
(
window
.
openedFolderUri
);
}
else
if
(
window
.
openedWorkspace
)
{
const
rootFolders
=
this
.
workspacesMainService
.
resolveWorkspaceSync
(
window
.
openedWorkspace
.
configPath
).
folders
;
rootFolders
.
forEach
(
root
=>
{
if
(
root
.
uri
.
scheme
===
Schemas
.
file
)
{
// todo@remote signal remote folders?
folders
.
push
(
root
.
uri
.
fsPath
);
}
folderURIs
.
push
(
root
.
uri
);
});
}
return
this
.
browserWindowToInfo
(
window
.
win
,
folders
);
return
this
.
browserWindowToInfo
(
window
.
win
,
folder
URI
s
);
}
private
browserWindowToInfo
(
win
:
BrowserWindow
,
folder
s
:
string
[]
=
[]):
IWindowInfo
{
private
browserWindowToInfo
(
win
:
BrowserWindow
,
folder
URIs
:
URI
[]
=
[]):
IWindowInfo
{
return
{
pid
:
win
.
webContents
.
getOSProcessId
(),
title
:
win
.
getTitle
(),
folders
folder
URI
s
}
as
IWindowInfo
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录