Page 1 of 1

Functions with many variables - tooltip issue

Posted: Sat Mar 07, 2015 2:13 am
by nezos
Declare a function with many variables and long names.

While entering the function variables, the tooltip appears but it is trimmed and will never show all variables, especially the last ones. Even if you scroll to the right the tooltip will remain the same.

Maby a solution would be to wrap the text (occupy 2 or more lines).

Re: Functions with many variables - tooltip issue

Posted: Sat Mar 07, 2015 8:16 pm
by eranif
Easier say than done ;)
Pull requests are most welcomed
In anycase, post a feature request on GitHub

Eran

Re: Functions with many variables - tooltip issue

Posted: Thu Apr 30, 2015 9:58 am
by eranif
FYI: this is now fixed in git master
Eran

Re: Functions with many variables - tooltip issue

Posted: Sat May 02, 2015 2:54 am
by petah
Hi Eran,

I have a (sortof) related question, when the tooltip char len trigger is set to, say, 4, and you type a function name that is 4-characters long, upon typing the last (4th) character, the completion tooltip will pop up although there's nothing more to complete :D This also happens other times like when you replace e.g. "myclass->mymember" with "myclass.mymember". It'll pop up code completion although the right side is already completed. Does it make sense to add an option to mute code completion in that case?

thx!

-- p

Re: Functions with many variables - tooltip issue

Posted: Sat May 02, 2015 9:55 am
by eranif
The completion will offer only entries that contains at least 4 chars (in your case)
Lets say you have the following 2 member and CC will trigger when 6 chars is typed:

Code: Select all

m_name
m_namingConvention;
When you type:

Code: Select all

m_name
(which is 6 chars length) CC will only offer m_namingConvention
I don't see the reason to resuggest m_name (it already fully typed in the editor)

Eran

Re: Functions with many variables - tooltip issue

Posted: Sat May 02, 2015 11:33 am
by petah
Sorry I wasn't clear enough; I meant there are cases where CC (possibly) shouldn't trigger at all. Taking your example of a 6-char trigger, consider the following class definition:

Code: Select all

class Controller
{
public:

int  m_3456;
};
Then when writing:

Code: Select all

Controller ctrl;

ctrl.m_3456 = 0;
Code completion will pop up upon typing '6', even though there is nothing more to suggest than what's already been typed.

Another related case happens after refactoring. Say I first change the member definition so it becomes a pointer (never mind the dangling logic):

Code: Select all

class Controller
{
public:

int  *m_3456;
};
When changing the cpp code I would select the '.' then type over '->', so that

Code: Select all

ctrl.m_3456 = 0;
becomes

Code: Select all

ctrl->m_3456 = 0;
When I type the '>' character, CC will pop open even though there already is a valid (unique and complete) member to the right of the text editor insertion point. This last example encompasses the 1st example. AFAICT the only time you'd want CC to pop open when there's already a unique candidate to the right is when typing over existing code with the intention of inserting different members.

I know there's a pref to auto-insert a single CC suggestion but it wouldn't be the same as muting (canceling pre-emptively) CC from triggering.

Let me know if this still isn't clear, makes no sense or I'm just being a nitpicker/pain-in-the-ass ;)

thx!

-- p

Re: Functions with many variables - tooltip issue

Posted: Wed May 06, 2015 1:29 pm
by petah
FYI in Xcode there's a pref for "code completion on overtype"

cheers,

-- p