niosus / EasyClangComplete

:boom: Robust C/C++ code completion for Sublime Text 3/4
https://niosus.github.io/EasyClangComplete/
MIT License
575 stars 79 forks source link

"errors_on_save" only on main.cpp #188

Closed SrMordred closed 7 years ago

SrMordred commented 7 years ago

errors_on_save works great, but only on the main.cpp file. On other files it don´t trigger.

niosus commented 7 years ago

This is extremely strange. Can you post the log? And your user settings.

SrMordred commented 7 years ago

Nothing special here I think...

{
    "cpp_flags" : [
        "-std=c++1z"
    ],
    "autocomplete_all" : true,
    "errors_on_save": true,
    "clang_binary" : "clang++"
}

Not sure what/how to get you a log of this..

niosus commented 7 years ago

Does this work without the autocomplete_all? I never use the plugin with this setting on.

SrMordred commented 7 years ago

Nop, same thing. I´m on Win 10 btw.

niosus commented 7 years ago

Strange. Can you post a log?

SrMordred commented 7 years ago

Ok, when trying to make an example it suddenly works. I Messed arount until came to this :

https://snag.gy/IOXrEj.jpg

They are complaining about the missing ; as expected. But when i uncomment the#include <iostream> and resave the test.h file it don´t show the error anymore.

niosus commented 7 years ago

Then I believe this is related to #88 and can be fixed following #175

SrMordred commented 7 years ago

Hm.. well a have a .clang_complete with a lot of include folders since I don´t know exactly what to add.

-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\backward
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\bits
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\debug
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\decimal
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\experimental
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\parallel
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\profile
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\tr1
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\tr2
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\x86_64-w64-mingw32
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\experimental\bits
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\bin_search_tree_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\binary_heap_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\binomial_heap_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\binomial_heap_base_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\branch_policy
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\cc_hash_table_map_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\eq_fn
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\gp_hash_table_map_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\hash_fn
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\left_child_next_sibling_heap_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\list_update_map_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\list_update_policy
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\ov_tree_map_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\pairing_heap_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\pat_trie_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\rb_tree_map_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\rc_binomial_heap_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\resize_policy
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\splay_tree_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\thin_heap_
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\tree_policy
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\trie_policy
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\ext\pb_ds\detail\unordered_iterator
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\profile\impl
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\x86_64-w64-mingw32\bits
-ID:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++\x86_64-w64-mingw32\ext
-IC:\Users\this_\Desktop\game
-std=c++1z
niosus commented 7 years ago

I can't help you much with that as I am not too fluent with windows. You should just follow the suggestions in #175 and this should be enough.

SpeCter commented 7 years ago

It looks like your includes are wrong or they changed the folder structure with gcc 6.x.x. Could you look if the c++ folder is actually there under: D:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\ ?

If not you need to correct that first and you forgot to include the parent include folder: D:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include

SrMordred commented 7 years ago

The path is correct. I Just made a fresh install on my work PC and this is the path: "C:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include\c++"

SpeCter commented 7 years ago

Did you add this and test again? -IC:\mingw-w64\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0\include

Don't forget to change all your paths to C: instead of D: in your clang_complete file.

Which exact mingw are you using?

niosus commented 7 years ago

@SrMordred any news on this one?

SrMordred commented 7 years ago

Nop, same things, the line cited above was already added. They also don´t reconize types if they are two files away. like: "lib/util.h" ->

using string = std::string;
template<class T>
using vector = std::vector<T>;

"libs.h" -> #include "lib/util.h" "main.h" -> #include "libs.h" string x; vector<int>y; give me this (and off course, it compiles ok).

field has imcomplete type 'string'
and unknow type name 'vector'
SpeCter commented 7 years ago

Could you post your output for clang++ -v? LLVM started targeting msvc instead of gnu, maybe there is a problem since then on windows :-/

SrMordred commented 7 years ago
clang version 3.9.0 (branches/release_39)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: D:\LLVM\bin
niosus commented 7 years ago

Hey @SrMordred can you try to reproduce this using newly released clang 4.0?

niosus commented 7 years ago

Any new info on this?

niosus commented 7 years ago

closing for lack of activity.