Author Topic: double class item in suggestion list  (Read 8866 times)

Offline blueshake

  • Regular
  • ***
  • Posts: 459
double class item in suggestion list
« on: September 24, 2009, 09:45:02 am »
this issue I have memtioned before.
Today I found that it is caused by this.
in int CodeCompletion::CodeComplete() in codecompletion.cpp
Code
                    for (int i = 0; i <= wxSCI_KEYWORDSET_MAX; ++i)
                    {
                        if (!m_LexerKeywordsToInclude[i])
                            continue;

                        wxString keywords = theme->GetKeywords(lang, i);
                        Manager::Get()->GetLogManager()->DebugLog(keywords);
                        wxStringTokenizer tkz(keywords, _T(" \t\r\n"), wxTOKEN_STRTOK);
                        while (tkz.HasMoreTokens())
                        {
                            wxString kw = tkz.GetNextToken() + wxString::Format(_T("?%d"), iidx);
                            if (kw.Lower().StartsWith(lastSearch))
                                items.Add(kw);
                        }
                    }


I output the context in keywrds and get the context:
you can find that there are two class(typedef and so on ) in the context,that is why there are two class(typedef)
in suggestion list.

any comments are welcome!!!!
Quote
asm auto bool break case catch char class const                                    const_cast continue default delete do double                                    dynamic_cast else enum explicit export extern                                    false float for friend goto if inline int long                                    mutable namespace new operator private protected                                    public register reinterpret_cast restrict return short signed                                    sizeof static static_cast struct switch template this                                    throw true try typedef typeid typename union unsigned                                    using virtual void volatile while                                    int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t                                    int_least8_t uint_least8_t int_least16_t uint_least16_t                                    int_least32_t uint_least32_t int_least64_t uint_least64_t                                    int_fast8_t uint_fast8_t int_fast16_t uint_fast16_t                                    int_fast32_t uint_fast32_t int_fast64_t uint_fast64_t                                    intptr_t uintptr_t intmax_t uintmax_t                                    wint_t wchar_t wctrans_t wctype_t size_t time_t                                    and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq                                    complex imaginary _Complex _Imaginary _Bool _Pragma

a addindex addtogroup anchor arg attention                                    author b brief bug c class code date def defgroup deprecated                                    dontinclude e em endcode endhtmlonly endif endlatexonly endlink                                    endverbatim enum example exception f$ f[ f] file fn                                    hideinitializer htmlinclude htmlonly if image include ingroup                                    internal invariant interface latexonly li line link mainpage name                                    namespace nosubgrouping note overload p page par param post pre                                    ref relates remarks return retval sa section see showinitializer                                    since skip skipline struct subsection test throw todo typedef                                    union until var verbatim verbinclude version warning weakgroup                                    $ @ \  < > # { }

[attachment deleted by admin]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: double class item in suggestion list
« Reply #1 on: September 24, 2009, 01:51:51 pm »
Today I found that it is caused by this.
What about a cleanup-step (e.g. after sorting just removing duplicates) for the array "items"?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: double class item in suggestion list
« Reply #2 on: September 24, 2009, 02:01:27 pm »
Quote
a addindex addtogroup anchor arg attention                                    author b brief bug c class code date def defgroup deprecated                                    dontinclude e em endcode endhtmlonly endif endlatexonly endlink                                    endverbatim enum example exception f$ f[ f] file fn                                    hideinitializer htmlinclude htmlonly if image include ingroup                                    internal invariant interface latexonly li line link mainpage name                                    namespace nosubgrouping note overload p page par param post pre                                    ref relates remarks return retval sa section see showinitializer                                    since skip skipline struct subsection test throw todo typedef                                    union until var verbatim verbinclude version warning weakgroup                                    $ @ \  < > # { }

Actually I am not very clear what these codes use for.
They seems not the keywords.why not remove them or
remove the double ones(for example class ,typedef and so on)
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: double class item in suggestion list
« Reply #3 on: September 24, 2009, 02:06:08 pm »
Actually I am not very clear what these codes use for.
They are used as (additional) keywords to complete if setup in the option of CC. They are coming from the scintilla lexers. A user can setup such (additional) keywords in the editor settings, specifically for a language.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: double class item in suggestion list
« Reply #4 on: September 24, 2009, 02:54:39 pm »
so can we modify the codes(remove the the same one compare to the keywords) to avoid the issue.(double items in suggestion list)
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?