Bug 271007 - Bad code completion from empty assignment to enum type
Summary: Bad code completion from empty assignment to enum type
Status: RESOLVED DUPLICATE of bug 271083
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 4.2.1
Platform: Unlisted Binaries Linux
: HI normal
Target Milestone: 4.2.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-15 05:08 UTC by Nicolás Alvarez
Modified: 2011-06-09 08:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolás Alvarez 2011-04-15 05:08:08 UTC
In this code snippet:

enum Foo {
    FooOne,
    FooTwo,
    FooThree
};

int main() {
    Foo x = 
}

invoking code completion after the assignment doesn't give very useful results. (note this is only if I didn't type *anything* after the equals sign! see last paragraph)

Under 'Best Matches', I get "Foo" as the only option. This makes little sense; why would you want to write the type name in this context?

That option is followed by a long list of functions and types in the global scope. Only *after* that (ie. near the end of the entire completion list), I get an unnamed group containing all enumerated values in scope. The three ones from the Foo enum are shown in green, like best matches usually are. However, the ones from Foo aren't even at the beginning of that unnamed group in the completion results (the whole group is sorted alphabetically).

If I simply type an 'F', ie. getting a completion of "Foo x = F", it shows almost the expected best matches: the Foo type, and the FooOne, FooThree, and FooTwo values. The enum type still shouldn't be there, but at least now the values show as they should.
Comment 1 Milian Wolff 2011-04-15 11:54:55 UTC
very true, I'm bugged by this very often as well.
Comment 2 Olivier.jg 2011-06-09 08:23:46 UTC
Same as 271083

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