Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5d8467df
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,发现更多精彩内容 >>
提交
5d8467df
编写于
5月 23, 2018
作者:
E
Erich Gamma
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add inline action for running 'debug scripts'
上级
7dd1326e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
41 addition
and
3 deletion
+41
-3
extensions/npm/package.json
extensions/npm/package.json
+15
-2
extensions/npm/resources/dark/debug.svg
extensions/npm/resources/dark/debug.svg
+7
-0
extensions/npm/resources/light/debug.svg
extensions/npm/resources/light/debug.svg
+7
-0
extensions/npm/src/npmView.ts
extensions/npm/src/npmView.ts
+4
-1
extensions/npm/src/tasks.ts
extensions/npm/src/tasks.ts
+8
-0
未找到文件。
extensions/npm/package.json
浏览文件 @
5d8467df
...
...
@@ -53,7 +53,11 @@
},
{
"command"
:
"npm.debugScript"
,
"title"
:
"%command.debug%"
"title"
:
"%command.debug%"
,
"icon"
:
{
"light"
:
"resources/light/debug.svg"
,
"dark"
:
"resources/dark/debug.svg"
}
},
{
"command"
:
"npm.openScript"
,
...
...
@@ -93,11 +97,20 @@
"group"
:
"navigation@2"
},
{
"command"
:
"npm.runScript"
,
"command"
:
"npm.runScript"
,
"when"
:
"view == npm && viewItem == script"
,
"group"
:
"inline"
},
{
"command"
:
"npm.runScript"
,
"when"
:
"view == npm && viewItem == debugScript"
,
"group"
:
"inline"
},
{
"command"
:
"npm.debugScript"
,
"when"
:
"view == npm && viewItem == debugScript"
,
"group"
:
"inline"
},
{
"command"
:
"npm.debugScript"
,
"when"
:
"view == npm && viewItem == script"
,
"group"
:
"navigation@3"
...
...
extensions/npm/resources/dark/debug.svg
0 → 100644
浏览文件 @
5d8467df
<!-- Generated by IcoMoon.io -->
<svg
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
width=
"12"
height=
"12"
style=
"fill:#C5C5C5;fill-opacity:1;"
viewBox=
"0 0 512 512"
>
<title></title>
<g
id=
"icomoon-ignore"
>
</g>
<path
d=
"M512 288v-32h-96.645c-2.931-36.343-15.893-69.513-35.835-96.125h80.972l35.030-140.12-31.045-7.761-28.97 115.88h-87.34c-0.446-0.347-0.898-0.687-1.349-1.028 3.355-9.751 5.181-20.211 5.181-31.097 0.001-52.88-42.979-95.749-95.999-95.749s-96 42.869-96 95.75c0 10.886 1.825 21.346 5.181 31.097-0.45 0.342-0.902 0.681-1.349 1.028h-87.34l-28.97-115.88-31.045 7.761 35.030 140.12h80.972c-19.942 26.611-32.903 59.781-35.834 96.124h-96.645v32h96.685c1.901 22.832 7.754 44.406 16.819 63.875h-61.996l-35.030 140.119 31.045 7.762 28.97-115.881h56.177c29.346 39.016 73.698 63.875 123.33 63.875s93.983-24.859 123.331-63.875h56.177l28.97 115.881 31.045-7.762-35.030-140.119h-61.996c9.065-19.469 14.918-41.043 16.818-63.875h96.685z"
></path>
</svg>
extensions/npm/resources/light/debug.svg
0 → 100644
浏览文件 @
5d8467df
<!-- Generated by IcoMoon.io -->
<svg
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
width=
"12"
height=
"12"
style=
"fill:#464D46;fill-opacity:1;"
viewBox=
"0 0 512 512"
>
<title></title>
<g
id=
"icomoon-ignore"
>
</g>
<path
d=
"M512 288v-32h-96.645c-2.931-36.343-15.893-69.513-35.835-96.125h80.972l35.030-140.12-31.045-7.761-28.97 115.88h-87.34c-0.446-0.347-0.898-0.687-1.349-1.028 3.355-9.751 5.181-20.211 5.181-31.097 0.001-52.88-42.979-95.749-95.999-95.749s-96 42.869-96 95.75c0 10.886 1.825 21.346 5.181 31.097-0.45 0.342-0.902 0.681-1.349 1.028h-87.34l-28.97-115.88-31.045 7.761 35.030 140.12h80.972c-19.942 26.611-32.903 59.781-35.834 96.124h-96.645v32h96.685c1.901 22.832 7.754 44.406 16.819 63.875h-61.996l-35.030 140.119 31.045 7.762 28.97-115.881h56.177c29.346 39.016 73.698 63.875 123.33 63.875s93.983-24.859 123.331-63.875h56.177l28.97 115.881 31.045-7.762-35.030-140.119h-61.996c9.065-19.469 14.918-41.043 16.818-63.875h96.685z"
></path>
</svg>
extensions/npm/src/npmView.ts
浏览文件 @
5d8467df
...
...
@@ -72,6 +72,9 @@ class NpmScript extends TreeItem {
constructor
(
context
:
ExtensionContext
,
packageJson
:
PackageJSON
,
task
:
Task
)
{
super
(
task
.
name
,
TreeItemCollapsibleState
.
None
);
this
.
contextValue
=
'
script
'
;
if
(
task
.
group
&&
task
.
group
===
TaskGroup
.
Rebuild
)
{
this
.
contextValue
=
'
debugScript
'
;
}
this
.
package
=
packageJson
;
this
.
task
=
task
;
this
.
command
=
{
...
...
@@ -141,7 +144,7 @@ export class NpmScriptsTreeDataProvider implements TreeDataProvider<TreeItem> {
workspace
.
executeTask
(
script
.
task
);
}
private
async
extractDebugArg
(
scripts
:
any
,
task
:
Task
):
Promise
<
[
string
,
number
]
|
undefined
>
{
private
extractDebugArg
(
scripts
:
any
,
task
:
Task
):
[
string
,
number
]
|
undefined
{
let
script
:
string
=
scripts
[
task
.
name
];
let
match
=
script
.
match
(
/--
(
inspect|debug
)(
-brk
)?(
=
(\d
*
))?
/
);
...
...
extensions/npm/src/tasks.ts
浏览文件 @
5d8467df
...
...
@@ -157,6 +157,11 @@ function isExcluded(folder: WorkspaceFolder, packageJsonUri: Uri) {
return
false
;
}
function
isDebugScript
(
script
:
string
):
boolean
{
let
match
=
script
.
match
(
/--
(
inspect|debug
)(
-brk
)?(
=
(\d
*
))?
/
);
return
match
!==
null
;
}
async
function
provideNpmScriptsForFolder
(
packageJsonUri
:
Uri
):
Promise
<
Task
[]
>
{
let
emptyTasks
:
Task
[]
=
[];
...
...
@@ -183,6 +188,9 @@ async function provideNpmScriptsForFolder(packageJsonUri: Uri): Promise<Task[]>
if
(
prePostScripts
.
has
(
each
))
{
task
.
group
=
TaskGroup
.
Clean
;
// hack: use Clean group to tag pre/post scripts
}
if
(
isDebugScript
(
scripts
!
[
each
]))
{
task
.
group
=
TaskGroup
.
Rebuild
;
// hack: use Rebuild group to tag debug scripts
}
result
.
push
(
task
);
});
// always add npm install (without a problem matcher)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录