Skip to content

How to implement re-export behavior in ScopeComputation? #1508

Answered by msujew
georg-schwarz asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @georg-schwarz,

great question! In general, I believe you're trying to achieve too much with the scope computation mechanism. While in theory this could work with a smarter compute scope strategy (i.e. a sorting of the documents), this would also break down in case of a cyclic dependency between files.

My solution would attempt to do this using the scoping mechanism directly instead of using the scope computation. During the scoping, we're allowed to resolve cross references. In your case it should be enough to adjust the global scope:

// compute the scope that can be accessed from the file that contains the reference
getGlobalScope(referenceType: string, context: ReferenceInfo): Scope {

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@georg-schwarz
Comment options

@msujew
Comment options

@msujew
Comment options

@georg-schwarz
Comment options

Answer selected by georg-schwarz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants