Menu

#29 Should index X::Y() as well as Y()

current_cvs
open
3
2018-01-17
2001-11-14
Malcolm Box
No

For C++ and other OO languages, we should index both
the full scoped name of the function (ie
Class::Function()) as well as just Function().

This looks easy(ish) to do - ctags already spits out
the class of a method in the extended information, and
it would be easy to insert another entry for the full
name. References would be harder - it's much more
difficult if not impossible to determine what function
a callsite will actually resolve to except by doing a
full compile. So we might have to settle for indexing
the declarations of the fully scoped names but not the
references, or strip out scope when running ident.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Also C++ namespace scoping does not work... and is similar
    in syntax.. not sure if another bug should be created or not...

    //in somefile.h
    namespace ns{ class Foo{};};

    //in some_other_file.cpp
    void func(){
    ns::Foo f; //<-- will not be linked
    }

    unfortunately, his affects about 90% of my code...

     
  • Nobody/Anonymous

    Logged In: NO

    Also C++ namespace scoping does not work... and is similar
    in syntax.. not sure if another bug should be created or not...

    //in somefile.h
    namespace ns{ class Foo{};};

    //in some_other_file.cpp
    void func(){
    ns::Foo f; //<-- will not be linked
    }

    unfortunately, his affects about 90% of my code...

     
  • Malcolm Box

    Malcolm Box - 2009-03-26
    • priority: 6 --> 3
     
  • AdrianIssott

    AdrianIssott - 2009-06-20

    In source files when functions are defined it'd also be good to have the

    ClassName::FunctionName
    | |
    URL URL
    to to
    ident ident
    search search
    for for
    ClassName ClassName::FunctionName

     
  • AdrianIssott

    AdrianIssott - 2009-06-20

    My text layout just got chomped. So what I meant was that for a function definition (ClassName::FunctionName) in a source file it'd be good if LXR added a URL to an ident search for ClassName around the ClassName text but a URL to an ident search for ClassName::FunctionName around the FunctionName text.

     
  • Jitendra Marndi

    Jitendra Marndi - 2018-01-17

    [lxr-2.2.1] The typical thing to note here is while searching for "Y" in /ident, it returned "X::Y()" as reference link. On clicking on that link it opened /ident in new tab with "X3A3AY" as default search text. Since LXR doesn't index X::Y() it showed no results.
    As a workaround I have edited perl subroutine 'idref' defined in "Common.pm" to truncate "X3A3A" from search text.

     
    • Andre-Littoz

      Andre-Littoz - 2018-01-17

      Please attach your patcj so that I can merge it into the master branch.

       

Log in to post a comment.