Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Tools status bar buttons are visible when non-cmake projects are open #3025

Closed
bizzehdee opened this issue Feb 23, 2023 · 7 comments
Closed
Labels
Feature: activation related to extension activation more info needed More info is needed from the community for us to properly triage and investigate. stale to use with the close-stale-issues bot

Comments

@bizzehdee
Copy link

Brief Issue Summary

When i open up a python project, or a C++ project that has no cmakelists.txt file, or any other non-cmake based project, the cmake tools buttons still appear in the status bar. Can we have it so that the buttons appear selectively, based on whether or not there is a cmakelists.txt file in the root of a workspace/directory?

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

@bobbrow
Copy link
Member

bobbrow commented Feb 23, 2023

That is supposed to be the default behavior. Can you run the "Developer: Startup Performance" command and share what you see in the "Extension Activation Stats" table for ms-vscode.cmake-tools? It will tell us why the extension is being activated.

@bobbrow bobbrow added Feature: activation related to extension activation more info needed More info is needed from the community for us to properly triage and investigate. labels Feb 23, 2023
@bizzehdee
Copy link
Author

| ms-vscode.cmake-tools | true | 21 | 0 | 2166 | workspaceContains:*/CMakeLists.txt,*/*/CMakeLists.txt,*/*/*/CMakeLists.txt | ms-vscode.cmake-tools |

1 of the projects, i have found to have a dummy cmakelists.txt deep down in its directory structure, but the others, i cannot find anything for at all.

@bobbrow
Copy link
Member

bobbrow commented Feb 23, 2023

What does the table say for the other projects? Or are you opening a multi-folder workspace?

@bobbrow
Copy link
Member

bobbrow commented Feb 23, 2023

What should be happening for your project with the CMakeLists.txt in it is that the extension will activate and ask you to select a CMakeLists.txt that contains your project. If you select one of the ones we found, then we update the cmake.sourceDirectory setting for you and the status bar should light up. If you dismiss the prompt, the extension should disable most of its functionality, including the status bar. I just tried this out on a new folder and it works the way I expect. If the status bar is visible, then check to see if the cmake.sourceDirectory setting is set by accident and clear it.

@Longhanks
Copy link

| ms-vscode.cmake-tools | true | 21 | 0 | 2166 | workspaceContains:*/CMakeLists.txt,*/*/CMakeLists.txt,*/*/*/CMakeLists.txt | ms-vscode.cmake-tools |

1 of the projects, i have found to have a dummy cmakelists.txt deep down in its directory structure, but the others, i cannot find anything for at all.

This is happening for me as well, my project is not CMake based, but a library that is within the source directory as a submodule has a nested CMakeLists.txt somewhere in its directory tree, and this activates the ms-vscode.cmake-tools extension (*/*/*/CMakeLists.txt matches).

It would be great if there were a setting to only load the extension if CMakeLists.txt was chosen, or a setting in e. g. C_cpp_properties.json to disable it - setting "configurationProvider": "none" or "configurationProvider": "" does not disable loading of ms-vscode.cmake-tools.

@github-actions
Copy link

This issue is now marked as 'stale' due to there being no activity on it for the past 30 days and being labelled 'more info needed'. Unless the 'stale' label is removed or the issue is commented on, this will be closed in 7 days. If you would like to make this issue exempt from getting stale, please remove the 'more info needed' and 'stale' labels or add the 'stale-exempt' label

@github-actions github-actions bot added the stale to use with the close-stale-issues bot label Oct 18, 2023
@github-actions
Copy link

This issue is now closed due to there being no activity on it for the past 7 days since being marked as 'stale'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: activation related to extension activation more info needed More info is needed from the community for us to properly triage and investigate. stale to use with the close-stale-issues bot
Projects
None yet
Development

No branches or pull requests

3 participants