升级到 VSC 1.25.0 后,默认任务不再可用。
要复制,升级到 VSC 1.25.0,单击任务菜单,单击运行任务菜单项并注意列表现在是空的。
VSCode 1.25.0
在 Arch Linux x86_64
。
Fedora 28 上的 VSCode 1.25.0
也会发生这种情况。
在 Windows 10 上也得到了确认。
在此期间,有人可以分享一个模板,直到它被修复吗?
同时,您可以通过查看源来获取任务; 他们在这里添加: https :
这是本来会生成的隐式tasks.json
:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "cargo build",
"command": "cargo",
"args": [
"build"
],
"problemMatcher": [
"$rustc"
]
},
{
"type": "shell",
"label": "cargo check",
"command": "cargo",
"args": [
"check"
],
"problemMatcher": [
"$rustc"
]
},
{
"type": "shell",
"label": "cargo clean",
"command": "cargo",
"args": [
"clean"
],
"problemMatcher": []
},
{
"type": "shell",
"label": "cargo run",
"command": "cargo",
"args": [
"run"
],
"problemMatcher": [
"$rustc"
]
},
{
"type": "shell",
"label": "cargo test",
"command": "cargo",
"args": [
"test"
],
"problemMatcher": [
"$rustc"
]
}
]
}
由 #361 修复
确认这对我有用。 谢谢@nrc和@HyperHamster!
使用此修复程序发布了 0.4.7
对我有用,谢谢。
我还有一些问题。 我得到了显示的任务,但是当我尝试使用一个(不管哪个)时,我得到:
> Executing task in folder ProjectFolder: cargo task <
后面什么都没有(似乎根本没有运行); 其中task
是 run、build、check、bench、clean 或 test 之一。
如果我“配置任务”并将"type": "cargo",
更改"type": "shell",
,它会按预期运行。 如果我从命令行运行cargo task
,它会按预期运行。
我已经测试了一些项目,甚至只是一个基本的“Hello World”风格的项目!
@scautura是的,我也遇到过(Windows 10)
@TomMarius +1
如果您尝试“配置任务”,则生成的任务在"type"
字段中包含"cargo"
。 显然,这应该是"shell"
或"process"
。 这是一个固定的tasks.json
:
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "cargo build",
"command": "cargo",
"args": [
"build"
],
"problemMatcher": [
"$rustc"
],
"group": "build"
},
{
"type": "shell",
"label": "cargo check",
"command": "cargo",
"args": [
"check"
],
"problemMatcher": [
"$rustc"
],
"group": "build"
},
{
"type": "shell",
"label": "cargo run",
"command": "cargo",
"args": [
"run"
],
"problemMatcher": [
"$rustc"
],
},
{
"type": "shell",
"label": "cargo test",
"command": "cargo",
"args": [
"test"
],
"problemMatcher": [
"$rustc"
],
"group": "test"
},
{
"type": "shell",
"label": "cargo bench",
"command": "cargo",
"args": [
"+nightly",
"bench"
],
"problemMatcher": [
"$rustc"
],
"group": "test"
},
{
"type": "shell",
"label": "cargo clean",
"command": "cargo",
"args": [
"clean"
],
"problemMatcher": []
},
]
}
cc @matklad 回复最后一条评论。 您是否希望将类型更改为cargo
以破坏事物?
不,我认为我们必须定义一种新的任务类型才能使事情顺利进行。 我对此不太确定,但是,例如, cake 定义了新类型:
https://github.com/Microsoft/vscode/issues/53673#issuecomment -402987914。
我想知道哪些类型的货物不起作用的人的设置有什么区别?
我认为这可能是解决办法: https :
Version: 1.25.0
Commit: 0f080e5267e829de46638128001aeb7ca2d6d50e
Date: 2018-07-05T13:10:37.273Z
Electron: 1.7.12
Chrome: 58.0.3029.110
Node.js: 7.9.0
V8: 5.8.283.38
Architecture: x64
即使使用'rust'
一切似乎也能正常工作。
转载,这是特定于 Windows 的。
好的,实际修复是 https://github.com/rust-lang-nursery/rls-vscode/pull/371 :)
关闭 #371
最有用的评论
我还有一些问题。 我得到了显示的任务,但是当我尝试使用一个(不管哪个)时,我得到:
> Executing task in folder ProjectFolder: cargo task <
后面什么都没有(似乎根本没有运行); 其中
task
是 run、build、check、bench、clean 或 test 之一。如果我“配置任务”并将
"type": "cargo",
更改"type": "shell",
,它会按预期运行。 如果我从命令行运行cargo task
,它会按预期运行。我已经测试了一些项目,甚至只是一个基本的“Hello World”风格的项目!