Skip to content

Commit 5e45574

Browse files
committed
fix(vscode): more robustly handle VSCode document URI
1 parent da0bbd1 commit 5e45574

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/schema/src/utils/ast-utils.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,19 @@ function resolveTransitiveImportsInternal(
181181
documents: LangiumDocuments,
182182
model: Model,
183183
initialModel = model,
184-
visited: Set<URI> = new Set(),
184+
visited: Set<string> = new Set(),
185185
models: Set<Model> = new Set()
186186
): Model[] {
187187
const doc = getDocument(model);
188-
if (initialModel !== model) {
188+
const initialDoc = getDocument(initialModel);
189+
190+
if (initialDoc.uri.fsPath.toLowerCase() !== doc.uri.fsPath.toLowerCase()) {
189191
models.add(model);
190192
}
191-
if (!visited.has(doc.uri)) {
192-
visited.add(doc.uri);
193+
194+
const normalizedPath = doc.uri.fsPath.toLowerCase();
195+
if (!visited.has(normalizedPath)) {
196+
visited.add(normalizedPath);
193197
for (const imp of model.imports) {
194198
const importedModel = resolveImport(documents, imp);
195199
if (importedModel) {

0 commit comments

Comments
 (0)