Resolving Reference Outside of the Current File

I am trying to implement reference resolution for identifiers that are defined in other files either in the project or in libraries.

Does anyone have a good example of how to implement this?

2 comments
Comment actions Permalink

Hi Jon,

I have an example at:

https://github.com/cmf/schemely/blob/master/src/schemely/psi/impl/SchemeFile.java (see the resolve method).

Disclaimers: the code is pretty rough, and I'm using custom resolution, not Java-style ScopeProcessor type resolution - I have a todo to fix this. I use this in my plugin to provide resolution to stubs for external APIs (Scheme R5RS in this case). I provide stubs in the plugin jar which provide the psi elements to refer to - this code will show you how to create references to these types of elements, but I imagine other types of elements are pretty similar. This is based on a discussion I had with Dmitry here: javascript:;

Let me know if you have any questions.

Cheers,
Colin

Edit: fixed link after project reorganisation

1

Please sign in to leave a comment.