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

The configuration provider sends msvc intelliSenseMode for IAR compiler #1096

Open
pfox89 opened this issue Feb 25, 2020 · 12 comments
Open

The configuration provider sends msvc intelliSenseMode for IAR compiler #1096

pfox89 opened this issue Feb 25, 2020 · 12 comments
Labels
embedded enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: cpptools integration Feature: settings stale-exempt to use with close-stale-issues and close-old-issues bot
Milestone

Comments

@pfox89
Copy link

pfox89 commented Feb 25, 2020

Brief Issue Summary

When a compiler cmake-tools is not familiar with is used by CMake (e.g. an embedded compiler with a custom toolchain file), it ignores all other settings and defaults to the MSVC Intellisense mode on Windows. This is usually undesirable, since embedded code is not generally compatible with MSVC.

Expected:

There should be a way to manually override the intellisense settings on a project basis (possibly in cmake-kits.json?) so it can be used as a configuration provider even if the compiler being used by cmake is not supported.

C/C++ log file

In the log below it can be seen that the settings specified in c_cpp_properties.json are not respected and msvc intellisense mode is used when the IAR compiler is specified by a cmake toolchain.

-------- Diagnostics - 2/25/2020, 2:51:31 PM
Version: 0.26.3
Current Configuration:
{
    "name": "Win32",
    "includePath": [
        "${workspaceFolder}/**",
        "${workspaceFolder}/drivers/Include/**",
        "${workspaceFolder}/drivers/netx_drv/Include/**"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "compilerPath": "C:\\Program Files (x86)\\GNU Tools Arm Embedded\\9 2019-q4-major\\bin\\arm-none-eabi-gcc.exe",
    "intelliSenseMode": "gcc-x64",
    "compilerArgs": [
        "-mthumb ",
        "-mcpu=cortex-m4"
    ],
    "configurationProvider": "vector-of-bool.cmake-tools",
    "browse": {
        "path": [
            "${workspaceFolder}/**",
            "${workspaceFolder}/drivers/Include/**",
            "${workspaceFolder}/drivers/netx_drv/Include/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Translation Unit Configurations:
[ C:\Users\pfox\ESeries\Firmware\firmware\CMSIS\Include\cmsis_iccarm.h ]:
    Process ID: 28372
    Memory Usage: 16 MB
    Compiler Path: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
    Includes:
        C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/include/*
        C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/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: msvc-x64
    Other Flags:
        --header_only_fallback
Total Memory Usage: 16 MB

Other Notes/Information

Clang may be a better fallback if the compiler can't be identified, since it's probably the most broadly compatible.

@andreeis
Copy link
Contributor

andreeis commented Mar 6, 2020

Easy to change the default. We could also add a new setting for this.

@andreeis andreeis added enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: cpptools integration Feature: settings labels Mar 6, 2020
@andreeis andreeis added this to the 1.4.0 milestone Mar 6, 2020
@andreeis
Copy link
Contributor

andreeis commented Mar 6, 2020

Also, can you run your scenario again, after setting the CppTools logging level to "debug" (https://code.visualstudio.com/docs/cpp/enable-logging-cpp) and share with us the configurations sent by CMake Tools to CppTools? Look for "custom configurations received". You can also share the whole log and we will parse through it for helpful information.
It could be a bug in CppTools and not in CMake Tools.

@andreeis andreeis added the more info needed More info is needed from the community for us to properly triage and investigate. label Apr 1, 2020
@andreeis
Copy link
Contributor

andreeis commented Apr 1, 2020

Let us know if this is still an issue for you. If it is, please provide the logs (as explained above).

@andreeis andreeis closed this as completed Apr 1, 2020
@pfox89
Copy link
Author

pfox89 commented Apr 1, 2020

OK, I have gotten a log. I've had to blank out some file names and private information, but that is mostly not relevant to this issue:

-------- Diagnostics - 4/1/2020, 2:14:26 PM
Version: 0.27.0
Current Configuration:
{
    "name": "Win32",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "windowsSdkVersion": "10.0.18362.0",
    "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe",
    "cStandard": "c11",
    "cppStandard": "c++17",
    "intelliSenseMode": "msvc-x64",
    "compilerArgs": [],
    "configurationProvider": "vector-of-bool.cmake-tools",
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
No active translation units.

-------- Diagnostics - 4/1/2020, 2:14:40 PM
Version: 0.27.0
Current Configuration:
{
    "name": "Win32",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "windowsSdkVersion": "10.0.18362.0",
    "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe",
    "cStandard": "c11",
    "cppStandard": "c++17",
    "intelliSenseMode": "msvc-x64",
    "compilerArgs": [],
    "configurationProvider": "vector-of-bool.cmake-tools",
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Translation Unit Mappings:
[ ***\main.c ]:
    ***\MAIN.C
Translation Unit Configurations:
[ ***\main.c ]:
    Process ID: 7572
    Memory Usage: 56 MB
    Includes:
        *******
    Defines:
        *****
    Standard Version: c11
    IntelliSense Mode: msvc-x64
Total Memory Usage: 56 MB

@bobbrow
Copy link
Member

bobbrow commented Apr 1, 2020

Unfortunately, this is not the log we are looking for. We need you to turn on the C_Cpp.loggingLevel setting and look in the Output window for the "custom configurations received" so we can see if CMake Tools is sending the right compiler info.

https://code.visualstudio.com/docs/cpp/enable-logging-cpp

@pfox89
Copy link
Author

pfox89 commented Apr 1, 2020

My workspace config is as follows:

{
	"folders": [
		{
			"path": "."
		}
	],
	"settings": {
		"C_Cpp.loggingLevel": "Debug"
	}
}

I'm not seeing any output with "custom configurations received" in the Output Window. Is some other step required to get this?

@pfox89
Copy link
Author

pfox89 commented Apr 1, 2020

Maybe this is what you're looking for?

Custom browse configuration received: {
  "browsePath": [
    *****
  ],
  "standard": "c++17",
  "compilerPath": "C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.4/arm/bin/iccarm.exe",
  "compilerArgs": []
}
cpptools/didChangeCppProperties
  Folder: C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2019/PROFESSIONAL/VC/TOOLS/MSVC/14.24.28314/INCLUDE/* will be indexed
  Folder: C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2019/PROFESSIONAL/VC/TOOLS/MSVC/14.24.28314/ATLMFC/INCLUDE/* will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.18362.0/UM/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.18362.0/UCRT/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.18362.0/SHARED/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.18362.0/WINRT/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.18362.0/CPPWINRT/ will be indexed
  Folder: **** will be indexed
cpptools/clearCustomConfigurations
cpptools/clearCustomConfigurations
cpptools/didChangeCustomBrowseConfiguration
Attempting to get defaults from compiler in "compilerPath" property: 'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.4/arm/bin/iccarm.exe'
Failed to query compiler. Falling back to 32-bit intelliSenseMode.
Failed to query compiler. Falling back to no bitness.
Command line error: Unexpected command line arguments:
            -Wp,-v
            -E
            -dD
            -x

Attempting to get defaults from compiler found on the machine: 'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.4/arm/bin/iccarm.exe'
No suitable compiler found. Please set the "compilerPath" in c_cpp_properties.json.
  Folder: ***** will be indexed
cpptools/resumeParsing
cpptools/didChangeCustomBrowseConfiguration
Populate include completion cache.
Discovering files...
Attempting to get defaults from compiler found on the machine: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe'
  Processing folder (recursive): *****
  Folder: C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2019/PROFESSIONAL/VC/TOOLS/MSVC/14.24.28314/INCLUDE/* will be indexed
  Folder: C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2019/PROFESSIONAL/VC/TOOLS/MSVC/14.24.28314/ATLMFC/INCLUDE/* will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.18362.0/UM/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.18362.0/UCRT/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.18362.0/SHARED/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.18362.0/WINRT/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.18362.0/CPPWINRT/ will be indexed
  Folder: ***** will be indexed
cpptools/resumeParsing

@pfox89
Copy link
Author

pfox89 commented Apr 1, 2020

OK, I think I was able to get the full output from a test project:

initialized
cpptools/queryCompilerDefaults (id: 1)
Attempting to get defaults from compiler found on the machine: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe'
Attempting to get defaults from compiler found on the machine: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe'
cpptools/didChangeCppProperties
No suitable compiler found. Please set the "compilerPath" in c_cpp_properties.json.
Code browsing service initialized
No suitable compiler found. Please set the "compilerPath" in c_cpp_properties.json.
  Folder: C:/USERS/PFOX/TESTPROJECT/ will be indexed
textDocument/didOpen: file:///c%3A/Users/pfox/TestProject/main.cpp
Populate include completion cache.
Discovering files...
cpptools/activeDocumentChange: file:///c%3A/Users/pfox/TestProject/main.cpp
cpptools/textEditorSelectionChange
cpptools/getDocumentSymbols: file:///c%3A/Users/pfox/TestProject/main.cpp (id: 2)
cpptools/clearCustomConfigurations
cpptools/getDocumentSymbols
Checking for syntax errors: file:///c%3A/Users/pfox/TestProject/main.cpp
  Processing folder (recursive): C:/USERS/PFOX/TESTPROJECT/
  Discovering files: 65 file(s) processed
  0 file(s) removed from database
Done discovering files.
Parsing remaining files...
  Parsing: 0 files(s) processed
Done parsing remaining files.
sending compilation args for C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
  include: C:\Users\pfox\TestProject
  define: _DEBUG
  define: UNICODE
  define: _UNICODE
  other: --g++
  other: --gnu_version=80100
  stdver: c++17
  intelliSenseMode: gcc-x86
cpptools/getDocumentSymbols: file:///c%3A/Users/pfox/TestProject/main.cpp (id: 3)
cpptools/getDocumentSymbols
idle loop: reparsing the active document
Checking for syntax errors: file:///c%3A/Users/pfox/TestProject/main.cpp
Shutting down IntelliSense server: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
Closing the communication channel.
sending compilation args for C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
  include: C:\Users\pfox\TestProject
  define: _DEBUG
  define: UNICODE
  define: _UNICODE
  other: --g++
  other: --gnu_version=80100
  stdver: c++17
  intelliSenseMode: gcc-x86
cpptools/getDocumentSymbols: file:///c%3A/Users/pfox/TestProject/main.cpp (id: 4)
cpptools/getDocumentSymbols
Queueing IntelliSense update for files in translation unit of: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
Queueing IntelliSense update for files in translation unit of: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 4
Error squiggles will be disabled in: file:///c%3A/Users/pfox/TestProject/main.cpp
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 4
Update IntelliSense time (sec): 1.303
cpptools/fileCreated: file:///c%3A/Users/pfox/TestProject/build/.cmake/api/v1/reply/index-2020-04-01T19-32-05-0755.json
cpptools/fileDeleted: file:///c%3A/Users/pfox/TestProject/build/.cmake/api/v1/reply/index-2020-04-01T19-28-19-0522.json
Custom configuration provider 'CMake Tools' registered
cpptools/pauseParsing
cpptools/clearCustomConfigurations
Closing the communication channel.
Shutting down IntelliSense server: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
Checking for syntax errors: file:///c%3A/Users/pfox/TestProject/main.cpp
cpptools/queryTranslationUnitSource: file:///c%3A/Users/pfox/TestProject/main.cpp (id: 5)
Custom configurations received:
  uri: file:///c%3A/Users/pfox/TestProject/main.cpp
  config: {
  "defines": [
    "ARM_MATH_CM4",
    "netx90_app",
    "RAMFUNCTION="
  ],
  "standard": "c++17",
  "includePath": [],
  "intelliSenseMode": "msvc-x64",
  "compilerPath": "C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.4/arm/bin/iccarm.exe",
  "compilerArgs": [
    "--cpu",
    "Cortex-M4F",
    "--fpu",
    "VFPv4_sp",
    "-e",
    "--c++",
    "--enable_restrict",
    "--dlib_config",
    "normal",
    "--silent",
    "-On",
    "--debug",
    "-DRAMFUNCTION=",
    "-e"
  ]
}
cpptools/didChangeCustomConfiguration
Attempting to get defaults from compiler in "compilerPath" property: 'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.4/arm/bin/iccarm.exe'
sending compilation args for C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
  include: C:\Users\pfox\TestProject
  define: _DEBUG
  define: UNICODE
  define: _UNICODE
  other: --g++
  other: --gnu_version=80100
  stdver: c++17
  intelliSenseMode: gcc-x86
Failed to query compiler. Falling back to 32-bit intelliSenseMode.
Queueing IntelliSense update for files in translation unit of: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
Failed to query compiler. Falling back to no bitness.
Command line error: Unexpected command line arguments:
            -Wp,-v
            -E
            -dD
            -x

Attempting to get defaults from compiler found on the machine: 'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.4/arm/bin/iccarm.exe'
No suitable compiler found. Please set the "compilerPath" in c_cpp_properties.json.
Checking for syntax errors: file:///c%3A/Users/pfox/TestProject/main.cpp
cpptools/resumeParsing
cpptools/clearCustomConfigurations
Checking for syntax errors: file:///c%3A/Users/pfox/TestProject/main.cpp
cpptools/queryTranslationUnitSource: file:///c%3A/Users/pfox/TestProject/main.cpp (id: 6)
Custom configurations received:
  uri: file:///c%3A/Users/pfox/TestProject/main.cpp
  config: {
  "defines": [
    "ARM_MATH_CM4",
    "netx90_app",
    "RAMFUNCTION="
  ],
  "standard": "c++17",
  "includePath": [],
  "intelliSenseMode": "msvc-x64",
  "compilerPath": "C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.4/arm/bin/iccarm.exe",
  "compilerArgs": [
    "--cpu",
    "Cortex-M4F",
    "--fpu",
    "VFPv4_sp",
    "-e",
    "--c++",
    "--enable_restrict",
    "--dlib_config",
    "normal",
    "--silent",
    "-On",
    "--debug",
    "-DRAMFUNCTION=",
    "-e"
  ]
}
cpptools/didChangeCustomConfiguration
Attempting to get defaults from compiler found on the machine: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe'
Checking for syntax errors: file:///c%3A/Users/pfox/TestProject/main.cpp
cpptools/resumeParsing
sending compilation args for C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PROFESSIONAL\VC\TOOLS\MSVC\14.24.28314\INCLUDE
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PROFESSIONAL\VC\TOOLS\MSVC\14.24.28314\ATLMFC\INCLUDE
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UM
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\SHARED
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\WINRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\CPPWINRT
  define: ARM_MATH_CM4
  define: netx90_app
  define: RAMFUNCTION=
  stdver: ms_c++17
  intelliSenseMode: msvc-x64
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 4
Error squiggles will be disabled in: file:///c%3A/Users/pfox/TestProject/main.cpp
Shutting down IntelliSense server: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
Shutting down IntelliSense server: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
Closing the communication channel.
Closing the communication channel.
sending compilation args for C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PROFESSIONAL\VC\TOOLS\MSVC\14.24.28314\INCLUDE
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PROFESSIONAL\VC\TOOLS\MSVC\14.24.28314\ATLMFC\INCLUDE
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UM
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\SHARED
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\WINRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\CPPWINRT
  define: ARM_MATH_CM4
  define: netx90_app
  define: RAMFUNCTION=
  stdver: ms_c++17
  intelliSenseMode: msvc-x64
Shutting down IntelliSense server: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
Closing the communication channel.
sending compilation args for C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PROFESSIONAL\VC\TOOLS\MSVC\14.24.28314\INCLUDE
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PROFESSIONAL\VC\TOOLS\MSVC\14.24.28314\ATLMFC\INCLUDE
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UM
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\SHARED
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\WINRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\CPPWINRT
  define: ARM_MATH_CM4
  define: netx90_app
  define: RAMFUNCTION=
  stdver: ms_c++17
  intelliSenseMode: msvc-x64
Shutting down IntelliSense server: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
Closing the communication channel.
sending compilation args for C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PROFESSIONAL\VC\TOOLS\MSVC\14.24.28314\INCLUDE
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PROFESSIONAL\VC\TOOLS\MSVC\14.24.28314\ATLMFC\INCLUDE
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UM
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\SHARED
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\WINRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\CPPWINRT
  define: ARM_MATH_CM4
  define: netx90_app
  define: RAMFUNCTION=
  stdver: ms_c++17
  intelliSenseMode: msvc-x64
Shutting down IntelliSense server: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
Closing the communication channel.
sending compilation args for C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PROFESSIONAL\VC\TOOLS\MSVC\14.24.28314\INCLUDE
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PROFESSIONAL\VC\TOOLS\MSVC\14.24.28314\ATLMFC\INCLUDE
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UM
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\SHARED
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\WINRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\CPPWINRT
  define: ARM_MATH_CM4
  define: netx90_app
  define: RAMFUNCTION=
  stdver: ms_c++17
  intelliSenseMode: msvc-x64
Queueing IntelliSense update for files in translation unit of: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
Queueing IntelliSense update for files in translation unit of: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
Queueing IntelliSense update for files in translation unit of: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 0
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 0
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 0
Update IntelliSense time (sec): 2.868
Database safe to open
cpptools/textEditorSelectionChange
cpptools/getCodeActions: file:///c%3A/Users/pfox/TestProject/main.cpp (id: 7)
cpptools/activeDocumentChange: file:///c%3A/Users/pfox/TestProject/main.cpp
cpptools/textEditorSelectionChange
cpptools/getDocumentSymbols: file:///c%3A/Users/pfox/TestProject/main.cpp (id: 8)
cpptools/textEditorSelectionChange
cpptools/getDocumentSymbols
idle loop: reparsing the active document
Checking for syntax errors: file:///c%3A/Users/pfox/TestProject/main.cpp
Queueing IntelliSense update for files in translation unit of: C:\USERS\PFOX\TESTPROJECT\MAIN.CPP
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 0
Update IntelliSense time (sec): 0.252

From this it looks like "intelliSenseMode": "msvc-x64" is in the configuration that cmake-tools sends to C/C++. It does also send a compiler path, which C/C++ tries to query, but fails because the compiler is not supported.

@bobbrow
Copy link
Member

bobbrow commented Apr 1, 2020

Thank you. This log helps a lot. I thought you were using C:\\Program Files (x86)\\GNU Tools Arm Embedded\\9 2019-q4-major\\bin\\arm-none-eabi-gcc.exe which I expected would be supported. The IAR compiler isn't supported yet.

@bobbrow bobbrow reopened this Apr 1, 2020
@bobbrow bobbrow changed the title Intellisense autoconfiguration defaults to MSVC always if compiler cannot be identified The configuration provider sends msvc intelliSenseMode for IAR compiler Apr 1, 2020
@bobbrow bobbrow removed the more info needed More info is needed from the community for us to properly triage and investigate. label Apr 1, 2020
@pfox89
Copy link
Author

pfox89 commented Apr 1, 2020

Sorry, yes, I actually did try to specify the arm-none-eabi-gcc compiler in my c_cpp_properties.json in hopes that it would use that as a fallback, but it only appears to do that sometimes.

It looks like if I change that after doing the CMake config, it takes until the next time I configure or reopen VS Code, so I think cmake-tools is overriding that setting with the IAR compiler path, which doesn't configure correctly.

What I'd like to be able to do is to have cmake-tools fall back to a manual configuration for the compiler if the compiler is not supported instead of pushing an unsupported config which will break Intellisense.

@bobbrow
Copy link
Member

bobbrow commented Apr 1, 2020

What you may need to do for the time being is use compile_commands.json instead of the configuration provider. CMake Tools should generate this file for you. When you use compile_commands.json, you can override the compiler with the value in compilerPath and hopefully that will get things to start working for you until we come up with a plan for IAR.

@bobbrow bobbrow modified the milestones: 1.4.0, 1.5.0 May 7, 2020
@aleun aleun added the embedded label Dec 10, 2020
@bobbrow bobbrow modified the milestones: 1.6.0, 1.7.0 Feb 16, 2021
@bobbrow bobbrow modified the milestones: 1.7.0, 1.8.0 Apr 23, 2021
@bobbrow bobbrow added this to Triage in 1.8.0 May 24, 2021
@bobbrow bobbrow removed this from the 1.8.0 milestone Aug 17, 2021
@bobbrow bobbrow added this to the 1.9.0 milestone Aug 17, 2021
@bobbrow bobbrow modified the milestones: 1.9.0, Backlog Oct 19, 2021
@github-actions
Copy link

This issue is now marked as 'stale-old' due to there being no activity on it for the past 720 days. Unless the 'stale-old' label is removed or the issue is commented on, this will be remain open for at least 14 days and then it may be closed. If you would like to make this issue exempt from getting stale, please add the 'stale-exempt' label.

@github-actions github-actions bot added the stale-old to use with the close-old-issues bot label Oct 19, 2023
@snehara99 snehara99 added the stale-exempt to use with close-stale-issues and close-old-issues bot label Nov 14, 2023
@github-actions github-actions bot removed the stale-old to use with the close-old-issues bot label Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedded enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: cpptools integration Feature: settings stale-exempt to use with close-stale-issues and close-old-issues bot
Projects
Status: Pending Prioritization
Development

No branches or pull requests

5 participants