Skip to content
Discussion options

You must be logged in to vote

Hey @ejfasting,

I believe you're pretty much there. Recomputing the global scope is always quite expensive, which is why the DefaultScopeProvider caches the global scope. You should be able to do the same to fix the performance issue:

    private documentCache: DocumentCache<string, Scope>;
    ...
    protected override getGlobalScope(referenceType: string, context: ReferenceInfo): Scope {
        const document = AstUtils.getDocument(context.container);
        const currentUri = document.uri;
        return this.documentCache.get(currentUri, referenceType, () => {
          const currentDir = dirname(currentUri.path);

          const uris = new Set<string>();
  
          uris.add(doc…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ejfasting
Comment options

@msujew
Comment options

@ejfasting
Comment options

Answer selected by ejfasting
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