Bug 81330

Summary: Code completion in C files doesn't work for typedefs
Product: [Applications] kdevelop Reporter: Boris S <boris_s>
Component: Code completionAssignee: KDevelop Developers <kdevelop-devel>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Boris S 2004-05-11 14:37:40 UTC
Version:           3.0.x (using KDE KDE 3.2.2)
Installed from:    RedHat RPMs
OS:                Linux

It looks like the issue has been brought up before for C++.
However this bug is specific for C projects right now. it can be reproduced easily

this is the code ( important: C only project)

typedef struct mystruct_
{
  int a;
  int b;
}my_type_t;

int func()
{
  my_type_t var;
  my_type_t *ptr;
  
  ptr=malloc(sizeof(my_type_t));

  var.[CTRL-SPACE]
  ptr->[CTRL-SPACE]
}

in both cases code completion fails;
if you remove typedef and just use
struct mystruct_ var;
then code completion works perfectly.

So this is an issue related to typedefs

FYI C++ specific project options have typedefs are enabled for code completions. I am not sure if it supposed to affect C projects.  In any case enabling it there doesn't make code completion work, unfortunately.
Comment 1 Jens Dagerbo 2004-05-12 18:16:56 UTC
Does this example work in a C++ project, or why do you think it is "specific for C projects"?
Comment 2 Jens Dagerbo 2004-05-14 21:48:57 UTC
Still hoping for an answer. Setting component to code completion.
Comment 3 Jens Dagerbo 2004-05-14 23:38:43 UTC
OK, found the other report..

1. This doesn't work for C++ either.
2. C and C++ uses the same language support part.

Conclusion: dupe. Closing.

*** This bug has been marked as a duplicate of 74347 ***