AtomLinter / linter-gcc

Atom-linter extension to lint C/C++ source files using gcc/g++
Other
71 stars 21 forks source link

Project specific settings #2

Closed csholmq closed 9 years ago

csholmq commented 9 years ago

linter-clang now supports .clangcomplete files which allows you to inject e.g. -I/path/to/include/dir_ for each project. As each of my projects at work comes bundled with both include dirs and gcc environment I would love something like this.

I.e. support for project specific settings like exec path and include dirs.

hebaishi commented 9 years ago

Yes that sounds great. I will implement this asap.

hebaishi commented 9 years ago

Just added project-specific settings. I look forward to hearing what you think!

csholmq commented 9 years ago

Nice one. Got it working once I realised I needed to do Window: reload first. Works great when switching projects using project-manager as the project is reloaded and thus the .json as well.

Only one negative feedback; Only works with absolute paths. Relative paths seem to originate from current file and not project root.

csholmq commented 9 years ago

Correction. The .json is only reloaded at Window: reload, or refreshing the window. But project-manager keeps track of each project so it's not a real issue.

hebaishi commented 9 years ago

This is a caching issue. I've just pushed a commit that deletes the cache each time. So the json file should be reloaded every time you add/remove a project. Could you give it a try?

hebaishi commented 9 years ago

Ok I have an idea. I can reload the json file every time the current file is saved. What do you think?

hebaishi commented 9 years ago

Ok the json file is reloaded every time you save a C/C++ file, and relative paths are now expanded.

csholmq commented 9 years ago

Sounds great. However, I can't seem to get relative paths to work.

hebaishi commented 9 years ago

Can you show me your .gcc-flags.json file please? It's working at my end.

csholmq commented 9 years ago

{ "execPath": "./Sw/P_Xmc/tools/ARM-GCC/bin/arm-none-eabi-gcc", "gccDefaultCFlags": "-Wall", "gccDefaultCppFlags": "-Wall -std=c++11", "gccErrorLimit": 5, "gccIncludePaths": "./Sw/A_XMC/out/obj", "gccSuppressWarnings": true }

hebaishi commented 9 years ago

Yes I see the problem. I didn't add the relative path expansion to execPath as well. Let me do that quickly.

hebaishi commented 9 years ago

Done! Give it a try! :)

csholmq commented 9 years ago

Works great! Thanks a bunch!