Code::Blocks

User forums => Using Code::Blocks => Topic started by: pieman on April 04, 2014, 04:17:41 pm

Title: Code Hinting but not Completion
Post by: pieman on April 04, 2014, 04:17:41 pm
I first learned to program using a tool known as Game Maker. :D

Rather than the popular 'code completion' model I'll find in most IDE's, Game Maker's built-in code editor (Game Maker 5 and 6) had a panel below which was similar to code completion behavior, but integrated into a symbol-browsing format. It would instantly adapt its filtering towards the current symbol at the user's textual cursor. This was nice because I could click on a function (or 'script') call within the textual code editor and see whether it has remained valid over the course of a project's needs (and so on). If I wanted to use an extended function, it'd be easy to see the arguments once again and begin elaborating on whatever parameters I initially needed. I prefer this because it can operate in instantaneity (without any delay) and it's not intrusive. I think traditional code completion really breaks my flow. If you already know a symbol's name, it can be annoying to see random crap flicker around and sometimes replace whatever you were typing if you don't type it fast enough. Maybe I'm stupid, but that's what happens to me; I find it intrusive and annoying. I don't mind the overlay itself too much, but is there an option to disable the completion aspect (i.e. it won't replace whatever you're typing) and keep the useful hint to confirm whether I identified a symbol correctly (the popup overlay)? Also, I really prefer static interface elements over dynamic rubbish.

Now, I think it'd be nice to have a Game Maker-like symbols option which integrates the symbols browser into a tab on the logs pane and immediately adapts its filtering to where-ever the textual cursor is at.

Example:

Code: [Select]
float radiusBase;
float radiusMiddle;
float radiusTip;
float radiusMidRatio;
float radiusVariation;

float tropismA1;
float tropismB1;
float tropismA2;
float tropismB2;

If I type 'tropis' in text insertion mode, the textual cursor will be at the end of 'tropis|' and so the logs-integrated adaptive symbols pane will show:

Code: [Select]
float tropismA1;
float tropismA2;
float tropismB1;
float tropismB2;

If I continue to type, 'tropismA', then it will adapt to:

Code: [Select]
float tropismA1;
float tropismA2;

It won't become intrusive, so I'll just be able to glance down to ensure I typed it correctly. It may also help remind me how to complete whatever I'm typing.

Now consider a function like this: 'void Cheese(int a, int b = 0)'

If I've only used the first parameter, then if ever I come to need the second, I can simply notch my text-cursor anywhere within/adjacent to the function call, like 'Che|ese(25)', 'Cheese(2|5)', 'Cheese(25|)' or 'Cheese(25)|' and the heads-up-display-type symbols browser will hint:

'void Cheese(int a, int b = 0)'

That's just a small suggestion. I hope you consider providing it as an optional feature. ;D
Title: Re: Code Hinting but not Completion
Post by: pieman on April 06, 2014, 01:15:28 am
bump

Unworthy of reply? Well, my core question was:

Quote
is there an option to disable the completion aspect (i.e. it won't replace whatever you're typing) and keep the useful hint to confirm whether I identified a symbol correctly (the popup overlay)?

Please at least answer that question. I'm not sure if this option exists, though there's a possibility it may and I haven't found it.

Thank you! :)
Title: Re: Code Hinting but not Completion
Post by: BlueHazzard on April 06, 2014, 03:15:26 am
i personally need more the space without the log window instead of a other window what suggest things, that can be showed in a little window, which disappear when it is not needed, in a big clumsy window.... (strange sentence, i should go to bed...) . But if you can provide a patch (or better a plugin (it should be a lot easier to use the cc sdk after the integration of alphas patches)) i would take a look on it.

You can disable code completion: Settings->Editor->Code completion->Disable code completion

good night (morning)


Title: Re: Code Hinting but not Completion
Post by: pieman on April 06, 2014, 04:10:19 am
I'd prefer a "Symbols list" tab embedded into the logs frame. I switch between log-tabs frequently and use F2 to hide it whenever it's entirely too cumbersome. I've decided I'm not going to develop any plugins for Code::Blocks. Sorry. I'm practicing a personal paradigm and -- until I've established it in a lucid way (after a year or two's time) -- I don't want to mush it with other nasty horrendous substrates which will inescapably develop in my mind's corners after working with other programmer's 'make-a-class-for-everything' jizz. (OCD thing)

If someone like my ideas, they may implement them; but if nobody else does -- they won't get implemented.
Title: Re: Code Hinting but not Completion
Post by: scarphin on April 06, 2014, 04:48:04 am
There is a 'symbol list' tab in the 'project manager' I think if that's what you are looking for. ;/
Title: Re: Code Hinting but not Completion
Post by: pieman on April 06, 2014, 06:54:36 pm
From my experience so far it doesn't seem to update its filter given the location of the textual cursor. It's also inconvenient as a tab in pair with the Project Manager; I navigate with the project manager and want to use symbols for reminding-purposes rather than navigation. I was looking towards something integrated with the logs panel.
Title: Re: Code Hinting but not Completion
Post by: pieman on April 06, 2014, 07:25:29 pm
Here's a screenshot to show how it looked:

(http://indicable.com/GameMaker6_CodeEditor.png)
Title: Re: Code Hinting but not Completion
Post by: oBFusCATed on April 06, 2014, 07:41:56 pm
Image is not accessible...  ???
Title: Re: Code Hinting but not Completion
Post by: pieman on April 07, 2014, 12:07:58 am
Hmm, I can see it. >:(
Title: Re: Code Hinting but not Completion
Post by: jens on April 07, 2014, 08:50:04 pm
Hmm, I can see it. >:(
Doesn't work here either.
Some days ago you posted an image in another thread (but removed it later). That image was also not accessible.
Title: Re: Code Hinting but not Completion
Post by: BlueHazzard on April 07, 2014, 11:46:01 pm
i can see it...
Title: Re: Code Hinting but not Completion
Post by: ollydbg on April 08, 2014, 02:53:11 am
Image is not accessible...  ???
Me too.

EDIT: It looks like the OP want to show the tooltip information(and suggest list) in an window embedded in the logs panel.
EDIT2: I can see the image now.
Title: Re: Code Hinting but not Completion
Post by: pieman on April 08, 2014, 11:42:12 pm
My server must suck or something. It's just a friend's who's letting me run my domain on it.
Title: Re: Code Hinting but not Completion
Post by: dmoore on April 09, 2014, 01:21:57 am
I thought we went through this with doc popups. Frankly, it's just a waste of screen real estate to have a window permanently open to display contextual info like this. It's an open source project so whoever likes this should by all means go ahead, but don't expect that this will replace default behavior. (I don't speak for other devs of course)
Title: Re: Code Hinting but not Completion
Post by: pieman on April 11, 2014, 08:15:20 am
I was requesting it as an option.
Title: Re: Code Hinting but not Completion
Post by: pieman on April 11, 2014, 08:25:33 pm
Hey.



Hello?


Quote
Frankly, it's just a waste of screen real estate to have a window permanently open to display contextual info like this.

NO! I SAID A TAB, MULTIPLE TIMES. A tab integrated into the logs panel. It makes perfect sense. After you get your build messages, you'll be pushing through code using the build messages. Once you've fixed your code to be however you want it fixed, then you'll possibly be working on new, novel code. In that circumstance, it's appropriate to switch from build messages to the "contextual info" while developing new stuff, rather than fixing issues named in the build messages!

What the fuck people..

A tab. A tab. A tab! How do you manage to concede this and unmistakable simple design decision?

BUILD PROGRAM.

LOOK, BUILD MESSAGES.

ADDRESS BUILD MESSAGES.

GOOD.

NOW I HAVE THOUGHTS ON SOMETHING NEW I NEED TO WORK ON.

SWITCH FROM BUILD MESSAGES TAB TO SYMBOLS LIST TAB.

NOW THE BUILD MESSAGES TAB HAS BEEN REPLACED WITH THE SYMBOLS LIST TAB.

I DO NOT NEED THE BUILD MESSAGES TAB. IT HAS BEEN APPROPRIATELY REPLACED.

SCREEN SPACE CONSERVED.

Freaking shit.
Title: Re: Code Hinting but not Completion
Post by: pieman on April 11, 2014, 08:37:17 pm
Game Maker's code editor lacked line numbers. Have you mistaken that screenshot image as like a scratch pad window thing? It's not. It's a code editor.
Title: Re: Code Hinting but not Completion
Post by: dmoore on April 11, 2014, 08:40:07 pm
Let me fix that for you... :D

What the fuck people..

BUILD PROGRAM.

LOOK, BUILD MESSAGES.

ADDRESS BUILD MESSAGES.

GOOD.

NOW I HAVE THOUGHTS ON SOMETHING NEW I NEED TO WORK ON.

F2 - HIDE LOGS AND OTHERS, ENJOY IMPRESSIVE VISTA OF CODE WITH CODECOMPLETION POPUPS RIGHT WHERE YOU ARE TYPING.

SCREEN SPACE MAXIMIZED!

Also on a wide screen, the placement on the left side of symbols is probably a better use of screen real estate than displaying that info below.
Title: Re: Code Hinting but not Completion
Post by: pieman on April 11, 2014, 08:48:22 pm
Actually, I do that indeed. I use F2 frequently (and I sometimes pin the logs panel to the right), but I'm saying, if you're keeping the logs panel open anyway, it may as well be more useful when you're not tracing the build messages.

It makes sense to me to have the feature I suggested paired in the same neighborhood as build messages, since build messages are attached to symbols and line numbers (they're a browsing solution). When I write new code, I don't want to browse, I want to reference (without browsing; need to focus on code HERE)! It's quite a nice duality, I think.

Code completion won't appear if a function (or whatever) has already been written. Then I must visit declarations. This wastes my time quite effectively. It makes it somewhat more difficult to focus on whatever I'm programming.

.. and it fucks up what I'm typing and when I'm typing I won't notice the evil shit popup out of hell and then rape my children before I finish typing. That's why I leave code completion disabled.
Title: Re: Code Hinting but not Completion
Post by: BlueHazzard on April 11, 2014, 09:13:07 pm
Code completion won't appear if a function (or whatever) has already been written. Then I must visit declarations. This wastes my time quite effectively. It makes it somewhat more difficult to focus on whatever I'm programming.

.. and it fucks up what I'm typing and when I'm typing I won't notice the evil shit popup out of hell and then rape my children before I finish typing. That's why I leave code completion disabled.

actually not, just move the mouse cursor in top of the function and a popup will show you your info...

and why you don't ignore the cc popup?
Title: Re: Code Hinting but not Completion
Post by: pieman on April 11, 2014, 09:23:38 pm
Hmm. I'm reconsidering the code completion options. I thought I had gone through it painfully and tried to configure it how I'd like (without success) already. On a second investigation, it seems more promising. The code completion toolbar does exactly what I was requesting initially. I never noticed that. Whoops :-\

Let's see about what seemed to eternally and ingracefully replace whatever I was typing, because that doesn't seem like such a solid complaint ( I was probably just being a dumbass ).

I was probably in a shitty mood and things didn't work exactly as I expected, so I didn't bother enough with actually coming to understand how it worked. :-*
I'm often in a shitty mood. :P

All of this was decided when I first began to use Code::Blocks, which remains by far the best and most sensible C++ IDE yet. That was many years ago, so I've forgotten what code completion was like anyway. That was also with a much older version. :-X

Edit:

No. Wait, it only adapts to the current scope. It's still a pointless browsing thing. Ugh. Also, I noticed the tooltip a few minutes ago. Yeah. I've made some comments about that elsehwere.
Title: Re: Code Hinting but not Completion
Post by: pieman on April 11, 2014, 09:38:23 pm
Errm. WHAT WAS REPLACING MY STUFF? Maybe I had the "Auto-select" option enabled. Was that the culprit?
Title: Re: Code Hinting but not Completion
Post by: BlueHazzard on April 11, 2014, 09:43:17 pm
Errm. WHAT WAS REPLACING MY STUFF? Maybe I had the "Auto-select" option enabled. Was that the culprit?
i don't know any feature that replaces without your intention...

PS. : PLEASE DON'T SHOUT this is rude... also your other expressions aren't very nice. CC is a main feature of c::b and many developer are happy with it. If you want this feature really bad i recommend you to use your energy to implement it and not to flame on this forum...
Title: Re: Code Hinting but not Completion
Post by: pieman on April 13, 2014, 05:40:39 am
struct ThisIs *enter*
struct ThisIsWhyCodeCompletionCanBeAnnoying

When I meant to write: ThisIs

I guess you could fix this by disabling code completion on the same line as a struct/class/union declaration.
Title: Re: Code Hinting but not Completion
Post by: Alpha on April 13, 2014, 07:49:04 am
Have you tried Shift-Enter?
Title: Re: Code Hinting but not Completion
Post by: BlueHazzard on April 13, 2014, 11:28:18 am
or ctrl+j (see the magic)

[Edit:] sry, this works only if you write struct/class/switch and hit ctrl+j. For your problem, you can also simply add a white space after typing your word, and then hit enter...

greetings