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 Not Available as C++ Configuration Provider #1832

Closed
KyleFromKitware opened this issue May 4, 2021 · 9 comments
Closed

CMake Tools Not Available as C++ Configuration Provider #1832

KyleFromKitware opened this issue May 4, 2021 · 9 comments

Comments

@KyleFromKitware
Copy link
Contributor

KyleFromKitware commented May 4, 2021

Brief Issue Summary

I'm trying to use CMake Tools as the C++ configuration provider, but it is not available when I go to "C/C++: Change Configuration Provider..."

Expected:

  1. Open command palette
  2. Select "C/C++: Change Configuration Provider..."
  3. "CMake Tools" should be an option

Apparent Behavior:

  1. Open command palette
  2. Select "C/C++: Change Configuration Provider..."
  3. "CMake Tools" is not an option

Platform and Versions

  • Operating System: Ubuntu
  • CMake Version: 3.20.2
  • VSCode Version: 1.55.2
  • CMake Tools Extension Version: 1.7.1
  • Compiler/Toolchain: GCC 9.3.0

Other Notes/Information

I am using CMakeUserPresets.json, not sure if this is relevant or not.

@bobbrow
Copy link
Member

bobbrow commented May 4, 2021

CMake Tools does not currently register itself until a successful "configure" has happened. We recommend setting cmake.configureOnOpen to true until we make this the default value. Otherwise, you can run the CMake: Configure command and that will start the provider. We're also looking at #1149 and #477 which will help for the "unconfigured" or "configured outside of VS Code" situations.

@KyleFromKitware
Copy link
Contributor Author

Thanks. I tried running "CMake: Configure" and then changing the provider, but CMake Tools was still not available.

@bobbrow
Copy link
Member

bobbrow commented May 4, 2021

Did the configure fail? I don't know of any other reason why this shouldn't work. Is this on the CMake repo, or some other one?

@KyleFromKitware
Copy link
Contributor Author

The configure succeeded. I just tried it a second time and was still not able to change the configuration provider.

I am working on the CMake repository, but I'm using /usr/bin/cmake for the configure.

@bobbrow
Copy link
Member

bobbrow commented May 4, 2021

Hmm... A fresh clone of Kitware/CMake configured fine for me.

image

Would you be able to set the cmake.loggingLevel to debug, reload the window, run the "configure" command and then share the CMake Tools logs with me? I think you have my email address if you don't want to share them publicly.

@KyleFromKitware
Copy link
Contributor Author

Thanks. I emailed you the debug log in private.

@bobbrow
Copy link
Member

bobbrow commented May 7, 2021

@xisui-MSFT, @andreeis, The configuration provider doesn't get registered when presets are active. I traced it to here:

if (this._cppToolsAPI && cmt.codeModel && cmt.activeKit) {

There is no active Kit when presets are used, so the provider never registers. This code depends on Kits, so we'll need to update this section to work with either Kits or Presets.

@andreeis
Copy link
Contributor

andreeis commented May 11, 2021

@KyleFromKitware, we have a fix for this problem. Until we release 1.7.3 (soon today or tomorrow) you can try the vsix here: https://github.com/microsoft/vscode-cmake-tools/suites/2718070085/artifacts/59903576.
Uninstall CMake Tools 1.7.2 and run the command "Extensions: Install from VSIX" from the palette.
Let us know if IntelliSense works again.

@bobbrow
Copy link
Member

bobbrow commented May 11, 2021

This fixes it for me. I updated the version in package.json to 1.7.3. We just need to update the changelog and we can release it.

@bobbrow bobbrow closed this as completed May 24, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants