Open ddignam opened 1 month ago
So, I think I've found the issue, in 1.19.9 paths are resolved relative to the workspace folder, so this entry in compile_commands.json works:
[
{
"directory": "XBYCSCommands/XBYCSCommandOperations.m/src",
"file": "XBYCSCutSlotOperation.cpp",
"command": "cl /DCNEXT_CLIENT /DNATIVE_EXCEPTION /DOS_Windows_NT /DPLATEFORME_DS64 /DUNICODE /DWIN64 /DWINVER=0x0601 /D_AFXDLL /D_AMD64_=1 /D_CAT_ANSI_STREAMS /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_DS_PLATEFORME_64 /D_ENDIAN_LITTLE /D_LANGUAGE_CPLUSPLUS /D_MFC_VER=0x0E00 /D_MK_CONTNAME_=XBYCSCommandOperations /D_MK_FWNAME_=XBYCSCommands /D_MK_MODNAME_=XBYCSCommandOperations /D_UNICODE /D_WIN32_WINNT=0x0601 /D_WIN64 /D_WINDOWS /D_WINDOWS_SOURCE /D_WINNT_SOURCE /D__XBYCSCommandOperations /EHs /FIE:\\ws\\prereqs\\r426_debug\\.\\BSFBuildtimeData\\PublicInterfaces\\CATIAV5Precompiled.h /FIE:\\ws\\prereqs\\r426_debug\\.\\BSFBuildtimeData\\PublicInterfaces\\CATWarningPromote.h /GS- /MD /Od /W3 /Zc:__cplusplus /Zc:forScope /Zc:wchar_t /Zi /permissive- /std:c++20 /w14239 /wd4251 /wd4290 /D_MK_FWNAME_=XBYCSCommands /D_MK_MODNAME_=XBYCSCommandOperations /D_MK_CONTNAME_=XBYCSCommandOperations /I./XBYCSCommands/XBYCSCommandOperations.m/src /I./XBYCSCommands/XBYCSCommandOperations.m/LocalInterfaces /I./XBYCSCommands/XBYCSCommandOperations.m/LocalGenerated/win_b64 /I./XBYCSCommands/PrivateInterfaces /I./XBYCSCommands/ProtectedInterfaces /I./XBYCSCommands/ImportedInterfaces/win_b64 /IE:/ws/tools/mkmk/r426/win_b64/tools/include/Windows /IE:/ws/tools/mkmk/r426/win_b64/tools/include XBYCSCutSlotOperation.cpp"
}
]
It fails in 1.20.5, but can be fixed by having the fully resolved paths:
[
{
"directory": "E:/ws/3dbyme/XBYCSCommands/XBYCSCommandOperations.m/src/",
"file": "XBYCSCutSlotOperation.cpp",
"command": "cl /DCNEXT_CLIENT /DNATIVE_EXCEPTION /DOS_Windows_NT /DPLATEFORME_DS64 /DUNICODE /DWIN64 /DWINVER=0x0601 /D_AFXDLL /D_AMD64_=1 /D_CAT_ANSI_STREAMS /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_DS_PLATEFORME_64 /D_ENDIAN_LITTLE /D_LANGUAGE_CPLUSPLUS /D_MFC_VER=0x0E00 /D_MK_CONTNAME_=XBYCSCommandOperations /D_MK_FWNAME_=XBYCSCommands /D_MK_MODNAME_=XBYCSCommandOperations /D_UNICODE /D_WIN32_WINNT=0x0601 /D_WIN64 /D_WINDOWS /D_WINDOWS_SOURCE /D_WINNT_SOURCE /D__XBYCSCommandOperations /EHs /FIE:/ws/prereqs/r426_debug/./BSFBuildtimeData/PublicInterfaces/CATIAV5Precompiled.h /FIE:/ws/prereqs/r426_debug/./BSFBuildtimeData/PublicInterfaces/CATWarningPromote.h /GS- /MD /Od /W3 /Zc:__cplusplus /Zc:forScope /Zc:wchar_t /Zi /permissive- /std:c++20 /w14239 /wd4251 /wd4290 /D_MK_FWNAME_=XBYCSCommands /D_MK_MODNAME_=XBYCSCommandOperations /D_MK_CONTNAME_=XBYCSCommandOperations /Ie:/ws/3dbyme/XBYCSCommands/XBYCSCommandOperations.m/src /Ie:/ws/3dbyme/XBYCSCommands/XBYCSCommandOperations.m/LocalInterfaces /Ie:/ws/3dbyme/XBYCSCommands/XBYCSCommandOperations.m/LocalGenerated/win_b64 /Ie:/ws/3dbyme/XBYCSCommands/PrivateInterfaces /Ie:/ws/3dbyme/XBYCSCommands/ProtectedInterfaces /Ie:/ws/3dbyme/XBYCSCommands/ImportedInterfaces/win_b64 /IE:/ws/tools/mkmk/r426/win_b64/tools/include/Windows /IE:/ws/tools/mkmk/r426/win_b64/tools/include XBYCSCutSlotOperation.cpp"
}
]
Hi @ddignam . The documentation for compile_commands.json is unclear on whether the directory
field must be a full path, or what it's relative to if not a full path. The only examples it provides are full paths.
We can use this issue to ensure the behavior is consistent - either always relative to the workspace folder or relative to its location. (Using its current location would seem to be less ambiguous.) Though, since it's unclear what the correct behavior should be, I'd recommend not using a relative path in that field, as other tools may interpret it differently. I'd suggest also following up with an issue against LLVM asking for documentation to be updated to clarify the validity and behavior of relative paths in the directory
field. compile_commands.json
specification ambiguities have actually come up in the past, which they've updated the documentation to clarify.
Please make this default to workspace folder again.
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
Steps to reproduce:
Activate cpp file, expect intellisense to parse and find include files. Get this error, switching back to 1.19. 9 fixes the issue:
[5/8/2024, 8:05:56 AM] "XBYCSCreatePoolData.cpp" not found in "e:\ws\3dbyme/.vscode/compile_commands.json". 'includePath' from c_cpp_properties.json in folder '3DBYME' will be used for this file instead.
Expected behavior:
Configuration and Logs
Other Extensions
No response
Additional context
No response