开发者

Auto complete in codeblocks

开发者 https://www.devze.com 2023-03-21 03:56 出处:网络
Every time I programming in CodeBlocks, In the beginning, the auto complete work fine. After some action and minutes (I don\'t know exactly what the reason), the auto complete work partly.

Every time I programming in CodeBlocks, In the beginning, the auto complete work fine. After some action and minutes (I don't know exactly what the reason), the auto complete work partly.

It complete base variables' names, but it don't complete inner names of structures etc.

Wha开发者_JAVA技巧t's the reason?

In "inner names of structure" I mean, for example, for the variable gl.A:

typedef struct
{
bool A;

} B;          
B gl;

thank you,

and sorry about my poor english...


Also (as an addition to Lubulos' answer), when you see that this happens, try going to the left pane (Projects management), right-click your project, and then click 'Reparse this project'. You'll notice the bar that shows the current code block at the top will become grayed out for a while. When it is restored, try writing again what you were typing, and check if the problem is gone.

You can also sometimes use 'Reparse this file' which is a bit faster, if you have been editing just one file since the beginning (or since the last reparse).


The Code::Blocks' code completion plugin (Code::Completion) is wonderful, but has some bugs. If you program in C++, for example, methods and attributes completion doesn't work sometimes.

Currently in Code::blocks' forum there's a section named CodeCompletion Redesign where developers continuously improve the plugin. After you double-checked that your plugin's settings are all right (Plugin > Manage Plugins or Setting > Editor... > Code::Completion & Symbol Browser), if your problem still persist, try visiting the forum.


For me, it was a rogue "'" at the end of an include statement which stopped the code completion plugin from working. Since the code still compiled, this was difficult to see.

Removing this rogue "'" fixed the problem. The original code was:

#include "DialogSA.h"'

Changing this line to the following (i.e. deleting the rogue "'") fixed CodeComplete in C::B:

#include "DialogSA.h"

In a nutshell, your problem might not be due to the plugin itself, rather a slight error in your code (which in my case still compiled so was therefore difficult to find)


Also (as an addition to Lubulos' answer), after you check your settings and it still doesn't work make sure you close and reopen your file/project as it won't update it automatically, atleast that was the case for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号