Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

Patch: function arguments added to autocomplete tooltip

<< < (16/24) > >>

p2rkw:

--- Quote ---Please stick to lower case file names.
--- End quote ---
Ok.

--- Quote ---Well in fact, on Windows none of the blue links works for me:
--- End quote ---
I just tested it on windows, and it works very bad, much worse than on linux. Fortunately I know how to fix it.

--- Quote ---I don't understand this sentence.
--- End quote ---
Sorry, if it wasn't clear. I mean when you have function/method declaration:
--- Code: ---void function(int arg0, float arg1);
--- End code ---
you can use autocomplete to write implementation easily:
--- Code: ---void fun| // <- use autocomplete here
--- End code ---
and you will get
--- Code: ---void function(int arg0, float arg1)
--- End code ---
The only requirement is that implementation must be outside block.

MortenMacFly:

--- Quote from: p2rkw on December 28, 2012, 07:02:38 pm ---
--- Code: ---void fun| // <- use autocomplete here
--- End code ---
and you will get
--- Code: ---void function(int arg0, float arg1)
--- End code ---
The only requirement is that implementation must be outside block.

--- End quote ---
Juts my 2 cents on that one: This should definitely be an option, off by default. Otherwise we will get tons of reports how to turn it off.

As a general rule: Every automatism that affects the way you write code or something that even changes written code must be an option unless you need a special key combination to activate it.

p2rkw:
I fixed windows related issues, but still it isn't configurable. I can generate and upload patch if you want to test it.

p2rkw:
Next update, now all newly added functionalities are disabled by default. To enable them you have modify your config file manually.

--- Code: ---<USE_DOCUMENTATION_HELPER bool="1" />
<DOCUMENTATION_HELPER_BACKGROUND_COLOR>
<colour r="255" g="255" b="255" />
</DOCUMENTATION_HELPER_BACKGROUND_COLOR>
<DOCUMENTATION_HELPER_TEXT_COLOR>
<colour r="0" g="0" b="0" />
</DOCUMENTATION_HELPER_TEXT_COLOR>
<DOCUMENTATION_HELPER_LINK_COLOR>
<colour r="0" g="0" b="255" />
</DOCUMENTATION_HELPER_LINK_COLOR>

--- End code ---
These lines enables documentation helper, and sets colours used in generated html document.


--- Code: ---<DETECT_IMPLEMENTATION bool="1" />

--- End code ---
This one enables functionality described in my previous post - if you use autocomplete in global scope or inside class declaration then arguments' types and names will be added.


--- Code: ---<SORT_CRITERION1 int="2" />
<SORT_CRITERION2 int="1" />
<SORT_CRITERION3 int="6" />
<SORT_CRITERION4 int="5" />
<SORT_CRITERION5 int="7" />
<SORT_CRITERION6 int="8" />
<SORT_CRITERION7 int="4" />
<SORT_CRITERION8 int="0" />

--- End code ---

By the way I also added possibility to sort autocomplete list. You can use up to 8 sort criteria. Lower criterion number means higher priority (SORT_CRITERION1 has highest priority). Argument's specify how auto complete list will be sorted. Possible values and its meanings:

--- Code: ---        enum Criterium
        {
            NO_CRITERION      = 0,
            
            CMP_SCOPE         = 1,  // compare by token's scope
            IS_LOCAL          = 2,      // compare by Token::m_IsTemp: checks if token is local variable
            CMP_NAME          = 3,  //compare by token's name
            CMP_KIND          = 4,   //compare by token's kind with order defined by Token::m_TokenKind value; don't use this comparator with lower priority than IS_FN, IS_VAR, IS_CLASS, IS_NS
            IS_FN             = 5,  // compare by token's kind: checks if token is function
            IS_VAR            = 6,  //compare by token's kind: checks if token is variable
            IS_CLASS          = 7, //  ... is it class
            IS_NS             = 8, //  ... is it namespace
        };
--- End code ---
And if you set criterion to "0" (NO_CRITERION) all criteria with lower priority will be disabled, so to sort only by token's name simply set SORT_CRITERION1 to "0".

edit: those tags should be sub-nodes  of <code_completion> node.
edit2: Changes in project files are not included in patch, so remember to add doxygen_parser.* files to project.

oBFusCATed:

--- Quote from: p2rkw on January 07, 2013, 12:24:14 am ---
--- Code: ---<SORT_CRITERION1 int="2" />
<SORT_CRITERION2 int="1" />
<SORT_CRITERION3 int="6" />
<SORT_CRITERION4 int="5" />
<SORT_CRITERION5 int="7" />
<SORT_CRITERION6 int="8" />
<SORT_CRITERION7 int="4" />
<SORT_CRITERION8 int="0" />

--- End code ---

By the way I also added possibility to sort autocomplete list. You can use up to 8 sort criteria. Lower criterion number means higher priority (SORT_CRITERION1 has highest priority). Argument's specify how auto complete list will be sorted. Possible values and its meanings:

--- Code: ---        enum Criterium
        {
            NO_CRITERION      = 0,
            
            CMP_SCOPE         = 1,  // compare by token's scope
            IS_LOCAL          = 2,      // compare by Token::m_IsTemp: checks if token is local variable
            CMP_NAME          = 3,  //compare by token's name
            CMP_KIND          = 4,   //compare by token's kind with order defined by Token::m_TokenKind value; don't use this comparator with lower priority than IS_FN, IS_VAR, IS_CLASS, IS_NS
            IS_FN             = 5,  // compare by token's kind: checks if token is function
            IS_VAR            = 6,  //compare by token's kind: checks if token is variable
            IS_CLASS          = 7, //  ... is it class
            IS_NS             = 8, //  ... is it namespace
        };
--- End code ---
And if you set criterion to "0" (NO_CRITERION) all criteria with lower priority will be disabled, so to sort only by token's name simply set SORT_CRITERION1 to "0".

edit: those tags should be sub-nodes  of <code_completion> node.
edit2: Changes in project files are not included in patch, so remember to add doxygen_parser.* files to project.

--- End quote ---
If this is some separate functionallity it will be best to post a separate patch...

Also, I guess you'll have to provide some gui...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version