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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Patch: function arguments added to autocomplete tooltip
« Reply #60 on: December 10, 2012, 08:17:10 pm »
The second one is a bit better...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline p2rkw

  • Almost regular
  • **
  • Posts: 142
Re: Patch: function arguments added to autocomplete tooltip
« Reply #61 on: December 12, 2012, 10:07:41 pm »
I finished the main functionality

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Patch: function arguments added to autocomplete tooltip
« Reply #62 on: December 13, 2012, 12:39:54 am »
Well done!

What does this do to performance? (Memory/CPU)
Will this provide docs for wxWidgets?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Patch: function arguments added to autocomplete tooltip
« Reply #63 on: December 13, 2012, 06:23:14 am »
Is this in the patch tracker?
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Patch: function arguments added to autocomplete tooltip
« Reply #64 on: December 15, 2012, 12:53:37 am »
Also have you fixed the autocomplete patch to work with current head?

I'm currently testing it and I see no problems with the second version, but the old version had a strange crash, so I want to test a bit more.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Patch: function arguments added to autocomplete tooltip
« Reply #65 on: December 15, 2012, 10:04:50 am »
I'm currently testing [...]
Reminds me that I also saw very strange behaviour like the HTML docs were shown for a (wx) class I had used last in case I added an #include statement. This made no sense... but maybe its fixed already.
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 #66 on: December 24, 2012, 01:14:31 am »
Update. Patch against revision 8706. Still not finished but works nicely :)
Actually doxygen parser recognize only few keywords: params, breief, short, result, return, see, sa.
I have no idea how to efficiently handle structural keywords: class, var, fn, etc.. I also don't know what to do with overloaded/overwritten functions: their names should be displayed on autocomplete list several times or just once? Maybe if documentation should be "inherited" from base class (and its members) when it's not present?
« Last Edit: January 06, 2013, 02:41:25 am by p2rkw »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Patch: function arguments added to autocomplete tooltip
« Reply #67 on: December 24, 2012, 07:51:31 am »
Update. Patch against revision 8706. Still not finished but works nicely :)
Actually doxygen parser recognize only few keywords: params, breief, short, result, return, see, sa.
I have no idea how to efficiently handle structural keywords: class, var, fn, etc.. I also don't know what to do with overloaded/overwritten functions: their names should be displayed on autocomplete list several times or just once? Maybe if documentation should be "inherited" from base class (and its members) when it's not present?
Great work.
I just download and apply your patches. I see some building warnings:
Quote
[ 63.2%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE  -DBUILDING_PLUGIN    -iquote.objs\include -I.objs\include -I. -IE:\code\cb\wx\wxWidgets-2.8.12\include -IE:\code\cb\wx\wxWidgets-2.8.12\contrib\include -IE:\code\cb\wx\wxWidgets-2.8.12\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude -Iinclude\mozilla_chardet  -c plugins\codecompletion\codecompletion.cpp -o .objs\plugins\codecompletion\codecompletion.o
plugins\codecompletion\codecompletion.cpp: In member function 'int CodeCompletionHelper::Doxygen::DoxygenParser::FindNextKeyword(const wxString&)':
plugins\codecompletion\codecompletion.cpp:508:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
plugins\codecompletion\codecompletion.cpp: In member function 'int CodeCompletionHelper::Doxygen::DoxygenParser::CheckKeyword(const wxString&)':
plugins\codecompletion\codecompletion.cpp:555:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
plugins\codecompletion\codecompletion.cpp:559:63: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
plugins\codecompletion\codecompletion.cpp:596:50: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
plugins\codecompletion\codecompletion.cpp:609:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
plugins\codecompletion\codecompletion.cpp: In member function 'int CodeCompletionHelper::Doxygen::DoxygenParser::GetParagraphArgument(const wxString&, wxString&)':
plugins\codecompletion\codecompletion.cpp:626:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
plugins\codecompletion\codecompletion.cpp: In member function 'void CodeCompletionHelper::Doxygen::DoxygenParser::GetWordArgument(const wxString&, wxString&)':
plugins\codecompletion\codecompletion.cpp:642:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
plugins\codecompletion\codecompletion.cpp: In member function 'int CodeCompletionHelper::Doxygen::DoxygenParser::GetLineArgument(const wxString&, wxString&)':
plugins\codecompletion\codecompletion.cpp:666:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
plugins\codecompletion\codecompletion.cpp: In member function 'bool CodeCompletionHelper::Doxygen::DoxygenParser::IsEnd(const wxString&) const':
plugins\codecompletion\codecompletion.cpp:736:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
plugins\codecompletion\codecompletion.cpp: In member function 'void CodeCompletion::EditorEventHook(cbEditor*, wxScintillaEvent&)':
plugins\codecompletion\codecompletion.cpp:2774:34: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]
plugins\codecompletion\codecompletion.cpp: In member function 'Token* CodeCompletion::GetAutocompToken(int)':
plugins\codecompletion\codecompletion.cpp:4776:68: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
plugins\codecompletion\codecompletion.cpp: At global scope:
plugins\codecompletion\codecompletion.cpp:331:16: warning: 'int CodeCompletionHelper::AutocompRemoveArgsTypes(wxString&)' defined but not used [-Wunused-function]

Some comment from a very quick view on the patch files:
1, I see some tabs, here, I think they should be converted to white-spaces.
2, I see a lot of code in codecompletion.cpp, I personally think the codecompletion.cpp is too large, is it possible to add a new file (e.g. DoxygenParser.cpp)




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 #68 on: December 24, 2012, 08:03:38 am »
2, [...] is it possible to add a new file (e.g. DoxygenParser.cpp)
I second that.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Patch: function arguments added to autocomplete tooltip
« Reply #69 on: December 24, 2012, 08:19:55 am »
Can you make the comment panel's background color different from the code editor's background?
currently, they are both white.

See the screen shot below:


EDIT: it seems that click on the HTML link(in the comment panel) does not work.
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 #70 on: December 24, 2012, 10:39:56 am »
Can you make the comment panel's background color different from the code editor's background?
Why not just simply provide a border?
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 #71 on: December 26, 2012, 04:31:42 pm »
Quote
What does this do to performance? (Memory/CPU)
Plain documentation is stored in additional map, so memory isn't wasted when token haven't got documentation.
Html is generated on the fly from tokens generated (and cached) in CodeCompletion::CodeComplete, there aren't additional searches in token tree.  Most of the times token index is passed in link's href, so it can be obtained from tree without search.

Quote
I second that.
And me too :) But first I have to find out how create patch that adds files to repo.

Quote
Can you make the comment panel's background color different from the code editor's background?
currently, they are both white.
I forgot that default background color is white :) I already added border. I think that colors of background, text and links should be customizable.

Quote
EDIT: it seems that click on the HTML link(in the comment panel) does not work.
Which exactly doesn't work? Can you try this code:
Code
struct ThisLinkWorks{};

//! A test class.
/*!
A more elaborate class description.
*/
class Test
{
public:
  //! An enum.
  /*! More detailed enum description. */
  enum TEnum {
    TVal1 = 2, /*!< Enum value TVal1. */
    TVal2, /*!< Enum value TVal2. */
    TVal3 /*!< Enum value TVal3. */
  }
  //! Enum pointer.
  /*! Details. */
  *enumPtr,
  //! Enum variable.
  /*! Details. */
  enumVar;
  //! A constructor.
  //! Constructing constructor of constructive Test class.
  /*!
  A more elaborate description of the constructor.
  */
  Test();
  //! A destructor.
  /*!
  A more elaborate description of the destructor.
  */
  ~Test();
  //! A normal member taking two arguments and returning an <font color=red>integer</font> value.
  /*!
  \param a an integer argument.
  \param s a constant character pointer.
  \return The test results
  \sa Test, ~Test, Test() testMeToo  publicVar
  */
  int testMe(int a, const char* s);
  //! A pure virtual member.
  /*!
  \sa testMe()
  \param c1 the first argument.
  \param c2 the second argument.
  */
  virtual void testMeToo(char c1, char c2) = 0;
  //! A public variable.
  /*!
  Details.
  */
  int publicVar;
  //! A function variable.
  /*!
  Details.
  */
  int (*handler)(int a, int b);

  ThisLinkWorks function4(ThisLinkDoesntWork tldw);
};

PS. Can also try to implement methods using codecompletion?
« Last Edit: December 26, 2012, 05:29:15 pm by p2rkw »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Patch: function arguments added to autocomplete tooltip
« Reply #72 on: December 26, 2012, 06:08:38 pm »
Which exactly doesn't work? Can you try this code:
Well in fact, on Windows none of the blue links works for me:
- Open Decl/Impl,
- Close
- Top
...what would be the expected result? I thought its maybe not yet implemented.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Patch: function arguments added to autocomplete tooltip
« Reply #73 on: December 27, 2012, 01:58:51 am »
Quote
I second that.
And me too :) But first I have to find out how create patch that adds files to repo.
If you use TortoiseSVN under Windows, just right click on the new file, and select "add" command. If you use SVN command, I believe there is a similar "add" command.
After that, the new file's content will be included in your patch.

Quote
PS. Can also try to implement methods using codecompletion?
I don't understand this sentence. ???
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Patch: function arguments added to autocomplete tooltip
« Reply #74 on: December 28, 2012, 06:31:40 pm »
2, [...] is it possible to add a new file (e.g. DoxygenParser.cpp)
Please stick to lower case file names.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]