Git Product home page Git Product logo

Comments (3)

sam-mccall avatar sam-mccall commented on June 8, 2024

just noting offline discussion:

  • refs to base method should be returned when querying derived method
  • disagreement over whether refs to derived method should be returned when querying base method

from clangd.

HighCommander4 avatar HighCommander4 commented on June 8, 2024

In case it helps to document some existing practice, Eclipse CDT:

  • refs to base method should be returned when querying derived method

does this

  • disagreement over whether refs to derived method should be returned when querying base method

does not do this.

I think the underlying mental model is that the thing being searched for is the function body / implementation. When searching for the derived implementation, every caller of the base method is at least potentially invoking that derived implementation. When searching for the base implementation, however, calls to the derived method do not invoke the base implementation (except perhaps indirectly if the derived impl delegates to the base one, but that of course is covered by the reference in the derived impl itself).

I do think it would be nice if refs to the base method were annotated as "potential matches" when querying the derived method. LSP does not currently have a way of annotating references with extra info like this, though I've proposed this (with a different annotation in mind) and the response has been favourable.

from clangd.

sam-mccall avatar sam-mccall commented on June 8, 2024

This has been implemented (references to base methods are shown, but not to derived methods)

from clangd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.