Comments (4)
@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.
@vigoux It may be. I need to look into a little bit further.
from nvim-treesitter.
Sorry deleted the coment, but it might be related to locals.
from nvim-treesitter.
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)
- query: invalid node type at position HOT 1
- JS/TS/ECMA css`<template>` injections not highlighting HOT 2
- query.lua:248: Query error at 58:2. Invalid node type "modeline": HOT 1
- CPP namespace indentation not counted HOT 11
- Solidity Highlighting broken HOT 1
- nvim-treesitter[c]: Failed to execute the following command HOT 2
- Disable injections for large files HOT 5
- Python incorrectly indents brackets HOT 4
- Python Tree-sitter @spell highlights string prefixes HOT 2
- stack corruption detected (-fstack-protector) HOT 1
- Insuficient Capture Groups for keywords. HOT 1
- Does not use curl/tar even with prefer_git set to false HOT 11
- Support terraform-vars highlighting HOT 2
- nvim-treesitter crashing neovim HOT 9
- Incorrect indentation on lua files
- Incorrect indentation for Typst code in bullet point after new line HOT 2
- Error: "Ranges can only be made from 6 element long" for Dockerfile HOT 2
- Compute indentexpr for the whole buffer and cache it HOT 1
- Reinstalling language parser fails on Windows when a file handle to the old parser exists HOT 9
- file types with dot notation are highlighted incorrectly HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-treesitter.