Skip to content
This repository was archived by the owner on Jun 12, 2018. It is now read-only.

Conversation

@eidheim
Copy link
Member

@eidheim eidheim commented Nov 27, 2015

@zalox: hope you can look over and merge this soon. The main problem was a bit confusing constructors and methods, and the std::map that forced us to previously do a copy of the source buffer (which is expensive). This is fixed now.

Mind that only one unsaved buffer is used now when calling the libclang functions. I really do not see any case where sending several unsaved files to libclang is a good idea, at least we would never do that in juCi++. If this is needed anyway (highly doubtful), I suggest that we try find a better solution than std::map, in order to avoid copy.

@zalox
Copy link
Member

zalox commented Nov 27, 2015

I used this approach to eliminate some common use-cases.
For instance:

  1. Edit header file (add definitions)
  2. Jump to implementation file
  3. Now I expect accurate completions from the header file, which I won't get unless I remember to save

@eidheim
Copy link
Member Author

eidheim commented Nov 27, 2015

Reparsing based on a changed header that is not saved is a bad idea since libclang have to recreate its translation unit cache and this is very slow. Also if a header file is changed and not saved, the errors and warnings would not reflect what would happen if you run compile.

zalox added a commit that referenced this pull request Nov 27, 2015
Cleanup of TranslationUnit and CodeCompleteResults.
@zalox zalox merged commit c1f4eef into cppit:master Nov 27, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants