rdnetto / YCM-Generator

Generates config files for YouCompleteMe (https://github.com/Valloric/YouCompleteMe)
GNU General Public License v3.0
917 stars 129 forks source link

Syntax Error when using the new template.py #90

Open TotalKrill opened 7 years ago

TotalKrill commented 7 years ago

6f044a695ee1eb35f5ed0aa1b13a68fc8e24dd42 breaks with syntax error on line 43 in template.py after running YcmGenerateConfig on a project

rdnetto commented 7 years ago

Can you explain how it's breaking? It has a syntax error in Python 3 (not 2), but my understanding was the YCM uses Python 2 anyway.

Also, what's the output of python --version on your OS?

TotalKrill commented 7 years ago

The output of python --version is 2.7.12, but this is because i set it manually to 2.7. I usually switch between 3.5 and 2.7 because many programs i use are not checking the python version.

The crash occurs when i try to use YcmCompleter GoTo

TotalKrill commented 7 years ago

Also, when I build ycm, it uses python 3.5

ssfdust commented 7 years ago

Hi I made a temporary patch for this syntax problem, though I don't think it's perfect. Maybe you can try it.Good luck : ) https://github.com/ssfdust/YCM-Generator/commit/15b2806b3b7ebea78a193bd8de8d6844f3ce8017

TotalKrill commented 7 years ago

Still getting the same error. This is my build command for YouCompleteMe with some info:

./install.py --clang-completer --system-libclang
Searching Python 3.5 libraries...
Found Python library: /usr/lib/python3.5/config-3.5m/libpython3.5m.so
Found Python headers folder: /usr/include/python3.5m
... Detecting stuff ...
Your C++ compiler supports C++11, compiling in that mode.
-- Found PythonLibs: /usr/lib/python3.5/config-3.5m/libpython3.5m.so (found suitable version "3.5.2", minimum required is "3.3") 
Using libclang to provide semantic completion for C/C++/ObjC
Using external libclang: /usr/lib/libclang.so.3.9
-- Found PythonInterp: /usr/bin/python3.5 (found version "3.5.2") 
... Looking for stuff ...
-- Build files have been written to: /tmp/ycm_build_t4c4uxn1

I think this means that i am using the python3.5 for Ycm, but i still get the syntax error in the function LoadSystemIncludes. If i remove this and all references to it. It works.

TotalKrill commented 7 years ago

Oh, nevermind. Will try your version, I falsely assumed it had been merged.

Edit: Your patch seems to be working @ssfdust

korken89 commented 7 years ago

I am having the same problem as @TotalKrill, @ssfdust patch fixes the problem when using python3.