-
Notifications
You must be signed in to change notification settings - Fork 463
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
[cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect. #1341
Comments
Thank you for reporting this issue. I saw it on another developer's machine this week and forgot to open a ticket to fix this. I looked for documentation from the CMake team about this revision but didn't find any. I posted a question on their forum to ask about the changes and we'll see what they say. https://discourse.cmake.org/t/cmake-file-api-code-model-version-2-1/1465 Please note that the log message is just a warning and if the code model hasn't changed substantially in revision 2.1, the message can be safely ignored. |
CMake upstream here, this is a minor update which only adds new fields to the File API output - it won't break older clients. The warning is safe to ignore. I've opened #1343 to suppress the warning for newer versions. |
1.4.2 has this fix and is now available. Sorry for such a long delay, our work on another extension project has been taking much longer than anticipated. |
I'm on vscode-cmake-tools 1.4.2 and CMake 1.38.2 and this message still appears. |
D'oh! Looks like I implemented the fix for the cache model but not the code model. I'll fix it. |
b6884ea allowd the cache object minor version to be higher than expected, but did not do the same for the code model. Fix this. Fixes: microsoft#1341
b6884ea allowed the cache object minor version to be higher than expected, but did not do the same for the code model. Fix this. Fixes: microsoft#1341
I have vscode-cmake-tools 1.4.2 and CMake version 3.18.2 and encounter with this error |
The remaining message will be fixed in 1.5 |
I found a way to walkthrough the issue. edit async function loadCodeModelContent(filename) {
const file_content = await pr_1.fs.readFile(filename);
const codemodel = JSON.parse(file_content.toString());
const expected_version = { major: 2, minor: 0 };
const detected_version = codemodel.version;
if (detected_version.major != expected_version.major || detected_version.minor != expected_version.minor) {
log.warning(localize(3, null, detected_version.major, detected_version.minor, expected_version.major, expected_version.minor));
}
return codemodel;
} replace it with the code below: async function loadCodeModelContent(filename) {
const file_content = await pr_1.fs.readFile(filename);
const codemodel = JSON.parse(file_content.toString());
const expected_version = { major: 2, minor: 0 };
const detected_version = codemodel.version;
if (detected_version.major != expected_version.major || detected_version.minor < expected_version.minor) {
log.warning(localize(3, null, detected_version.major, detected_version.minor, expected_version.major, expected_version.minor));
}
return codemodel;
} Yes, just do as the PR did. |
@jeremyxu2010 The file ended up in |
Getting this message when trying to configure a C project in VS Code:
cmake version 3.19.0-rc1 |
I am trying to build a c++ project on windows with visual studio code and cmake-tools extension.
My versions are
cmake: 3.18.0-rc1
cmake tools (vscode extension): 1.4.1
When I build, I get this annoying message about codemodel version.
This messages appear at configuration, and also when I build.
It is the exact same problem mentionned by someone else in this stackoverflow question : https://stackoverflow.com/questions/62445673/cmakefileapi-parser-warning-message-about-cmake-in-windows-vscode
One of the comments on stackoverflow suggests to edit the file
\build\.cmake\api\v1\reply\codemodel-v2-[???].json
and edit the minor version at the bottom of the file from '1' to '0'.It does make the messages disappear for build after this changes, but as this file is generated at configuration, the warning comes back everytime you want to run cmake again...
Also I don't know if this modification breaks anything or not.
UPDATE: when writing this issue and checking my version of cmake, I figured out I was using a release candidate (for some reason it is the first displayed on cmake website and I did not pay attention when I downloaded it). I installed the latest cmake release (3.17.3) instead, and the problem "disappeared".
The text was updated successfully, but these errors were encountered: