microsoft / vscode-makefile-tools

MAKE integration in Visual Studio Code
Other
185 stars 55 forks source link

The issue relates to paths in compile_commands.json generated by makefile tools. #435

Closed RidePig closed 12 months ago

RidePig commented 1 year ago

When using compile_commands.json generated by makefile tools with clangd on Windows 10, I found that go to definition does not work properly. Specifically, sometimes it would jump to the header file where the function declaration is located. After troubleshooting, I found that this was caused by the path in compile_commands.json, specifically due to differences in capitalization of drive letters. I notice that clangd is case-sensitive and letter casing in paths can affect its functionality. The drive letters in compile_commands.json generated by makefile tools are all lowercase. If I don't make any changes, clangd will exhibit the above problem; but if I change all drive letters to uppercase (e.g., changing c: to C:), then the problem can be solved. The specific reason for this issue is currently unknown.

andreeis commented 1 year ago

@RidePig, we just fixed something similar: https://github.com/microsoft/vscode-makefile-tools/issues/416. Read at the end what you can do to verify this fix before we release 0.7. Give that a try and let us know if installing that vsix solves the problem you see. If not then it is something else and we will ask for more info, investigate, try to unblock you with a workaround and fix.

andreeis commented 12 months ago

@RidePig , I am closing this as old but please reactivate if you see this still reproduces with the latest 0.7.0 release and provide extra info for us to investigate.