Browse files

libclang.py: Get the abbreviation without reiterating over the list o…

…f chunks

0.34 -> 0.322 sec completion time on (examples/boost.cpp)
  • Loading branch information...
1 parent f1d71f6 commit acbd61f515517c20ea089ea2628560ef42a781a2 @tobig tobig committed Feb 2, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 plugin/libclang.py
View
6 plugin/libclang.py
@@ -168,7 +168,7 @@ def formatResult(result):
completion = dict()
returnValue = None
- abbr = getAbbr(result.string)
+ abbr = ""
chunks = filter(lambda x: not x.isKindInformative(), result.string)
args_pos = []
@@ -182,6 +182,10 @@ def formatResult(result):
continue
chunk_spelling = chunk.spelling
+
+ if chunk.isKindTypedText():
+ appr = chunk_spelling
+
chunk_len = len(chunk_spelling)
if chunk.isKindPlaceHolder():
args_pos += [[ cur_pos, cur_pos + chunk_len ]]

0 comments on commit acbd61f

Please sign in to comment.