title: Restrict Xtext scoping to folder
body: <p>When having two Xtext models in the same project but in different folders using the same names (ID) for different objects, the scoping does not work how I want it to. How can I restrict the scoping to inside one folder and not the whole project?
  Example:</p>
  <p>grammar:</p>
  <pre><code>Model:
      persons+=Person*
      greetings+=Greeting*;
  Greeting:
      'Hello' name=[Person] '!';
  Person:
      'person' name=ID;
  </code></pre>
  <p>folder structure:</p>
  <pre><code>project
   |-folder1
     |-person1.mydsl
   |-folder2
     |-greeting.mydsl
     |-person2.mydsl
  </code></pre>
  <p>person1.mydsl contains a Person (&quot;Jane&quot;), person2.mydsl also contains a Person (&quot;Jane&quot;) and greeting.mydsl contains a Greeting (&quot;Hello Jane!&quot;) referencing the person in person1.mydsl instead of the person in person2.mydsl.</p>
  <p>The <a href="https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping" rel="nofollow noreferrer">documentation</a> tells me to use the StateBasedContainerManager but I don't understand where and how.</p>