linter-gcc icon indicating copy to clipboard operation
linter-gcc copied to clipboard

compile_commands.json ignored because cmake and linter-gcc use different path separator

Open LiZhenhuan1019 opened this issue 7 years ago • 2 comments

Checklist

  • [x] Check that you have the GNU C Compiler installed by typing gcc --version into a terminal.
  • [x] If you don't have the linter package installed, either update to the latest version of linter-gcc or install linter directly with apm install linter.
  • [x] Ensure that you are using a valid grammar - either C/C++/C++14
  • [x] Ensure that you have read all the relevant information in the wiki, particularly the Common Issues page.

Issue (including debugging messages):

The value of "file" in compile_commands.json generated by CMake on Windows uses slash, while gcc-linter uses backslash to identify the source file. So during debugging I found that in the file utility.js, at line 149, the if condition became false. So the arguments specified in compile_commands.json will be ignored compeletly image image

This problem can be fixed temporarily by modify the content of compile_command.json manually. But it will be tedious if there are more files.

LiZhenhuan1019 avatar Nov 28 '17 07:11 LiZhenhuan1019

I hope gcc-linter could supply a toggle to allow users on windows to choose the path separator.

LiZhenhuan1019 avatar Nov 28 '17 07:11 LiZhenhuan1019

Well, I found some package that can help me change the slashes in compile_commands.json. But I still hope linter could fix it.

LiZhenhuan1019 avatar Nov 28 '17 07:11 LiZhenhuan1019