Skip to content
  • Nikolai Kosjar's avatar
    Clang: Stop trying to remove duplicate completion items · 9d5705a7
    Nikolai Kosjar authored
    
    
    We assume that libclang does not return any duplicates, at least we
    never noticed any so far. For the concrete test below no duplicates were
    removed.
    
    Function overloads are not problematic because they are folded into one
    ClangAssistProposalItem (addOverload()).
    
    To the completion items from libclang we add the Qt Creator snippets as
    items. Those might have the same text in the completion list view, but
    their icon is different (e.g. consider the keyword completion "class"
    and the Qt Creator snippet "class"), thus the user can still tell them
    apart.
    
    Test:
     1. Open src/plugins/clangstaticanalyzer/unit-tests/qt-essential-includes.pro
     2. Open main.cpp
     3. Complete in the main function
    
    Measured with a timer in IpcReceiver::codeCompleted.
    
    On Linux, for 20637 completion items:
     Before: 74ms (avg)
        Now: 66ms (avg)
       Gain: 11%
    
    Change-Id: I524eaa09f8d9e07c78dc9efcc77f7e021c6f37f7
    Reviewed-by: default avatarTim Jenssen <tim.jenssen@qt.io>
    9d5705a7