Author Topic: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.  (Read 115514 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #105 on: October 13, 2010, 09:45:15 am »
do you say you also can reproduce this problem or that it works for you ?

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #106 on: October 13, 2010, 10:11:23 am »
do you say you also can reproduce this problem or that it works for you ?
I can not reproduce you problem.
But i found some new issue.
Please trying r6709.

If there have some issue, please show me by picture?
Because in here, it's works well.

When type #include "c|
Will only appear all headers start with 'c'.


Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #107 on: October 13, 2010, 10:12:47 am »
If you type #include "cb|
Will list all the headers that start of "cb", like the picture show.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #108 on: October 13, 2010, 10:16:16 am »
And if you want auto completion a local header file, the header file must belong the project.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #109 on: October 13, 2010, 10:45:35 am »
that's better ;-)

I now see again the list of headers from the include paths I added.
And also the list of system headers now also reappear in the list when doing the #include "

One thing up for debate. You say local files don't show up in the list unless they are part of the project. Agreed, but when that directory is however added as an include directory, they should appear.
So in my case I added the directory where main.cpp resides as include directory, but the local, not part of the project, bar.h : doesn't show up. I would think it should ?

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #110 on: October 13, 2010, 11:17:18 am »
One thing up for debate. You say local files don't show up in the list unless they are part of the project. Agreed, but when that directory is however added as an include directory, they should appear.
So in my case I added the directory where main.cpp resides as include directory, but the local, not part of the project, bar.h : doesn't show up. I would think it should ?

Quote
wxArrayString& CodeCompletion::GetSystemIncludeDirs(Parser* parser, bool force)
{
    static Parser* lastParser = NULL;
    static wxArrayString incDirs;

    if ((!parser || !force) && parser == lastParser)
        return incDirs;
    else
    {
        incDirs.Clear();
        lastParser = parser;
    }

    cbProject* project = m_NativeParser.GetProjectByParser(parser);
    wxString prjPath;
    if (project)
        prjPath = project->GetCommonTopLevelPath();


    incDirs = parser->GetIncludeDirs();
    for (size_t i = 0; i < incDirs.GetCount();)
    {
        if (incDirs.Last() != wxFILE_SEP_PATH)
            incDirs.Append(wxFILE_SEP_PATH);
        if (project && incDirs.StartsWith(prjPath))
            incDirs.RemoveAt(i);

        else
            ++i;
    }

    return incDirs;
}
It seems can not have both! :(

If you comment two lines of code, we can solve your question.
Code
        if (project && incDirs[i].StartsWith(prjPath))
            incDirs.RemoveAt(i);
However, this will produce more side effects.

Offline Borr

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #111 on: October 14, 2010, 04:23:47 pm »
CC not show std::towlower
note: CC show std::tolower

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5906
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #112 on: October 14, 2010, 04:35:50 pm »
CC not show std::towlower
note: CC show std::tolower
hi,can you show the minimal sample code? also the steps to produce the bug.

thx.
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #113 on: October 14, 2010, 09:11:20 pm »
CC not show std::towlower
note: CC show std::tolower
Are you kidding??? Does it show or not show std::tolower ???
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 stahta01

  • Lives here!
  • ****
  • Posts: 7576
    • My Best Post
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #114 on: October 14, 2010, 09:22:03 pm »
CC not show std::towlower
note: CC show std::tolower
Are you kidding??? Does it show or not show std::tolower ???

Notice the w in one of them, I think wide char version.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Borr

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #115 on: October 14, 2010, 09:26:57 pm »
CC not show std::towlower
note: CC show std::tolower
Are you kidding??? Does it show or not show std::tolower ???

Notice the w in one of them, I think wide char version.

Yes that's right to(W)lower (wide char) missing in the CodeCompletion list

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #116 on: October 14, 2010, 10:21:23 pm »
Notice the w in one of them, I think wide char version.
Yes that's right to(W)lower (wide char) missing in the CodeCompletion list
Right... my fault - I missed that. :oops:
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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #117 on: October 14, 2010, 10:29:46 pm »
I have towlower.
It's not in std-namespace, but in global namespace.

The declaration is between __BEGIN_NAMESPACE_C99 and __END_NAMESPACE_C99, in cdefs.h is the following comment:
Code
/* The standard library needs the functions from the ISO C90 standard
   in the std namespace.  At the same time we want to be safe for
   future changes and we include the ISO C99 code in the non-standard
   namespace __c99.  The C++ wrapper header take case of adding the
   definitions to the global namespace.  */
So I think it is correctly found in global namespace, and it can (and should ? ) be used without std:: ( at least here it works fine).

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #118 on: October 15, 2010, 04:43:04 am »
file: lib\gcc\i686-mingw32\4.4.4\include\c++\cwctype
Quote
#pragma GCC system_header

#include <bits/c++config.h>

#if _GLIBCXX_HAVE_WCTYPE_H
#include <wctype.h>
#endif

#ifndef _GLIBCXX_CWCTYPE
#define _GLIBCXX_CWCTYPE 1

// Get rid of those macros defined in <wctype.h> in lieu of real functions.
#undef iswalnum
#undef iswalpha
#if _GLIBCXX_HAVE_ISWBLANK
# undef iswblank
#endif
#undef iswcntrl
#undef iswctype
#undef iswdigit
#undef iswgraph
#undef iswlower
#undef iswprint
#undef iswpunct
#undef iswspace
#undef iswupper
#undef iswxdigit
#undef towctrans
#undef towlower
#undef towupper
#undef wctrans
#undef wctype

#if _GLIBCXX_USE_WCHAR_T

_GLIBCXX_BEGIN_NAMESPACE(std)

  using ::wctrans_t;
  using ::wctype_t;
  using ::wint_t;

  using ::iswalnum;
  using ::iswalpha;
#if _GLIBCXX_HAVE_ISWBLANK
  using ::iswblank;
#endif
  using ::iswcntrl;
  using ::iswctype;
  using ::iswdigit;
  using ::iswgraph;
  using ::iswlower;
  using ::iswprint;
  using ::iswpunct;
  using ::iswspace;
  using ::iswupper;
  using ::iswxdigit;
  using ::towctrans;
  using ::towlower;
  using ::towupper;
  using ::wctrans;
  using ::wctype;

_GLIBCXX_END_NAMESPACE


#endif //_GLIBCXX_USE_WCHAR_T

test demo:
Code
void test() {}

namespace qp
{
    using ::test;
}

int main()
{
    qp::test();
    return 0;
}

Offline Borr

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.
« Reply #119 on: October 15, 2010, 07:04:38 am »
I have towlower.
It's not in std-namespace, but in global namespace.
So I think it is correctly found in global namespace, and it can (and should ? ) be used without std:: ( at least here it works fine).

sorry, it's my mistake. thanks for the reply