News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

The 25 september 2010 build (6634) CODECOMPLETION BRANCH version is out.

Started by killerbot, September 27, 2010, 06:08:14 PM

Previous topic - Next topic

killerbot

do you say you also can reproduce this problem or that it works for you ?

Loaden

Quote from: killerbot on October 13, 2010, 09:45:15 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'.


Loaden

If you type #include "cb|
Will list all the headers that start of "cb", like the picture show.

Loaden

And if you want auto completion a local header file, the header file must belong the project.

killerbot

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 ?

Loaden

Quote from: killerbot on October 13, 2010, 10:45:35 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 ?

QuotewxArrayString& 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.
        if (project && incDirs[i].StartsWith(prjPath))
            incDirs.RemoveAt(i);

However, this will produce more side effects.

Borr


ollydbg

Quote from: Borr on October 14, 2010, 04:23:47 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.

MortenMacFly

Quote from: Borr on October 14, 2010, 04:23:47 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

stahta01

Quote from: MortenMacFly on October 14, 2010, 09:11:20 PM
Quote from: Borr on October 14, 2010, 04:23:47 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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Borr

Quote from: stahta01 on October 14, 2010, 09:22:03 PM
Quote from: MortenMacFly on October 14, 2010, 09:11:20 PM
Quote from: Borr on October 14, 2010, 04:23:47 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

MortenMacFly

Quote from: Borr on October 14, 2010, 09:26:57 PM
Quote from: stahta01 on October 14, 2010, 09:22:03 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jenna

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:
/* 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).

Loaden

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:
void test() {}

namespace qp
{
    using ::test;
}

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

Borr

Quote from: jens on October 14, 2010, 10:29:46 PM
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