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

oBFusCATed

(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!]

p2rkw


dmoore

Well done!

What does this do to performance? (Memory/CPU)
Will this provide docs for wxWidgets?
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

MortenMacFly

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]

oBFusCATed

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!]

MortenMacFly

Quote from: oBFusCATed on December 15, 2012, 12:53:37 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: [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

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?

ollydbg

Quote from: p2rkw 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?
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.

MortenMacFly

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

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.

MortenMacFly

Quote from: ollydbg on December 24, 2012, 08:19:55 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: [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

QuoteWhat 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.

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

QuoteCan 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.

QuoteEDIT: 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:

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?

MortenMacFly

Quote from: p2rkw on December 26, 2012, 04:31:42 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: [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: p2rkw on December 26, 2012, 04:31:42 PM
QuoteI 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.

oBFusCATed

Quote from: ollydbg on December 24, 2012, 07:51:31 AM
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!]