Functions with many variables - tooltip issue

Discussion about CodeLite development process and patches
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Functions with many variables - tooltip issue

Post by nezos » Sat Mar 07, 2015 2:13 am

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

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Functions with many variables - tooltip issue

Post by eranif » Sat Mar 07, 2015 8:16 pm

Easier say than done ;)
Pull requests are most welcomed
In anycase, post a feature request on GitHub

Eran
Make sure you have read the HOW TO POST thread

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Functions with many variables - tooltip issue

Post by eranif » Thu Apr 30, 2015 9:58 am

FYI: this is now fixed in git master
Eran
Make sure you have read the HOW TO POST thread

petah
CodeLite Expert
Posts: 231
Joined: Sat Nov 24, 2012 8:04 pm
Genuine User: Yes
IDE Question: c++
Location: Los Angeles
Contact:

Re: Functions with many variables - tooltip issue

Post by petah » Sat May 02, 2015 2:54 am

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
main: Debian Jessie x64 + custom wxTrunk

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Functions with many variables - tooltip issue

Post by eranif » Sat May 02, 2015 9:55 am

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
Make sure you have read the HOW TO POST thread

petah
CodeLite Expert
Posts: 231
Joined: Sat Nov 24, 2012 8:04 pm
Genuine User: Yes
IDE Question: c++
Location: Los Angeles
Contact:

Re: Functions with many variables - tooltip issue

Post by petah » Sat May 02, 2015 11:33 am

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
main: Debian Jessie x64 + custom wxTrunk

petah
CodeLite Expert
Posts: 231
Joined: Sat Nov 24, 2012 8:04 pm
Genuine User: Yes
IDE Question: c++
Location: Los Angeles
Contact:

Re: Functions with many variables - tooltip issue

Post by petah » Wed May 06, 2015 1:29 pm

FYI in Xcode there's a pref for "code completion on overtype"

cheers,

-- p
main: Debian Jessie x64 + custom wxTrunk

Post Reply