Menu

#1019 Disable CC popup for non c/c++ files

Undefined
applied
Bug_Report
2020-10-17
2020-09-25
Quiss
No

Disable CC (GetAutocompList) for non c/c++ files, like .txt.
Patch against r12201.

Forum topic: http://forums.codeblocks.org/index.php/topic,22798.0.html

1 Attachments

Discussion

  • Teodor Petrov

    Teodor Petrov - 2020-09-26
    • labels: --> Code Completion, CodeCompletion
     
  • Teodor Petrov

    Teodor Petrov - 2020-09-26

    I think this is better fix:

    Author: T Petrov <tpetrov@codeblocks.org>
    Date:   Sat Sep 26 17:12:32 2020 +0300
    
    
        * CC: Don't provide completions for unsupported files (ticket #1019)
    
    diff --git a/src/plugins/codecompletion/codecompletion.cpp b/src/plugins/codecompletion/codecompletion.cpp
    index 301741057..acae3d1b1 100644
    --- a/src/plugins/codecompletion/codecompletion.cpp
    +++ b/src/plugins/codecompletion/codecompletion.cpp
    @@ -754,6 +754,7 @@ CodeCompletion::CCProviderStatus CodeCompletion::GetProviderStatusFor(cbEditor*
                 return ccpsActive;
    
             case ParserCommon::ftOther:
    
    +            return ccpsInactive;
             default:
                 break;
         }
    

    Unfortunately this exposes another problem. Steps

    1. create empty file
    2. completions work here, because CC is set to think empty extension is a STL header file
    3. save as txt - CC still thinks this is a header file.

    I guess the CCManager should detect files saves and do some restoring of m_pLastEditor or/and m_pLastCCPlugin. But I don't have the time to work on this at the moment.

     
  • Teodor Petrov

    Teodor Petrov - 2020-09-26
    • labels: Code Completion, CodeCompletion --> CodeCompletion
     
  • Teodor Petrov

    Teodor Petrov - 2020-09-26
    • Type: Patch --> Bug_Report
     
  • Teodor Petrov

    Teodor Petrov - 2020-09-26

    Please let me know if the above patch works for you (except for the case I've listed)?

     
  • Quiss

    Quiss - 2020-09-27

    Yes, your patch works. I've built against the same rev (r12201).

     
  • Teodor Petrov

    Teodor Petrov - 2020-10-17
    • status: open --> applied
    • assigned_to: Teodor Petrov
     

Log in to post a comment.