Skip to content
  • Nikolai Kosjar's avatar
    Clang: Handle fixits of main diagnostic in tooltip · a1071b50
    Nikolai Kosjar authored
    
    
    So far we have assumed that:
     1) The main diagnostic explains the issue.
     2) The child diagnostics might have fixits attached that use the
        imperative in the text. Because of this we made the fixit texts
        clickable.
    
    As it turns out, the main diagnostic itself also might have fixits
    attached, as the following example shows.
    
      // Parse solely with the warning option "-Weverything"
      template <typename T> struct C {};
      C<C<int>> bla;
    
    ...which leads to
    
      warning: consecutive right angle brackets are incompatible with C++98
      (use '> >')
    
    ...which has no further child diagnostics, but provides a fixit.
    
    The problem with this case is that it is not obvious for the user that
    clicking the text will fix the issue since no imperative is used at
    start of the text. For now, handle this case by making the text of the
    main diagnostic clickable, too. But if we encounter more cases like
    this, we probably should visualize the "you can apply the fix by
    clicking here" concept differently.
    
    Change-Id: Ia64e9821df783cba13d32395fab19251feca0398
    Reviewed-by: default avatarAlessandro Portale <alessandro.portale@theqtcompany.com>
    a1071b50