2

I'm using Eclipse as my IDE for a C++ project, and I would love for it to tell me where a given symbol is defined and what the parameters are for a function.

However, there's a catch: I also use Lazy C++, a tool that takes a single source file and generates the .h and the .cpp files. Those .lzz files look like headers, but this tool supports some very mild syntactic benefits, like combining nested namespaces into a qualified name. Additionally, it has some special tags to tell the tool specifically where to put what (in header or in source file).

So my typical SourceFile.lzz looks like this:

$hdr
#include <iosfwd>
#include "ProjectA/BaseClass.h"
$end

$src
#include <iostream>
#include "ProjectB/OtherClass.h"
$end

// Forward declarations
namespace BigScope::ProjectB
{
  class OtherClass;
}

namespace BigScope::ProjectA
{
  class MyClass : public ProjectA::BaseClass
  {
    void SomeMethod(const ProjectB::OtherClass& Foo) { }
  }
}

As you see, it's still recognizable C++, but with a few extras.

For some reason, CDT's indexer does not seem to want to index anything, and I don't know what's wrong. In the Indexer View, it shows me an empty tree, but tells me that it has some 15000 symbols and more stuff, none of which I can seem to access.

So here's my question: how can I make the Indexer output some more information about what it's doing and why it fails when it does so, and can I tweak it more than with just the GUI-accessible options?

Thanks,

Carl

4

2 に答える 2

2

次のいずれかを想像します。

  • Eclipse は非 C++ リソースをツリーに表示したくありません (これには問題がありました)。

  • [設定] > [C/C++] > [インデクサー] > [すべてのファイルのインデックス] が有効になっていません。

  • 「Fast C/C++ Indexer」ではなく「Full C/C++ Indexer」を使用したい

于 2008-09-12T15:16:52.597 に答える
1

CDT パーサー/インデクサーは、そのような奇妙な拡張機能を認識しません。唯一できることは、パスとシンボルのプロパティ ページでマクロを定義して、パーサーをだますことです。$hdr$endおよび$src本文が空のマクロを作成してみてください。そうすれば、プリプロセッサはそれらを削除し、パーサーはそれらを詰まらせません。

于 2009-05-07T20:59:53.777 に答える