Skip to content
Discussion options

You must be logged in to vote

Hey @theogiraudet,

Xtext used to have a concept of a FilterScope that accepts a predicate to filter another scope. I think you need something similar here. The main idea would be to override the getGlobalScope method to filter/remove all elements that are local to the element getting scoped. I.e. remove all AstNodeDescription objects from the normal global scope that have the same uri as the current ReferenceInfo. Something similar to this should work:

protected override getGlobalScope(referenceType: string, _context: ReferenceInfo): Scope {
  const globalScope = super.getGlobalScope(referenceType, _context);
  const documentUri = getDocument(_context.container).uri;
  return new FilterScope

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@theogiraudet
Comment options

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