microsoft / microsoft/vscode-cmake-tools

Plugin upgrade breaks recognition of build tasks when using status bar button

Open
#2,959 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Feature: tasks
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

Brief Issue Summary

With a default built task configured from task.json, pressing the Build button from the status bar now reveals a menu rather than running the default build task. The menu does not appear to contain the default build task as an option. This was not a problem in 1.12.27 - it would launch the default task as expected.

Build button:
image

Revealed menu after pressing button:
image

The "Cmake:Build Task" option in the workspace settings is set.

CMake Tools Diagnostics
{
  "os": "linux",
  "vscodeVersion": "1.74.3",
  "cmtVersion": "1.13.40",
  "configurations": [
    {
      "folder": "/home/jon/git/proto",
      "cmakeVersion": "3.18.4",
      "configured": true,
      "generator": "Unix Makefiles",
      "usesPresets": false,
      "compilers": {
        "C": "/bin/x86_64-linux-gnu-gcc-10",
        "CXX": "/bin/x86_64-linux-gnu-g++-10"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 1,
    "executablesCount": 0,
    "librariesCount": 1,
    "targets": [
      {
        "name": "rpc",
        "type": "STATIC_LIBRARY"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}
Debug Log
(no relevant input generated when the menu comes up)
Additional Information

Below is the contents of my tasks.json. Pressing ctrl+shift+b builds as expected.

{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
    {
      "label": "build current target",
      "type": "shell",
      "options": {
        "cwd": "${workspaceRoot}/build"
      },
      "command": "make -j`nproc` ${command:cmake.buildTargetName}",
      "problemMatcher": [],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    },
  ]
}

Setting the default built task again (ctrl+shift+p -> Configure Default Build Task) does not resolve the problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided tasks.json, the status-bar Build button, and the CMake Tools diagnostics; compare it with Ctrl+Shift+B, which works. Trace the status-bar build command and default-task discovery path, then verify that the configured default task runs from the button and that the menu includes it.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, typescript, vscode
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.