Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtags not indexing the functions fully even for rtags source code. #1432

Closed
akh2008 opened this issue Mar 22, 2022 · 1 comment
Closed

rtags not indexing the functions fully even for rtags source code. #1432

akh2008 opened this issue Mar 22, 2022 · 1 comment

Comments

@akh2008
Copy link

akh2008 commented Mar 22, 2022

Describe the bug
rtags not indexing the complete function and i can not see the symbol info for a part of function. This leads to various commands not working i.e jump to definition, references, symbol info etc.

To Reproduce
Steps to reproduce the behavior:

  1. Index the rtags repo with rc -J <compile_command dir>
  2. Some part do not work for rc commands given below.

Expected behavior
functions should be indexed and all expected symbols should be available.

Screenshots/Backtrace
The following piece of code does not index in given function. This is one example from rtags repo itself.

File: src/ClangIndexer.cpp
Function:
bool ClangIndexer::superclassTemplateMemberFunctionUgleHack(const CXCursor &cursor, CXCursorKind kind,
Location location, const CXCursor &/ref/,
Symbol **cursorPtr)

        case 1:
            // ### not sure this is correct with line/col
            return handleReference(cursor, kind,
                                   Location(location.fileId(), location.line(), location.column() + 1),
                                   alternatives.front(), cursorPtr);
            break;
        case 0:
            break;
        default:
            warning() << "Can't decide which of these symbols are right for me"
                      << cursor << alternatives
                      << "Need to parse types";
            break;
        }
    }

----> Here cursor on handleReference() do not jump to definition(no commands works like references, symbol info etc) and also no output for rc command (rc --absolute-path -f src/ClangIndexer.cpp:991:24 and similar)

--> dump of file map shows no content for above mentioned code lines. From 987 to 1004, there is no database for any symbols.

| src/ClangIndexer.cpp:987:30:   | Symbol(src/ClangIndexer.cpp:987:30: SymbolName: const List<CXCursor>   |
*                                * alternatives Kind: VarDecl Type: const List<CXCursor> SymbolLength:    *
*                                * 12 Range: 987:9-987:42 Linkage: No Linkage Definition Usr:             *
*                                * c:ClangIndexer.cpp@34343@S@ClangIndexer@F@superclassTemplateMemberFunc *
*                                * tionUgleHack#&1$@SA@CXCursor#$@E@CXCursorKind#$@S@Location#S0_#**$@S@S *
*                                * ymbol#@alternatives                                                    *
*                                * )                                                                      *
| src/ClangIndexer.cpp:1004:5:   | Symbol(src/ClangIndexer.cpp:1004:5: SymbolName: return Kind:           |
*                                * ReturnStmt SymbolLength: 6 Range: 1004:5-1004:17 )                     *

Environment (please complete the following information):

  • OS/Version: macOS 12.2.1
  • RTags(rdm,rc): 2.41.134 (compiled from latest, issue is seen with older versions, i do not know if this worked for any version)
  • Emacs: using VIM.
  • LLVM/Clang: Apple clang version 13.0.0 (clang-1300.0.29.30)/13.0.1
@Andersbakken
Copy link
Owner

Sorry about the super long turnaround time. I can't reproduce this. Both on mac and linux both follow location, find references and all other commands I checked works against that location (src/ClangIndexer.cpp:998:20: in current master).

It's possible it has been fixed since the bug was reported. Which libclang version are you using? Can you still reproduce this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants