Author Topic: Patch: function arguments added to autocomplete tooltip  (Read 125440 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Patch: function arguments added to autocomplete tooltip
« Reply #90 on: January 14, 2013, 03:23:33 pm »
Gui added, last bugs fixed... It seems to be finished now :) http://developer.berlios.de/patch/?func=detailpatch&patch_id=3381&group_id=5358

(Ability to define custom sort order had been removed from this patch, so remember to clean your configuration file.)

Thanks! the patch is big, so I just apply the patch, and build it. I see two build warnings:
1,
Code
plugins\codecompletion\codecompletion.cpp|1658|warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]|
The code is:
Code
                        ccSearchData searchData { control, editor->GetFilename() };
So, it would better:
Code
ccSearchData searchData= { control, editor->GetFilename() };

2,
Code
plugins\codecompletion\doxygen_parser.cpp|559|warning: comparison between signed and unsigned integer expressions [-Wsign-compare]|
Here
Code
    for(int i = 0; i < (size_t)(sizeof(arguments)/sizeof(arguments[0])); ++i )
i should be unsigned int.

 :)

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Patch: function arguments added to autocomplete tooltip
« Reply #91 on: January 14, 2013, 08:05:46 pm »
size_t

Offline p2rkw

  • Almost regular
  • **
  • Posts: 142
Re: Patch: function arguments added to autocomplete tooltip
« Reply #92 on: January 16, 2013, 02:05:04 am »
Ok, I'll fix it in next few days.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Patch: function arguments added to autocomplete tooltip
« Reply #93 on: January 16, 2013, 06:49:31 am »
Ok, I'll fix it in next few days.
I did that already besides quite some other refinements. It did neither compile with wx29 nor under 64 bit. The include chain was wrong, you defined types twice and so on... Nothing serious, but it needed to be fixed. Maybe I should post an updated patch... Just I need to sort out the stuff...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline p2rkw

  • Almost regular
  • **
  • Posts: 142
Re: Patch: function arguments added to autocomplete tooltip
« Reply #94 on: January 17, 2013, 01:14:09 am »
It will be nice.
Actually I added auto hide to documentation window. It's only few lines of code, but makes this window much less annoying.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Patch: function arguments added to autocomplete tooltip
« Reply #95 on: January 17, 2013, 04:17:37 pm »
It will be nice.
Actually I added auto hide to documentation window. It's only few lines of code, but makes this window much less annoying.
Update the patch, I can integrate. I'll provide a refined one after that. Otherwise we move in circles.. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline p2rkw

  • Almost regular
  • **
  • Posts: 142

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Patch: function arguments added to autocomplete tooltip
« Reply #97 on: March 01, 2013, 07:57:07 am »
Slightly unrelated, but I thought I would mention that if one can get the Scintilla lexers to run invisibly (for files not currently open), a relatively simple language independent comment parser can be created with cbStyledTextCtrl::IsComment().
@Alpha, in plugins\codecompletion\coderefactoring.cpp, function
size_t CodeRefactoring::SearchInFiles(const wxArrayString& files, const wxString& targetText)
There is some usage of an invisible cbStyledTextCtrl, and fill it with the text, and I think later use cbStyledTextCtrl::IsXXXX() to check styles. EDIT: I'm not look deep into p2rkw's patch, but I think using a invisible cbStyledTextCtrl is an alternative way to catch document strings on the fly.

@All:
I'm looking forward to see the updated patch against SVN HEAD :).

Also:
"return wxString();"should use wxEmptyString, right?
« Last Edit: March 01, 2013, 08:18:14 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Patch: function arguments added to autocomplete tooltip
« Reply #98 on: March 01, 2013, 12:05:45 pm »
Also:
"return wxString();"should use wxEmptyString, right?
Yes, I've done all such adjustments already in my local copy. I still need to merge and sort out from/with trunk as there have been many CC related changes recently. If I find the time for that I can provide a cleaned-up patch. The patch in the patch-tracker if of no use anymore. Hence it also doesn't make sense for p2rkw to work on that - I've done it already, just not to public. I am still on it - its not lost... don't worry.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Patch: function arguments added to autocomplete tooltip
« Reply #99 on: March 10, 2013, 09:13:50 pm »
@p2rkw: How difficult would it be to extend the parser to accept comments on more complicated declarations, ex. the following from stl:
Code
  /**
   *  @brief This does what you think it does.
   *  @ingroup sorting_algorithms
   *  @param  a  A thing of arbitrary type.
   *  @param  b  Another thing of arbitrary type.
   *  @return   The lesser of the parameters.
   *
   *  This is the simple classic generic implementation.  It will work on
   *  temporary expressions, since they are only evaluated once, unlike a
   *  preprocessor macro.
  */
  template<typename _Tp>
    inline const _Tp&
    min(const _Tp& __a, const _Tp& __b)
    {
      // concept requirements
      __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
      //return __b < __a ? __b : __a;
      if (__b < __a)
return __b;
      return __a;
    }

Offline p2rkw

  • Almost regular
  • **
  • Posts: 142
Re: Patch: function arguments added to autocomplete tooltip
« Reply #100 on: March 11, 2013, 12:15:50 am »
Alpha: thanks for info, I'll try to fix it in next few days.

Offline p2rkw

  • Almost regular
  • **
  • Posts: 142
Re: Patch: function arguments added to autocomplete tooltip
« Reply #101 on: March 12, 2013, 03:19:12 pm »
Attached patch fixes issue reported by Alpha. Multi line declarations should be handled properly now.
Edit: patch removed.
« Last Edit: March 17, 2013, 09:42:18 pm by p2rkw »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Patch: function arguments added to autocomplete tooltip
« Reply #102 on: March 12, 2013, 09:02:25 pm »
Testing (and your other patch)...

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Patch: function arguments added to autocomplete tooltip
« Reply #103 on: March 16, 2013, 01:22:54 am »
This patch works.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Patch: function arguments added to autocomplete tooltip
« Reply #104 on: March 16, 2013, 01:53:47 am »
Do these functions have a purpose?
Code
F:\cb\src\plugins\codecompletion\doxygen_parser.cpp:26:12: warning: 'int GetAverangeCharWidth(cbStyledTextCtrl*, int)' defined but not used [-Wunused-function]
F:\cb\src\plugins\codecompletion\parser\tokentree.cpp:96:17: warning: 'bool TokenTreeHelper::CompareBaseArguments(const wxString&, const wxString&)' defined but not used [-Wunused-function]