@@ -63,7 +63,10 @@ export async function loadDocument(
6363
6464 // load imports
6565 const importedURIs = await loadImports ( document , langiumDocuments ) ;
66- const importedDocuments = await Promise . all ( importedURIs . map ( ( uri ) => langiumDocuments . getOrCreateDocument ( uri ) ) ) ;
66+ const importedDocuments : LangiumDocument [ ] = [ ] ;
67+ for ( const uri of importedURIs ) {
68+ importedDocuments . push ( await langiumDocuments . getOrCreateDocument ( uri ) ) ;
69+ }
6770
6871 // build the document together with standard library, plugin modules, and imported documents
6972 await services . shared . workspace . DocumentBuilder . build ( [ stdLib , ...pluginDocs , document , ...importedDocuments ] , {
@@ -128,11 +131,7 @@ export async function loadDocument(
128131 } ;
129132}
130133
131- async function loadImports (
132- document : LangiumDocument < AstNode > ,
133- documents : LangiumDocuments ,
134- uris : Set < string > = new Set ( ) ,
135- ) {
134+ async function loadImports ( document : LangiumDocument , documents : LangiumDocuments , uris : Set < string > = new Set ( ) ) {
136135 const uriString = document . uri . toString ( ) ;
137136 if ( ! uris . has ( uriString ) ) {
138137 uris . add ( uriString ) ;
@@ -159,7 +158,7 @@ function mergeImportsDeclarations(documents: LangiumDocuments, model: Model) {
159158 // remove import directives
160159 model . imports = [ ] ;
161160
162- // fix $containerIndex
161+ // fix $container, $ containerIndex, and $containerProperty
163162 linkContentToContainer ( model ) ;
164163
165164 return importedModels ;
0 commit comments