linter-gcc can't read property from .gcc-flags.json
Checklist
- [✓] Check that you have the GNU C Compiler installed by typing
gcc --versioninto a terminal. - [✓] If you don't have the
linterpackage installed, either update to the latest version oflinter-gccor install linter directly withapm install linter. - [✓] Ensure that you are using a valid grammar - either C/C++/C++14
- [✓] Ensure that you have read all the relevant information in the wiki, particularly the Common Issues page.
Issue (including debugging messages):
I have gcc and avr-gcc installed, avr-gcc not localized and his messages in english, but gcc is localized, his messages in ukrainian. So, i change the default "String GCC prepends to errors", "String GCC prepends to warnings" and "String GCC prepends to notes" in settings according to my LC_MESSAGES and create .gcc-flags.json file with parameters for avr-gcc project in project root directory. The problem is that: adding "gccErrorString", "gccWarningString" and "gccNoteString" with default (English) values for avr-gcc to .gcc-flags.json not give desired effect, linter is working, but can not parse output correctly (if have errors, linter show only first), but if set back this parameters in settings avr-gcc works fine.
P. S. I found a solution, that works, but I know that's not right and don't know how to make it better. main.zip
linter-gcc v0.7.1
debugging messages:
linter-gcc: Reading settings from: /home/zombien/Documents/HW_projects/nixieclock/.gcc-flags.json utility.js:130 linter-gcc config: {"execPath":"/usr/bin/avr-gcc","gccIncludePaths":"., /usr/avr/include/*","gccSuppressWarnings":false,"gccDefaultCFlags":"-c -Wall -fsyntax-only -Wno-main -mmcu=atmega8 -Os -o /dev/null","gccDefaultCppFlags":"-c -Wall -fsyntax-only -Wno-main -std=c++11 -mmcu=atmega8 -Os -o /dev/null","gccErrorLimit":-1,"gccErrorString":"error","gccWarningString":"warning","gccNoteString":"note","compileCommandsFile":"./build/compile_commands.json"} utility.js:142 /home/zombien/Documents/HW_projects/nixieclock/build/compile_commands.json utility.js:111 Expanding directories utility.js:208 linter-gcc: /usr/bin/avr-gcc -c -Wall -fsyntax-only -Wno-main -mmcu=atmega8 -Os -o /dev/null -I/home/zombien/Documents/HW_projects/nixieclock -I/usr/avr/include/avr -I/usr/avr/include/compat -I/usr/avr/include/sys -I/usr/avr/include/util -I/usr/avr/include /tmp/f156993b-cf7b-4fad-9403-6f82c0c320c6.c
content of error panel:
GCC ERROR /tmp/f83e4e23-a9cb-4b61-8dd5-71ba8bafa193.c: In function 'main': /tmp/f83e4e23-a9cb-4b61-8dd5-71ba8bafa193.c:11:2: error: expected ';' before 'array' array[0] = 0x00; ^~~~~~~~~ /tmp/f83e4e23-a9cb-4b61-8dd5-71ba8bafa193.c:16:2: error: expected ';' before 'twi_init' twi_init(); ^~~~~~~~
Thanks for raising the issue. I've just had a look at your fix, and the solution is simple - add the localized strings to .gcc-flags.json, as optional parameters. If they're missing, we use the configuration page settings. What do you think?
This is my file, I'm already add the localized strings! according to console, localized strings is loaded, but does not give any effect
.gcc-flags.json
{ "execPath": "/usr/bin/avr-gcc", "gccDefaultCFlags": "-c -Wall -fsyntax-only -Wno-main -mmcu=atmega8 -Os -o /dev/null", "gccDefaultCppFlags": "-c -Wall -fsyntax-only -Wno-main -std=c++11 -mmcu=atmega8 -Os -o /dev/null", "gccErrorLimit": -1, "gccErrorString": "error", "gccWarningString": "warning", "gccNoteString": "note", "gccIncludePaths": "., /usr/avr/include/*", "gccSuppressWarnings": false }
Yes I see that now. The code in config.js needs to change to read the localised strings from .gcc-flags.json. Will make the change in the next release. I need to add some tests to cover this new feature.
Okay, thank you)