Ошибка сборки расширения кода C / C ++ VS: «Поставщик задачи для задач« C / C ++ »неожиданно предоставил задачу типа« оболочка ». - PullRequest
8 голосов
/ 09 мая 2020

Когда я пытаюсь создать задачу C в VS Code, появляется следующее сообщение:

Вывод просто показывает следующее: The task provider for "C/C++" tasks unexpectedly provided a task of type "shell".

Я все еще могу вручную собрать мои C файлы в cmd, используя gcc 'filename.c' -o 'output.exe'. Переход к Terminal -> Run Task вместо использования сочетания клавиш CTRL + SHIFT + B, похоже, тоже работает.

Я использую расширение 0.28.0-insiders2 C / C ++ VS Code с MinGW. Код VS обновился сегодня до версии 1.45, и я считаю, что это может быть причиной этой ошибки, поскольку я не получал ее раньше.

задач. json:

{  
    "version": "2.0.0", 
    "tasks": [
        {
            "label": "Makefile Debug_gcc",
            "type": "shell",
            "command": ["mingw32-make"],
            "args": [
                "--directory=${fileDirname}/", 
                "DEBUG=1", 
                "EXECUTABLE=${fileBasenameNoExtension}Debug"
            ]
        },
        {
            "label": "Makefile Release_gcc",
            "type": "shell",
            "command": ["mingw32-make"],
            "args": [
                "--directory=${fileDirname}/", 
                "DEBUG=0", 
                "EXECUTABLE=${fileBasenameNoExtension}Release"
            ]
        },
        {
            "label": "Release",
            "type": "shell",
            "command": "gcc",
            "args": [
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}Release"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        },
        {
            "label": "Debug",
            "type": "shell",
            "command": "gcc",
            "args": [
                "${file}",
                "-g3",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}Debug"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        },
        {
            "label": "Makefile Debug",
            "type": "shell",
            "command": ["del /S *.o"],
            "dependsOn": [
                "Makefile Debug_gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        },
        {
            "label": "Makefile Release",
            "type": "shell",
            "command": ["del /S *.o"],
            "dependsOn": [
                "Makefile Release_gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        },
        {
            "label": "Makefile Debug + Execute",
            "type": "shell",
            "command": "${fileDirname}/${fileBasenameNoExtension}Debug",
            "dependsOn": [
                "Makefile Debug"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        },
        {
            "label": "Makefile Release + Execute",
            "type": "shell",
            "command": "${fileDirname}/${fileBasenameNoExtension}Release",
            "dependsOn": [
                "Makefile Release"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        },
        {
            "label": "Debug Execute",
            "type": "shell",
            "command": "${fileDirname}/${fileBasenameNoExtension}Debug",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        },
        {
            "label": "Release Execute",
            "type": "shell",
            "command": "${fileDirname}/${fileBasenameNoExtension}Release",
            "group": {
                "kind": "build", 
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        }
    ]
}
...