Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
df8b833e
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,发现更多精彩内容 >>
未验证
提交
df8b833e
编写于
4月 06, 2020
作者:
D
Daniel Imms
提交者:
GitHub
4月 06, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #94472 from microsoft/tyriar/94388
Report linux desktop-related env vars in issue reporter
上级
8918d05c
ebbc6591
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
75 addition
and
3 deletion
+75
-3
src/vs/code/electron-browser/issue/issueReporterModel.ts
src/vs/code/electron-browser/issue/issueReporterModel.ts
+8
-1
src/vs/code/electron-browser/issue/test/testReporterModel.test.ts
...ode/electron-browser/issue/test/testReporterModel.test.ts
+49
-0
src/vs/platform/diagnostics/common/diagnostics.ts
src/vs/platform/diagnostics/common/diagnostics.ts
+8
-0
src/vs/platform/diagnostics/node/diagnosticsService.ts
src/vs/platform/diagnostics/node/diagnosticsService.ts
+10
-2
未找到文件。
src/vs/code/electron-browser/issue/issueReporterModel.ts
浏览文件 @
df8b833e
...
...
@@ -168,6 +168,13 @@ ${this.getInfos()}
|Screen Reader|
${
this
.
_data
.
systemInfo
.
screenReader
}
|
|VM|
${
this
.
_data
.
systemInfo
.
vmHint
}
|`
;
if
(
this
.
_data
.
systemInfo
.
linuxEnv
)
{
md
+=
`\n|DESKTOP_SESSION|
${
this
.
_data
.
systemInfo
.
linuxEnv
.
desktopSession
}
|
|XDG_CURRENT_DESKTOP|
${
this
.
_data
.
systemInfo
.
linuxEnv
.
xdgCurrentDesktop
}
|
|XDG_SESSION_DESKTOP|
${
this
.
_data
.
systemInfo
.
linuxEnv
.
xdgSessionDesktop
}
|
|XDG_SESSION_TYPE|
${
this
.
_data
.
systemInfo
.
linuxEnv
.
xdgSessionType
}
|`
;
}
this
.
_data
.
systemInfo
.
remoteData
.
forEach
(
remote
=>
{
if
(
isRemoteDiagnosticError
(
remote
))
{
md
+=
`\n\n
${
remote
.
errorMessage
}
`
;
...
...
@@ -268,4 +275,4 @@ ${table}
</details>`
;
}
}
\ No newline at end of file
}
src/vs/code/electron-browser/issue/test/testReporterModel.test.ts
浏览文件 @
df8b833e
...
...
@@ -81,6 +81,55 @@ OS version: undefined
<!-- generated by issue reporter -->`
);
});
test
(
'
serializes Linux environment information when data is provided
'
,
()
=>
{
const
issueReporterModel
=
new
IssueReporterModel
({
issueType
:
0
,
systemInfo
:
{
os
:
'
Darwin
'
,
cpus
:
'
Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2800)
'
,
memory
:
'
16.00GB
'
,
vmHint
:
'
0%
'
,
processArgs
:
''
,
screenReader
:
'
no
'
,
remoteData
:
[],
gpuStatus
:
{},
linuxEnv
:
{
desktopSession
:
'
ubuntu
'
,
xdgCurrentDesktop
:
'
ubuntu
'
,
xdgSessionDesktop
:
'
ubuntu:GNOME
'
,
xdgSessionType
:
'
x11
'
}
}
});
assert
.
equal
(
issueReporterModel
.
serialize
(),
`
Issue Type: <b>Bug</b>
undefined
VS Code version: undefined
OS version: undefined
<details>
<summary>System Info</summary>
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2800)|
|GPU Status||
|Load (avg)|undefined|
|Memory (System)|16.00GB|
|Process Argv||
|Screen Reader|no|
|VM|0%|
|DESKTOP_SESSION|ubuntu|
|XDG_CURRENT_DESKTOP|ubuntu|
|XDG_SESSION_DESKTOP|ubuntu:GNOME|
|XDG_SESSION_TYPE|x11|
</details>Extensions: none
<!-- generated by issue reporter -->`
);
});
test
(
'
serializes remote information when data is provided
'
,
()
=>
{
const
issueReporterModel
=
new
IssueReporterModel
({
issueType
:
0
,
...
...
src/vs/platform/diagnostics/common/diagnostics.ts
浏览文件 @
df8b833e
...
...
@@ -13,6 +13,14 @@ export interface IMachineInfo {
cpus
?:
string
;
memory
:
string
;
vmHint
:
string
;
linuxEnv
?:
ILinuxEnv
;
}
export
interface
ILinuxEnv
{
desktopSession
?:
string
;
xdgSessionDesktop
?:
string
;
xdgCurrentDesktop
?:
string
;
xdgSessionType
?:
string
;
}
export
interface
IDiagnosticInfo
{
...
...
src/vs/platform/diagnostics/node/diagnosticsService.ts
浏览文件 @
df8b833e
...
...
@@ -11,7 +11,7 @@ import { parse, ParseError, getNodeType } from 'vs/base/common/json';
import
{
listProcesses
}
from
'
vs/base/node/ps
'
;
import
product
from
'
vs/platform/product/common/product
'
;
import
{
repeat
,
pad
}
from
'
vs/base/common/strings
'
;
import
{
isWindows
}
from
'
vs/base/common/platform
'
;
import
{
isWindows
,
isLinux
}
from
'
vs/base/common/platform
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
ProcessItem
}
from
'
vs/base/common/processes
'
;
import
{
IMainProcessInfo
}
from
'
vs/platform/launch/common/launch
'
;
...
...
@@ -336,11 +336,19 @@ export class DiagnosticsService implements IDiagnosticsService {
remoteData
};
if
(
!
isWindows
)
{
systemInfo
.
load
=
`
${
osLib
.
loadavg
().
map
(
l
=>
Math
.
round
(
l
)).
join
(
'
,
'
)}
`
;
}
if
(
isLinux
)
{
systemInfo
.
linuxEnv
=
{
desktopSession
:
process
.
env
.
DESKTOP_SESSION
,
xdgSessionDesktop
:
process
.
env
.
XDG_SESSION_DESKTOP
,
xdgCurrentDesktop
:
process
.
env
.
XDG_CURRENT_DESKTOP
,
xdgSessionType
:
process
.
env
.
XDG_SESSION_TYPE
};
}
return
Promise
.
resolve
(
systemInfo
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录