News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Patch: function arguments added to autocomplete tooltip

Started by p2rkw, November 26, 2012, 02:03:14 AM

Previous topic - Next topic

ollydbg

Quote from: p2rkw on January 13, 2013, 10:56:10 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,

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:
                       ccSearchData searchData { control, editor->GetFilename() };
So, it would better:
ccSearchData searchData= { control, editor->GetFilename() };

2,
plugins\codecompletion\doxygen_parser.cpp|559|warning: comparison between signed and unsigned integer expressions [-Wsign-compare]|
Here
   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.

killerbot


p2rkw


MortenMacFly

Quote from: p2rkw on January 16, 2013, 02:05:04 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

p2rkw

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.

MortenMacFly

Quote from: p2rkw 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.
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]


ollydbg

Quote from: Alpha on December 08, 2012, 12:20:00 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?
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.

MortenMacFly

Quote from: ollydbg on March 01, 2013, 07:57:07 AM
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Alpha

@p2rkw: How difficult would it be to extend the parser to accept comments on more complicated declarations, ex. the following from stl:

  /**
   *  @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;
    }

p2rkw

Alpha: thanks for info, I'll try to fix it in next few days.

p2rkw

Attached patch fixes issue reported by Alpha. Multi line declarations should be handled properly now.
Edit: patch removed.

Alpha


Alpha


Alpha

Do these functions have a purpose?

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]