Giter VIP home page Giter VIP logo

Comments (4)

vigoux avatar vigoux commented on May 23, 2024 2

@theHamsta , I don't really agree with that, in the case of functions for example, you can find the definition of that function below the cursor (for example in Rust).
Regarding the fact it finds things somewhere else is quite weird, as it should only go upwards in scope hierarchy, that needs a bit of investigation.

from nvim-treesitter.

steelsojka avatar steelsojka commented on May 23, 2024

@vigoux It may be. I need to look into a little bit further.

from nvim-treesitter.

vigoux avatar vigoux commented on May 23, 2024

Sorry deleted the coment, but it might be related to locals.

from nvim-treesitter.

theHamsta avatar theHamsta commented on May 23, 2024

I think the find_definition should always find declarations before the current cursor position.

Consider the following example:

void normalReactionTest(cr::HCSITS& cr, SphereID sp)
{
   contactThreshold = Thresholds<real_t>::contactThreshold();
   // plane at 5,5,5
   // radius 1.1
   sp->setPosition(  Vec3(5,5,6) );
   sp->setLinearVel( Vec3(0,0,0) );
   cr.setErrorReductionParameter( real_t(1.0) ); // <----------------- cursor at beginning of line
   cr.timestep( real_c( real_t(1.0) ) );
}

int main( int argc, char** argv )
{
   cr::HCSITS cr(globalBodyStorage, forest->getBlockStoragePointer(), storageID, hccdID, fcdID); // <-- will find this definition
   return EXIT_SUCCESS;
}
} // namespace walberla

Without #145 it can't recognize the definition of cr as an arguments and finds cr in a completely different scope (no ideas why it can find stuff from a different scope)

from nvim-treesitter.

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.