question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extension activated on Show Tasks/Run Build Task even if not in a CMake project

See original GitHub issue

Brief Issue Summary

When working on non CMake projects and using the “Tasks: Run Build Task” or simply “Show tasks” command, the cmake extension activates automatically asking to choose a kit, creating a new view and filling the statusbar with useless information (since there is no CMake project)

Expected:

For a non CMake project I would expect that even though I run the “Build” task, the extension wouldn’t turn on.

Other Notes/Information

Looking at the package.json I can see that one of the activation events is onCommand:workbench.action.tasks.runTask. This suggests to me that the originally desired behaviour was:

  1. User asks to show tasks
  2. Register a cmake task provider in case there were any tasks to provide

However i think that this activation event should be removed, leading to the following new behaviour:

  1. If there is some reason to activate cmake on folder open (e.g. CMakeLists.txt present) load the full cmake extension (which is the actual behaviour as of now, for what I can see)
  2. Since CMake is used and configured in the project, only now register a task provider for cmake tasks

This would allow to reduce the UX clutter, because the CMake extension doesn’t turn on apparently for no reason adding a lot of unwanted UI elements, and in my opinion is more correct, because there is no reason to register a cmake task provider if there is no cmake project in the first place

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
bobbrowcommented, Jan 14, 2021

Sorry for the inconvenience. We will be fixing this for the next release.

0reactions
rapgeniccommented, Feb 11, 2021

I tried it and I believe the issue is fixed now, thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to run commands like `cmake.build` from tasks ...
How to run the cmake.build command as a vscode task (from tasks.json)? I would like to run the cmake.build command as a vscode...
Read more >
Tasks in Visual Studio Code
Integrate with External Tools via Tasks. Lots of tools exist to automate tasks like linting, building, packaging, testing, or deploying software systems.
Read more >
Running CMake
Using CMake to build a project in non-interactive mode is a simple process if the project does not have many options. For larger...
Read more >
CMake projects in Visual Studio | Microsoft Learn
How to create and build C++ projects using CMake in Visual Studio. ... Configure Cache forces the generate step to run even if...
Read more >
C/C++ project with vscode, CMake - Adventure
As mention above, vscode is a code editor with a lot of powerful extensions. But at the core, it's still a text editor,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found