Giter Club home page Giter Club logo

Comments (20)

niosus avatar niosus commented on May 23, 2024

Hm, ok. This sounds very logical. I believe, I will have to rework the way I manage cindex. It is a pain to work with libclang python bindings :)

On ubuntu, if you install clang 3.8 you don't get libclang.so, you get libclang-3.8.so.1. This is one issue. I guess, I will reopen it separately.

The other one is the issue with std namespace not being recognized. I encountered the same error on my machine yesterday, and for now I don't know what causes it. It was not there before, so I will probably try different releases to try to find where I have introduced this bug.

Sorry for the inconvenience. I will keep you posted as soon as I find out anything.

from easyclangcomplete.

niosus avatar niosus commented on May 23, 2024

Also, why do you use -std=gnu++1z? Any particular reason for this? Why not -std=c++1z? Can you try it?

from easyclangcomplete.

niosus avatar niosus commented on May 23, 2024

I have moved discussions about searching for a correct .so file to another issue #22

from easyclangcomplete.

riazanovskiy avatar riazanovskiy commented on May 23, 2024

It is same with all other flags (c++11, c++14, c++1z).

I don't think that the issue is related to namespace std. In libclang mode I have no completions at all, even for classes declared in the same file or any other namespace (e. g. boost).

from easyclangcomplete.

niosus avatar niosus commented on May 23, 2024

Could you also provide the file you are testing it on?

from easyclangcomplete.

riazanovskiy avatar riazanovskiy commented on May 23, 2024

You can use literally any file, for example test.cpp and test_vector.cpp from tests/

from easyclangcomplete.

niosus avatar niosus commented on May 23, 2024

Unfortunately I am clueless for now. I've just learned from issue #23 that libclang 3.8 can misbehave. Could you try the plugin with another version of clang? Like 3.6? If it is a hassle for you, I will try to install clang 3.8 on my system and see what happens.

from easyclangcomplete.

riazanovskiy avatar riazanovskiy commented on May 23, 2024

Same for clang 3.7.1

from easyclangcomplete.

niosus avatar niosus commented on May 23, 2024

May I still ask you to try clang 3.6? This is the one I have tested it on. Then we can have some common ground. For now I cannot reproduce the behavior.

from easyclangcomplete.

riazanovskiy avatar riazanovskiy commented on May 23, 2024

Wow! It works on clang 3.6.2 in libclang mode (after appropriate fix in cindex36.py).

from easyclangcomplete.

riazanovskiy avatar riazanovskiy commented on May 23, 2024

Am I right that you are using some python3 port of official libclang python bindings, with different release of cindex.py for each version of clang?
Something works with clang 3.8 if I replace cindex38.py with the one from this repo https://bitbucket.org/Anteru/python3-libclang

from easyclangcomplete.

niosus avatar niosus commented on May 23, 2024

Yep, I am using a port of bindings, and they are far from guaranteed to be right. Thank you for a suggestion.

May I ask which change did you do in cindex36?

from easyclangcomplete.

riazanovskiy avatar riazanovskiy commented on May 23, 2024

I had to change libclang.so file name to make it work on my system. This is about #22, not about this issue.

from easyclangcomplete.

niosus avatar niosus commented on May 23, 2024

Ok, I understand. then it seems that the fix would be to use libclang that you linked for clang version 3.8 (and I will adapt the official ones for 3.7). And then solving issue #22 Then this issue will be closed.

from easyclangcomplete.

riazanovskiy avatar riazanovskiy commented on May 23, 2024

Unfortunately that one doesn't work out of box. I didn't check it thoroughly, but sometimes it throws errors instead of completions.

from easyclangcomplete.

niosus avatar niosus commented on May 23, 2024

Ok, thanks for all that info. Then I will probably try to adapt the official ones to run with Python 3

from easyclangcomplete.

niosus avatar niosus commented on May 23, 2024

I had a look at the current cindex38.py and it is exactly the same as the official one after running 2to3 on it and enforcing utf8 encoding. So I don't have any further idea what could be happening. I have installed clang 3.8 on my system and I do not get autocompletions just as in your case. In addition to that if I try it multiple times plugin_host eventually crashes.

I have tried to annotate what is being called from cindex 3.8 with no luck. Also I tried to blatantly replace cindex3.8.py with the contents of cindex3.6.py and it did not change the behavior by even a slightest bit. But the plugin_host does not crash :)

So, now I am totally clueless. I will continue searching what can cause this, maybe somebody has encountered this. For now, I suggest using clang 3.6

from easyclangcomplete.

niosus avatar niosus commented on May 23, 2024

Although, after using the cindex that you have linked: https://bitbucket.org/Anteru/python3-libclang the completions seem to work. I will keep that version for now. Will push it in the upcoming days.

from easyclangcomplete.

niosus avatar niosus commented on May 23, 2024

Also, seems like the relevant fix is inspired by http://reviews.llvm.org/D17226 as referenced here in the new cindex38.py

from easyclangcomplete.

niosus avatar niosus commented on May 23, 2024

@riazanovskiy I have replaced cindex38.py by another version and it is working for me with clang 3.8. Can you try it out? I will close the issue for now, but feel free to reopen if something is not working.

from easyclangcomplete.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.