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

IntelliSense uses the short name from the variants file for buildType #2120

Closed
ghuser404 opened this issue Sep 12, 2021 · 31 comments
Closed

Comments

@ghuser404
Copy link

I've been having many issues with this extension, and was always hoping it would improve with future versions. The changes came very slowly, but I was still hoping for better. The issues were mostly related to go-to-definition, it either jumped into wrong places or didn't work at all.

With 1.8.1 everything stopped working. All my includes are red-squiggled (except maybe one or two headers, system headers and standard headers), F12 doesn't open those includes, for the most part it doesn't work on function/objects - just says "No definition found for...", but those functions/objects are not even red-squiggled.

I went back to 1.7.3, for now it works for me.
Please let me know how I can assist you in fixing this.

PS. Unfortunately, I can't share the code, it's commercial.

@bobbrow
Copy link
Member

bobbrow commented Sep 13, 2021

Please let me know how I can assist you in fixing this.

We can start by looking at logs. With version 1.8.1 installed, can you:

  1. Open the source file with red squiggles in it
  2. Run the C/C++: Log Diagnostics command and paste it here?
    a. If any of the paths or project information cannot be shared in this forum, please redact/rename that information before sharing.

Please also share which version of CMake you are using and your operating system.

@bobbrow bobbrow added Feature: cpptools integration more info needed More info is needed from the community for us to properly triage and investigate. labels Sep 13, 2021
@ghuser404
Copy link
Author

CMake 3.21.1
Windows 10 19043

1.8.1

-------- Diagnostics - 13/09/2021, 20:59:11
Version: 1.6.0
Current Configuration:
{
    "name": "CMake",
    "configurationProvider": "ms-vscode.cmake-tools",
    "compilerPathIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "intelliSenseModeIsExplicit": false,
    "includePath": [
        "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/include/*",
        "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/atlmfc/include/*",
        "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/um",
        "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/ucrt",
        "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/shared",
        "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/winrt",
        "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/cppwinrt"
    ],
    "macFrameworkPath": [],
    "windowsSdkVersion": "10.0.18362.0",
    "compilerArgs": [],
    "cStandard": "c17",
    "cppStandard": "c++17",
    "intelliSenseMode": "windows-msvc-x64",
    "compilerPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30037\\bin\\Hostx64\\x64\\cl.exe",
    "browse": {
        "path": [
            "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/include/*",
            "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/atlmfc/include/*",
            "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/um",
            "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/ucrt",
            "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/shared",
            "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/winrt",
            "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/cppwinrt",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Custom browse configuration: 
{
    "browsePath": []
}
Translation Unit Mappings:
[ C:\Project\file1.cpp ]:
    C:\PROJECT\FILE1.CPP
Translation Unit Configurations:
[ C:\Project\file1.cpp ]:
    Process ID: 22748
    Memory Usage: 208 MB
    Compiler Path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\Hostx64\x64\cl.exe
    Includes:
        C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.29.30037\INCLUDE
        C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.29.30037\ATLMFC\INCLUDE
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UM
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\SHARED
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\WINRT
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\CPPWINRT
    Standard Version: ms_c++17
    IntelliSense Mode: windows-msvc-x64
Total Memory Usage: 208 MB

1.7.3

-------- Diagnostics - 13/09/2021, 21:12:25
Version: 1.6.0
Current Configuration:
{
    "name": "CMake",
    "configurationProvider": "ms-vscode.cmake-tools",
    "compilerPathIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "intelliSenseModeIsExplicit": false,
    "includePath": [
        "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/include/*",
        "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/atlmfc/include/*",
        "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/um",
        "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/ucrt",
        "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/shared",
        "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/winrt",
        "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/cppwinrt"
    ],
    "macFrameworkPath": [],
    "windowsSdkVersion": "10.0.18362.0",
    "compilerArgs": [],
    "cStandard": "c17",
    "cppStandard": "c++17",
    "intelliSenseMode": "windows-msvc-x64",
    "compilerPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30037\\bin\\Hostx64\\x64\\cl.exe",
    "browse": {
        "path": [
            "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/include/*",
            "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/atlmfc/include/*",
            "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/um",
            "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/ucrt",
            "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/shared",
            "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/winrt",
            "C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/cppwinrt",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Custom browse configuration: 
{
    "browsePath": [
        :::many-project-include-paths:::
    ],
    "compilerPath": "c:/program files (x86)/microsoft visual studio/2019/community/vc/tools/msvc/14.16.27023/bin/hostx64/x86/cl.exe",
    "compilerArgs": []
}
Custom configurations:
[ C:\Project\file1.cpp ]
{
    "defines": [
        :::many-project-defines:::
        "NDEBUG",
        "NDEBUG=1",
        "UNICODE",
        "_NDEBUG=1",
        "_UNICODE",
        "_WIN32",
        "WIN32",
        "_WINDOWS",
        "NDEBUG"
    ],
    "standard": "c++17",
    "includePath": [
        :::many-project-include-paths:::
    ],
    "compilerPath": "c:/program files (x86)/microsoft visual studio/2019/community/vc/tools/msvc/14.16.27023/bin/hostx64/x86/cl.exe",
    "compilerArgs": [
        "/DWIN32",
        "/D_WINDOWS",
        "/W3",
        "/GR",
        "/EHsc",
        "/MD",
        "/Zi",
        "/O2",
        "/Ob1",
        "/DNDEBUG",
        "/w15038",
        "-MT",
        "/W3",
        "/bigobj",
        "/Ox",
        "/MP",
        "/EHsc",
        "-std:c++17"
    ]
}
Translation Unit Mappings:
[ C:\Project\file1.cpp ]:
    C:\PROJECT\FILE1.CPP
Translation Unit Configurations:
[ C:\Project\file1.cpp ]: not ready
    Process ID: 13052
    Memory Usage: 328 MB
    Compiler Path: c:/program files (x86)/microsoft visual studio/2019/community/vc/tools/msvc/14.16.27023/bin/hostx64/x86/cl.exe
    Includes:
        :::many-project-include-paths:::
        C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.16.27023\INCLUDE
        C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.16.27023\ATLMFC\INCLUDE
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UM
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\SHARED
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\WINRT
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\CPPWINRT
    Defines:
        :::many-project-defines:::
        NDEBUG
        NDEBUG=1
        UNICODE
        _NDEBUG=1
        _UNICODE
        _WIN32
        WIN32
        _WINDOWS
        NDEBUG
        WIN32
        _WINDOWS
        NDEBUG
    Standard Version: ms_c++17
    IntelliSense Mode: windows-msvc-x64
    Other Flags:
        --rtti
Total Memory Usage: 328 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 10749

@bobbrow
Copy link
Member

bobbrow commented Sep 13, 2021

Ok, so the extension doesn't seem to be sending the configuration over to cpptools. Can you set the cmake.loggingLevel setting to "debug" and then reload the window? Then copy/paste the "CMake/Build" log from the OUTPUT window once the file with squiggles in it loads. (again, redact any paths you don't want to share)

@ghuser404
Copy link
Author

Let me know if I strip too much.

1.8.1

[extension] [4365] cmake.setVariant started
[main] Active build variant changed
[driver] Setting new variant DEBUG
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[main] Configuring folder: pluginpackage 
[main] Saving open files before configure/build
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[driver] Start configure 
[driver] Runnnig pre-configure checks and steps
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[cmakefileapi-driver] Configuring using kit
[cmakefileapi-driver] Invoking CMake C:\Program Files\CMake\bin\cmake.EXE with arguments [:::many-args:::]
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" :::many-args:::
[cmake] Not searching for unused variables given on the command line.
[cmake] -- The C compiler identification is MSVC 19.16.27045.0
[cmake] -- The CXX compiler identification is MSVC 19.16.27045.0
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - done
[cmake] -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x86/cl.exe - skipped
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - done
[cmake] -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x86/cl.exe - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] -- *************************************************************************
[cmake] The Crypto++ library does not officially support CMake. CMake support is a
[cmake] community effort, and the library works with the folks using CMake to help
[cmake] improve it. If you find an issue then please fix it or report it at
[cmake] https://github.com/noloader/cryptopp-cmake.
[cmake] -- *************************************************************************
[cmake] -- The ASM_MASM compiler identification is MSVC
[cmake] -- Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x86/ml.exe
[cmake] -- Looking for pthread.h
[cmake] -- Looking for pthread.h - not found
[cmake] -- Found Threads: TRUE  
[cmake] -- Native arch: FALSE
[cmake] -- Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x86/cl.exe
[cmake] -- Flags: /DWIN32 /D_WINDOWS /W3 /GR /EHsc /FI"winapifamily.h"
[cmake] -- Build type: 
[cmake] -- Using the multi-header code from C:/Project/include/
[cmake] -- Looking for _M_AMD64
[cmake] -- Looking for _M_AMD64 - not found
[cmake] -- Looking for _M_IX86
[cmake] -- Looking for _M_IX86 - found
[cmake] -- Configuring juceaide
[cmake] -- Building juceaide
[cmake] -- Exporting juceaide
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: C:/Project/build
[cmakefileapi-parser] Read reply folder: c:\Project\build\.cmake\api\v1\reply
[cmakefileapi-parser] Found index files: [:::many-index-files:::]
[cache] Reading CMake cache file c:/Project/build/CMakeCache.txt
[cache] Parsing CMake cache string
[extension] [4365] cmake.setVariant finished (returned 0)

1.7.3

[extension] [7753] cmake.setVariant started
[main] Active build variant changed
[main] Configuring folder: pluginpackage 
[main] Saving open files before configure/build
[main] Starting new CMake driver
[main] Starting CMake driver
[main] Using generator from user configuration: Visual Studio 16 2019
[cmakefileapi-driver] Creating instance of CMakeFileApiDriver
[driver] Initializating base driver using kit
[driver] CMakeDriver Kit set to Visual Studio Community 2019 Release - x86
[kit] OK running C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat x86, env vars: [:::many-env-vars:::]
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[driver] Setting new variant DEBUG
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[driver] Setting new variant DEBUG
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[driver] Start configure 
[driver] Runnnig pre-configure checks and steps
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[cmakefileapi-driver] Configuring using kit
[cmakefileapi-driver] Invoking CMake C:\Program Files\CMake\bin\cmake.EXE with arguments [:::many-args:::]
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" :::many-args:::
[cmake] Not searching for unused variables given on the command line.
[cmake] -- The C compiler identification is MSVC 19.16.27045.0
[cmake] -- The CXX compiler identification is MSVC 19.16.27045.0
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - done
[cmake] -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x86/cl.exe - skipped
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - done
[cmake] -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x86/cl.exe - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] -- *************************************************************************
[cmake] The Crypto++ library does not officially support CMake. CMake support is a
[cmake] community effort, and the library works with the folks using CMake to help
[cmake] improve it. If you find an issue then please fix it or report it at
[cmake] https://github.com/noloader/cryptopp-cmake.
[cmake] -- *************************************************************************
[cmake] -- The ASM_MASM compiler identification is MSVC
[cmake] -- Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x86/ml.exe
[cmake] -- Looking for pthread.h
[cmake] -- Looking for pthread.h - not found
[cmake] -- Found Threads: TRUE  
[cmake] -- Native arch: FALSE
[cmake] -- Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x86/cl.exe
[cmake] -- Flags: /DWIN32 /D_WINDOWS /W3 /GR /EHsc /FI"winapifamily.h"
[cmake] -- Build type: 
[cmake] -- Using the multi-header code from C:/Project/include/
[cmake] -- Looking for _M_AMD64
[cmake] -- Looking for _M_AMD64 - not found
[cmake] -- Looking for _M_IX86
[cmake] -- Looking for _M_IX86 - found
[cmake] -- Configuring juceaide
[cmake] -- Building juceaide
[cmake] -- Exporting juceaide
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: C:/Project/build
[cmakefileapi-parser] Read reply folder: c:\Project\build\.cmake\api\v1\reply
[cmakefileapi-parser] Found index files: [:::many-index-files:::]
[cache] Reading CMake cache file c:/Project/build/CMakeCache.txt
[cache] Parsing CMake cache string
[extension] [7753] cmake.setVariant finished (returned 0)

@bobbrow
Copy link
Member

bobbrow commented Sep 14, 2021

Hmm... Everything looks normal in those logs. Can you do a search in the c:\Project\build\.cmake\api\v1\reply folder and see if you can find the name of your source file in one of the JSON files that starts with the name 'target'? I don't think there should be a problem there since that's not the extension that writes to that location. It feels to me almost like a "Delete Cache and Reconfigure" should fix it, but I'm not seeing what else could be going wrong here.

I might need to add some additional logging to figure this out since I don't have access to your project.

@ghuser404
Copy link
Author

Yes, the file name is present in the target*.json files.
I am deleting the build folder every time I switch between versions.

@LoSealL
Copy link

LoSealL commented Sep 23, 2021

I also have the excatly same problem, roll back to 1.7.3 works for me

@tntodorov
Copy link

I have the same (or very similar) problem. VSCode 1.60.2, CMake-Tools 1.8.1. Cmake by itself is working fine and my project compiles even though IntelliSense is confused silly. Some additional information:

  • I am using a toolchain file, which sets the compiler.
  • I am using CMakePresets.json, which defines the build configurations (configPresets) and the build environment (buildPresets). The toolchain file is set via CMAKE_TOOLCHAIN_FILE variable in the configPresets.

When I run "CMake: Configure", the command completes successfully. I set cmake.debugLevel to "debug", and here is the output:

[main] Configuring folder: test2_smartblock_f4 
[main] Saving open files before configure/build
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[driver] Start configure 
[driver] Runnnig pre-configure checks and steps
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[cmakefileapi-driver] Configuring using preset
[cmakefileapi-driver] Invoking CMake /usr/bin/cmake with arguments ["-DENABLE_FFT=1","-DENABLE_NATGRID=1","-DENABLE_CHRYSLER=0","-DCMAKE_TOOLCHAIN_FILE=/home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/cmake/toolchain.cmake","-DCMAKE_BUILD_TYPE=Debug","-H/home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4","-B/home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/build/natgrid-debug","-G","Ninja"]
[proc] Executing command: /usr/bin/cmake -DENABLE_FFT=1 -DENABLE_NATGRID=1 -DENABLE_CHRYSLER=0 -DCMAKE_TOOLCHAIN_FILE=/home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/cmake/toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -H/home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4 -B/home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/build/natgrid-debug -G Ninja
[cmake] -- Looking for compiler arm-none-eabi-gcc
[cmake] -- Looking for compiler arm-none-eabi-gcc
[cmake] -- The C compiler identification is GNU 11.2.0
[cmake] -- The CXX compiler identification is GNU 11.2.0
[cmake] -- The ASM compiler identification is GNU
[cmake] -- Found assembler: /usr/bin/arm-none-eabi-gcc
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - done
[cmake] -- Check for working C compiler: /usr/bin/arm-none-eabi-gcc - skipped
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - done
[cmake] -- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++ - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] -- Working with GCC or Clang compiler...
[cmake] -- Working with GCC or Clang compiler...
[cmake] -- Working with GCC or Clang compiler...
[cmake] -- Build options:
[cmake] --   FFT feature
[cmake] --   FFT feature - enabled
[cmake] --   Chrysler functionality
[cmake] --   Chrysler functionality - disabled
[cmake] --   National Grid functionality
[cmake] --   National Grid functionality - enabled
[cmake] -- Build options: - done!
[cmake] -- Git commit version: 0.99.68-3-g7dbcd68
[cmake] -- Git exact tag timestamp: 2021-08-24 00:05:39 -0400
[cmake] -- The current build version is: 0.99.68
[cmake] -- The current build timestamp is: 2021-08-24 00:05:39
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/build/natgrid-debug
[cmakefileapi-parser] Read reply folder: /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/build/natgrid-debug/.cmake/api/v1/reply
[cmakefileapi-parser] Found index files: ["cache-v2-06139602204cf1844aa1.json","codemodel-v2-21b2794f36df783f0063.json","directory-.-Debug-f5ebdc15457944623624.json","directory-libs-Debug-ec580da4e47c3b0e73da.json","directory-libs.fw_fatfs-Debug-70934d314443de5a1c8e.json","directory-libs.fw_freertos-Debug-8dddf8c32b58d3b7bdcd.json","directory-libs.fw_lwip-Debug-df6b036b4767a0239433.json","directory-libs.fw_segger_rtt-Debug-3aada686645560d7008f.json","directory-libs.fw_stemwin_f4-Debug-a6fe67ec59fdf89ac048.json","directory-libs.fw_stm32f4hal-Debug-bacd080bcef5d71ae965.json","directory-libs.fw_stm32f4xx-Debug-3799f3cd38b7f08abcf5.json","directory-libs.fw_usbhost-Debug-9efe42a6abca9bb1583e.json","directory-src-Debug-b6cf2213fc5053b67c22.json","directory-tests-Debug-b01f6abb0ab61427ef3b.json","index-2021-09-24T07-39-21-0341.json","target-fatfs-Debug-4406d4266781c1960bab.json","target-freertos-Debug-ae4130cc98180933833b.json","target-lwip-Debug-6441e53e2c71a9de7fe2.json","target-programmable-Debug-1bd205bc34756883b466.json","target-segger_rtt-Debug-84f7dd55a159b4cf382f.json","target-smartblock.elf-Debug-1bd3ca2926cc9a0f2aa4.json","target-stemwin-Debug-7339daa34537a909a002.json","target-stm32f4hal-Debug-e655ec66744e51d434ca.json","target-stm32f4xx-Debug-9a8d2813aa9005e130fd.json","target-usbhost-Debug-7407241a2e40e1f429e3.json","toolchains-v1-30b993a528d0f357d6e8.json"]
[cache] Reading CMake cache file /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/build/natgrid-debug/CMakeCache.txt
[cache] Parsing CMake cache string
[extension] [4007] cmake.configure finished (returned 0)

FYI, my compiler is installed on the system path, if it makes any difference.

Here is the output of the command "C/C++: Log Diagnostics":

-------- Diagnostics - 9/24/2021, 3:42:05 AM
Version: 1.6.0
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/clang",
    "cStandard": "c17",
    "cppStandard": "c++14",
    "intelliSenseMode": "linux-clang-x64",
    "compilerArgs": [],
    "intelliSenseModeIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "compilerPathIsExplicit": false,
    "configurationProvider": "ms-vscode.cmake-tools",
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Custom browse configuration: 
{
    "browsePath": []
}
Translation Unit Mappings:
[ /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/src/dnp3.c ]:
    /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/src/dnp3.c
Translation Unit Configurations:
[ /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/src/dnp3.c ]:
    Process ID: 1455111
    Memory Usage: 42 MB
    Compiler Path: /usr/bin/clang
    Includes:
        /usr/local/include
        /usr/lib/clang/12.0.1/include
        /usr/include
        /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/libs/fw_lwip/src/include
        /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/libs/fw_stm32f4hal/Inc
        /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/libs/fw_stm32f4xx/RTOS2/Template
        /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/libs/fw_fatfs/src
        /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/libs/fw_segger_rtt/RTT
        /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/libs/fw_stm32f4xx/RTOS2/Include
        /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/libs/fw_lwip/test/unit
        /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/libs/fw_lwip/src/include/lwip
        /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/libs/fw_stm32f4hal/Inc/Legacy
        /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/libs/fw_lwip/system
        /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/libs/fw_stm32f4xx/Device/ST/STM32F4xx/Include
        /home/ttodorov/Documents/work/fischer-block/test2_smartblock_f4/libs/fw_stm32f4xx/Include
    Standard Version: c17
    IntelliSense Mode: linux-clang-x64
    Other Flags:
        --clang
        --clang_version=120001
Total Memory Usage: 42 MB

The used compiler is arm-none-eabi-gcc, which can be confirmed in the first log output above. Somehow IntelliSense insists on using clang. I have no idea where the discrepancy originates. As with other users, downgrading to 1.7.3 fixes the issue. 1.8.0 shows the same behavior as 1.8.1.

@bobbrow
Copy link
Member

bobbrow commented Sep 24, 2021

Thanks for the logs. It think this is the same issue as #2048 and #2105. I'm going to start working on #2139 so that we can get more information from your projects and see what's going on. If any of you are working on an open source project and can point to it, we can also try to debug it that way.

@AtomicVar
Copy link

I also have the same problem, roll back to 1.7.3 works for me.

@bobbrow
Copy link
Member

bobbrow commented Sep 27, 2021

I have a VSIX with the new logging available. You can download it here: https://github.com/microsoft/vscode-cmake-tools/suites/3885617265/artifacts/96792132

Then you just unzip it and run the Install from VSIX... command to install it. After reproducing your issue, run the CMake: Log Diagnostics command and share the output here.

@ghuser404
Copy link
Author

@bobbrow I'm unable to configure my project with the provided VSIX. Rolled back to 1.7.3, and it configures normally.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.Redirect.15.targets(69,5): error MSB8052: MSVC Toolset Version '14.29.30037' is not compatible with 'v141' Platform Toolset. Please either change Platform Toolset to v142 or MSVC Toolset Version (VCToolsVersion property) to the version with the format '14.1*.*'. To use default MSVC Toolset Version for a given Platform Toolset don't set VCToolsVersion property.

@bobbrow
Copy link
Member

bobbrow commented Sep 30, 2021

Can you configure with 1.8.1, but not this VSIX? Did you select a VS 2019 Kit that doesn't have the v141 toolset installed with it?

@ghuser404
Copy link
Author

Yep, I can configure with 1.8.1, but not with VSIX. I'm not changing anything else other than the extensions version, the kit stays the same -Visual Studio Community 2019 Release - x86.

@bobbrow
Copy link
Member

bobbrow commented Sep 30, 2021

Hmm. We didn't change much since 1.8.1, but perhaps it could have been this change: https://github.com/microsoft/vscode-cmake-tools/pull/2089/files. Let me see if I can build you a new VSIX without that to verify.

@bobbrow
Copy link
Member

bobbrow commented Sep 30, 2021

@ghuser404 I tried to repro your issue locally but was unsuccessful. Can you share the full cmake command that the extension uses to configure your project? It was trimmed from your previous comment. You can hide project specific -D args if those are not meant to be shared publicly. And maybe also share the Kit definition. Maybe you're specifying the toolset differently than I am.

@bobbrow
Copy link
Member

bobbrow commented Sep 30, 2021

And here also is a VSIX with #2089 removed in case you think trying that would be faster than trying to help me get a repro on my end.
https://github.com/microsoft/vscode-cmake-tools/suites/3925276658/artifacts/98213355

@ghuser404
Copy link
Author

@bobbrow Yes, this VSIX configures.
I have these in settings.json

"cmake.generator": "Visual Studio 16 2019",
"cmake.platform": "Win32",
"cmake.toolset": "v141"

and this in cmake-variants.json

"CMAKE_SYSTEM_VERSION": "8.1"

@bobbrow
Copy link
Member

bobbrow commented Sep 30, 2021

Great! 👍 If you have a working configuration now, can you send the output of the CMake: Log Diagnostics command after opening the file where IntelliSense is not working so we can see what's going on?

@ghuser404
Copy link
Author

Yep, here is the output of CMake: Log Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.60.2",
  "cmtVersion": "1.8.2-eb64d4a",
  "configurations": [
    {
      "folder": "c:\\Project",
      "cmakeVersion": "3.21.1",
      "configured": true,
      "generator": "Visual Studio 16 2019",
      "usesPresets": false,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": false,
    "requests": [
      "file:///c%3A/Project/file1.cpp"
    ],
    "responses": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": false
    }
  ]
}

@bobbrow
Copy link
Member

bobbrow commented Sep 30, 2021

Ok. So you've configured the project but the code model wasn't loaded. Do you still have the files mentioned in your previous logs on disk?

[cmakefileapi-parser] Read reply folder: c:\Project\build\.cmake\api\v1\reply
[cmakefileapi-parser] Found index files: [:::many-index-files:::]

Does that folder exist and are there several JSON files in it?

@ghuser404
Copy link
Author

Yeah, there is a mention in target-*.json

{
    "backtrace" : 22,
    "compileGroupIndex" : 0,
    "path" : "file1.cpp",
    "sourceGroupIndex" : 7
}

@bobbrow
Copy link
Member

bobbrow commented Oct 1, 2021

I got a repro with the settings you shared. We should be able to debug this locally now. You can ignore my previous questions. 😄

@andreeis andreeis removed the more info needed More info is needed from the community for us to properly triage and investigate. label Oct 1, 2021
@andreeis andreeis added this to the On Deck milestone Oct 11, 2021
@bobbrow
Copy link
Member

bobbrow commented Oct 15, 2021

Unfortunately, I was incorrect about getting a repro for this case. I did fix the other thing about the v141 toolset though. One thing I missed from your log earlier is that the extension thinks you have no targets. How do you configure your project such that there are no targets? I'm not sure how a target-*.json would be generated if there are no targets. Unless this is another manifestation of problems that occur when CMAKE_BUILD_TYPE changes in the CMakeLists.txt and doesn't match what's set in the status bar. (I have issue #2096 open to add a warning as this messes up some things in the extension)

@ghuser404
Copy link
Author

@bobbrow I'm using many different variants with various arguments. I can confirm that if I name a variant plain "Debug", then everything works fine. Although I wouldn't say I'm doing something wrong here. My variants look something like this:

"<some-name>": {
    "short": "<some name that is not plain Debug>",
    "buildType": "Debug",
    "settings": {
        <some-settings>
    }
}

As you can see I'm using "short", but not using "long" here. If "short" isn't equal to "Debug", then IntelliSense fails. I tried using "short": "Debug", "long": "<some name that is not plain Debug>", and it works. However, I don't think that it works as intended, as I could have any name in "short" in 1.7.3.

Anyway, well done on finding this issue! Hopefully this can be fixed soon'ish.

PS. Please let me know if you can repro this. Thanks!

@bobbrow
Copy link
Member

bobbrow commented Oct 21, 2021

Thanks for the info about your variants and I'm glad to hear that there's a temporary workaround! I just got another response on one of the other similar issues (#2105) that their problem is with variants as well. We'll debug this a bit more now that we know where to look. The fix probably won't make it to 1.9.1, but I'll post a VSIX here or we'll schedule a 1.9.2 for this one once we have a fix.

@andreeis
Copy link
Contributor

@ghuser404, @ZJUGuoShuai, @tntodorov, @LoSealL, we just released CMake Tools 1.9.1 today which may fix the problems that you are seeing. We can't confirm exactly if that is the case since we don't have a repro but we addressed several issues that look related to what is described in this bug report. Can you upgrade the CMT extension in VSCode and let us know if this problem was fixed or if you encounter any other issues? We are not closing this until we hear from you.

@ghuser404
Copy link
Author

ghuser404 commented Oct 25, 2021

@andreeis I can confirm the fix works. However... I think the message is somewhat misleading... So if the short name for my variant is "this-is-short-name-for-my-variant", then the following message appears

[cpptools] The build configurations generated do not contain the active build configuration. Using 'Debug' for CMAKE_BUILD_TYPE instead of 'this-is-short-name-for-my-variant' to ensure that IntelliSense configurations can be found

IMO, the extension should not care about what name I choose for the variant, currently it mistakenly tries using it for CMAKE_BUILD_TYPE.

@bobbrow
Copy link
Member

bobbrow commented Oct 25, 2021

We will fix the short name bug too. The time was tight though and I didn't have a chance to investigate the root cause of your issue. @andreeis we'll make this bug about the short name being used instead of the buildType when variants are used.

@bobbrow bobbrow changed the title IntelliSense stopped working with 1.8.1 IntelliSense uses the short name from the variants file for buildType Oct 25, 2021
gost-serb added a commit to gost-serb/vscode-cmake-tools that referenced this issue Nov 16, 2021
IntelliSense now uses buidType from variants file instead of short name
bobbrow pushed a commit that referenced this issue Nov 24, 2021
IntelliSense now uses buidType from variants file instead of short name
@bobbrow
Copy link
Member

bobbrow commented Nov 24, 2021

We plan to release the fix for the short name bug on Monday. If you would like to verify the fix in a pre-release version of the extension, please do the following:

  1. Download the VSIX here: https://github.com/microsoft/vscode-cmake-tools/suites/4455203062/artifacts/118295075
  2. Unzip the VSIX file from the archive
  3. Invoke the Install from VSIX... command in VS Code and select the VSIX file from step 2.

@bobbrow
Copy link
Member

bobbrow commented Nov 29, 2021

The fix for this has been released in 1.9.2.

@bobbrow bobbrow closed this as completed Nov 29, 2021
@bobbrow bobbrow modified the milestones: On Deck, 1.9.2 Dec 20, 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

6 participants