vscode 背景任务没有输出永远不会完成,

ctehm74n  于 4个月前  发布在  Vscode
关注(0)|答案(7)|浏览(71)

我有一个后台任务,它不输出任何内容。我还设置了这个问题匹配器:

"problemMatcher": {
    "pattern": {
        "regexp": ""
    },
    "background": {
        "beginsPattern": ".*",
        "endsPattern": ".*"
    }
},

然而,任务从未完成:

vd2z7a6w

vd2z7a6w1#

@alexr00 pls correct me if i'm wrong, but I think that it doesn't make sense to set a problem matcher for a task without output.

llmtgqce

llmtgqce2#

如果对于该任务我没有设置问题匹配器,那么该任务永远不会完成,依赖于它的启动配置也不会启动。

h43kikqp

h43kikqp3#

如果将它设置为 [] 会发生什么?

nwwlzxa7

nwwlzxa74#

但是你也可以玩一下它——在vscode仓库中,任务是“启动Http服务器”。尝试启动“Monaco Editor Playground”的启动配置。

yhuiod9q

yhuiod9q5#

好的,下次迭代会尝试查看这个。

xzabzqsa

xzabzqsa6#

@alexr00 pls correct me if i'm wrong, but I think that it doesn't make sense to set a problem matcher for a task without output.
Conceptually I agree with you, but @hediet use case makes sense:

  1. Have a launch config that depends on some server running locally
  2. Add a prelaunch task for the launch config
  3. The prelaunch task must be a background task as it never exits as long as the server is running
  4. Background prelaunch tasks must have a problem matcher in order to run
  5. The prelaunch task doesn't actually output anything, just starts a server
    You could say that the task could be modified to output something just to satisfy the problem matcher. Or you could say that there's a new kind of prelaunch task that only requires that the task starts, not ever "ends" (or matches an end pattern in a problem matcher). Or you could say that this is a valid use case. I don't know how common it is. I do know that users have wanted to have prelaunch tasks that only require that the task start for a while.
p3rjfoxz

p3rjfoxz7#

如果你有嵌入式系统,并启动一个像QEMU这样的模拟器,然后将调试器连接到它。启动模拟器是一个后台任务,但没有输出。现在你需要运行任务,然后再执行启动配置。

相关问题