Author Topic: Behavior of SmartSense  (Read 7189 times)

Offline pluto

  • Multiple posting newcomer
  • *
  • Posts: 15
Behavior of SmartSense
« on: February 19, 2016, 01:19:43 pm »
I guess that with code completion enabled, and smart sense disabled, the pulldown list should not pop up automatically, but only when called via the shortcut key (I think the default is ctrl+space).
Is this the intended behavior? I ask because at the moment (v16.01, win32) it seems that the list pops up automatically *and* via shortcut, but not *only* via the shortcut.
Can anyone confirm this? thanks :)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6079
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Behavior of SmartSense
« Reply #1 on: February 19, 2016, 02:51:49 pm »
Smart sense means context scope information should be considered. For example

Code
class A1
{
    int a1;
};

class A2
{
    int a2;
};

int a3;

A1 obj;

obj.a|


You try to get code completion at the "|" position.

If smart sense is enabled, you will get the result prompt
Code
a1
This is because only the token "a1" is under the scope of obj's type "A1".

If smart sense is disabled, you will get the result prompt
Code
a1
a2
a3
...
...
You see that it just do a plain text code completion, thus all the tokens which start with "a" will be listed.

For your request, I think you should go to the Menu->Settings->Editor->General settings
In the first editor settings panel. If you disable the "code completion" option, then both auto launch and shortcut feature is totally disabled. As a workaround, keep the "code completion" option on, but set the "Autolaunch after typing # chars" to a quite big value, such as 8.

@devs:
What's your opinion, it is possible to add an option that "disable the autolaunch, and only allow shortcut" to fire the code completion (suggestion list)?

« Last Edit: February 19, 2016, 03:15:38 pm by ollydbg »
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.

Offline pluto

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Behavior of SmartSense
« Reply #2 on: February 19, 2016, 03:05:36 pm »
Thank you for the clarification :)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6079
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Behavior of SmartSense
« Reply #3 on: February 19, 2016, 03:14:41 pm »
Thank you for the clarification :)
You are welcome.
Since this feature is not implemented yet. I think you can write a feature request in our SF's ticket system( see Tickets ), so maybe some day, some one will implement this feature.
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.

Offline pluto

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Behavior of SmartSense
« Reply #4 on: February 19, 2016, 04:51:28 pm »
I'd like to do it myself, but I'm not really versed in C++, but more importantly, it would be nice to have at least some diagram or a text intro on the CB architecture, to ease the access to people who don't have time to commit on the main project, but have some time for small patches and tweaks ;p
I'm totally offtopic anyway :p

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Behavior of SmartSense
« Reply #5 on: February 19, 2016, 05:50:00 pm »
I'd like to do it myself, but I'm not really versed in C++, but more importantly, it would be nice to have at least some diagram or a text intro on the CB architecture, to ease the access to people who don't have time to commit on the main project, but have some time for small patches and tweaks ;p
I'm totally offtopic anyway :p
I would guess the easiest way to get going is to branch off "codeblocks_sf" of Obfuscated in GitHub, do your thing and perform a pull-request ?

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline pluto

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Behavior of SmartSense
« Reply #6 on: February 19, 2016, 06:40:28 pm »
I tried a couple of times in the past, but the time taken to guess what does what and where, was too much and in the end I contributed nothing :(
Of course, I'm not talking about everybody here. Just my experience.

But consider this: CB has a great advantage over most open source projects, in that every single one of its users is a programmer, meaning a potential contributor.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Behavior of SmartSense
« Reply #7 on: February 19, 2016, 08:29:37 pm »
There is a doxygen documentation, I think you can even download it from the site.

@ollydbg: I don't think new option is need. Probably use this one and make the 0 a special value that disables it.
(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!]