Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
bfa915d6
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,发现更多精彩内容 >>
提交
bfa915d6
编写于
10月 28, 2019
作者:
R
Rachel Macfarlane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support 'workbench.action.openIssueReport' command in the web - directly open GitHub
上级
c2565c31
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
118 addition
and
2 deletion
+118
-2
src/vs/code/common/issue/issueReporterUtil.ts
src/vs/code/common/issue/issueReporterUtil.ts
+0
-0
src/vs/code/electron-browser/issue/issueReporterMain.ts
src/vs/code/electron-browser/issue/issueReporterMain.ts
+1
-1
src/vs/code/electron-browser/issue/test/testReporterModel.test.ts
...ode/electron-browser/issue/test/testReporterModel.test.ts
+1
-1
src/vs/workbench/contrib/issue/browser/issue.contribution.ts
src/vs/workbench/contrib/issue/browser/issue.contribution.ts
+46
-0
src/vs/workbench/contrib/issue/browser/issueService.ts
src/vs/workbench/contrib/issue/browser/issueService.ts
+67
-0
src/vs/workbench/workbench.web.main.ts
src/vs/workbench/workbench.web.main.ts
+3
-0
未找到文件。
src/vs/code/
electron-browser
/issue/issueReporterUtil.ts
→
src/vs/code/
common
/issue/issueReporterUtil.ts
浏览文件 @
bfa915d6
文件已移动
src/vs/code/electron-browser/issue/issueReporterMain.ts
浏览文件 @
bfa915d6
...
...
@@ -35,7 +35,7 @@ import BaseHtml from 'vs/code/electron-browser/issue/issueReporterPage';
import
{
LoggerChannelClient
,
FollowerLogService
}
from
'
vs/platform/log/common/logIpc
'
;
import
{
ILogService
,
getLogLevel
}
from
'
vs/platform/log/common/log
'
;
import
{
CodiconLabel
}
from
'
vs/base/browser/ui/codiconLabel/codiconLabel
'
;
import
{
normalizeGitHubUrl
}
from
'
vs/code/
electron-browser
/issue/issueReporterUtil
'
;
import
{
normalizeGitHubUrl
}
from
'
vs/code/
common
/issue/issueReporterUtil
'
;
import
{
Button
}
from
'
vs/base/browser/ui/button/button
'
;
import
{
SystemInfo
,
isRemoteDiagnosticError
}
from
'
vs/platform/diagnostics/common/diagnostics
'
;
import
{
SpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
...
...
src/vs/code/electron-browser/issue/test/testReporterModel.test.ts
浏览文件 @
bfa915d6
...
...
@@ -5,7 +5,7 @@
import
*
as
assert
from
'
assert
'
;
import
{
IssueReporterModel
}
from
'
vs/code/electron-browser/issue/issueReporterModel
'
;
import
{
normalizeGitHubUrl
}
from
'
vs/code/
electron-browser
/issue/issueReporterUtil
'
;
import
{
normalizeGitHubUrl
}
from
'
vs/code/
common
/issue/issueReporterUtil
'
;
import
{
IssueType
}
from
'
vs/platform/issue/node/issue
'
;
suite
(
'
IssueReporter
'
,
()
=>
{
...
...
src/vs/workbench/contrib/issue/browser/issue.contribution.ts
0 → 100644
浏览文件 @
bfa915d6
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
nls
from
'
vs/nls
'
;
import
{
ICommandAction
,
MenuId
,
MenuRegistry
}
from
'
vs/platform/actions/common/actions
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Extensions
as
WorkbenchExtensions
,
IWorkbenchContribution
,
IWorkbenchContributionsRegistry
}
from
'
vs/workbench/common/contributions
'
;
import
{
IWebIssueService
,
WebIssueService
}
from
'
vs/workbench/contrib/issue/browser/issueService
'
;
class
RegisterIssueContribution
implements
IWorkbenchContribution
{
constructor
(@
IProductService
readonly
productService
:
IProductService
)
{
if
(
productService
.
reportIssueUrl
)
{
const
helpCategory
=
{
value
:
nls
.
localize
(
'
help
'
,
"
Help
"
),
original
:
'
Help
'
};
const
OpenIssueReporterActionId
=
'
workbench.action.openIssueReporter
'
;
const
OpenIssueReporterActionLabel
=
nls
.
localize
({
key
:
'
reportIssueInEnglish
'
,
comment
:
[
'
Translate this to "Report Issue in English" in all languages please!
'
]
},
"
Report Issue
"
);
CommandsRegistry
.
registerCommand
(
OpenIssueReporterActionId
,
function
(
accessor
,
args
?:
[
string
])
{
let
extensionId
:
string
|
undefined
;
if
(
args
&&
Array
.
isArray
(
args
))
{
[
extensionId
]
=
args
;
}
return
accessor
.
get
(
IWebIssueService
).
openReporter
({
extensionId
});
});
const
command
:
ICommandAction
=
{
id
:
OpenIssueReporterActionId
,
title
:
{
value
:
OpenIssueReporterActionLabel
,
original
:
'
Report Issue
'
},
category
:
helpCategory
};
MenuRegistry
.
appendMenuItem
(
MenuId
.
CommandPalette
,
{
command
});
}
}
}
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
).
registerWorkbenchContribution
(
RegisterIssueContribution
,
LifecyclePhase
.
Starting
);
registerSingleton
(
IWebIssueService
,
WebIssueService
,
true
);
src/vs/workbench/contrib/issue/browser/issueService.ts
0 → 100644
浏览文件 @
bfa915d6
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
normalizeGitHubUrl
}
from
'
vs/code/common/issue/issueReporterUtil
'
;
import
{
IExtensionManagementService
}
from
'
vs/platform/extensionManagement/common/extensionManagement
'
;
import
{
ExtensionType
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
export
const
IWebIssueService
=
createDecorator
<
IWebIssueService
>
(
'
webIssueService
'
);
export
interface
IIssueReporterOptions
{
extensionId
?:
string
;
}
export
interface
IWebIssueService
{
_serviceBrand
:
undefined
;
openReporter
(
options
?:
IIssueReporterOptions
):
Promise
<
void
>
;
}
export
class
WebIssueService
implements
IWebIssueService
{
_serviceBrand
:
undefined
;
constructor
(
@
IExtensionManagementService
private
readonly
extensionManagementService
:
IExtensionManagementService
,
@
IOpenerService
private
readonly
openerService
:
IOpenerService
,
@
IProductService
private
readonly
productService
:
IProductService
)
{
}
async
openReporter
(
options
:
IIssueReporterOptions
):
Promise
<
void
>
{
let
repositoryUrl
=
this
.
productService
.
reportIssueUrl
;
if
(
options
.
extensionId
)
{
const
extensionGitHubUrl
=
await
this
.
getExtensionGitHubUrl
(
options
.
extensionId
);
if
(
extensionGitHubUrl
)
{
repositoryUrl
=
extensionGitHubUrl
+
'
/issues/new
'
;
}
}
if
(
repositoryUrl
)
{
return
this
.
openerService
.
open
(
URI
.
parse
(
repositoryUrl
)).
then
(
_
=>
{
});
}
else
{
throw
new
Error
(
`Unable to find issue reporting url for
${
options
.
extensionId
}
`
);
}
}
private
async
getExtensionGitHubUrl
(
extensionId
:
string
):
Promise
<
string
>
{
let
repositoryUrl
=
''
;
const
extensions
=
await
this
.
extensionManagementService
.
getInstalled
(
ExtensionType
.
User
);
const
selectedExtension
=
extensions
.
filter
(
ext
=>
ext
.
identifier
.
id
===
extensionId
)[
0
];
const
bugsUrl
=
selectedExtension
?.
manifest
.
bugs
?.
url
;
const
extensionUrl
=
selectedExtension
?.
manifest
.
repository
?.
url
;
// If given, try to match the extension's bug url
if
(
bugsUrl
&&
bugsUrl
.
match
(
/^https
?
:
\/\/
github
\.
com
\/(
.*
)
/
))
{
repositoryUrl
=
normalizeGitHubUrl
(
bugsUrl
);
}
else
if
(
extensionUrl
&&
extensionUrl
.
match
(
/^https
?
:
\/\/
github
\.
com
\/(
.*
)
/
))
{
repositoryUrl
=
normalizeGitHubUrl
(
extensionUrl
);
}
return
repositoryUrl
;
}
}
src/vs/workbench/workbench.web.main.ts
浏览文件 @
bfa915d6
...
...
@@ -108,4 +108,7 @@ import 'vs/workbench/contrib/tasks/browser/taskService';
// Telemetry Opt Out
import
'
vs/workbench/contrib/welcome/telemetryOptOut/browser/telemetryOptOut.contribution
'
;
// Issues
import
'
vs/workbench/contrib/issue/browser/issue.contribution
'
;
//#endregion
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录