Select named imports before source admission

This commit is contained in:
2026-10-19 20:07:54 +00:00
parent b750b0fec6
commit 5f33e1e90c
3 changed files with 390 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ type importDeclarationSpec struct {
location Location
selector importSelector
paths []string
pathSites []importFieldSite
glob string
globSegments []string
required *bool
@@ -285,6 +286,8 @@ func parseImportDeclarationSpec(node *document.Node, declarationPath Path) (impo
badPath, badNode := listMemberSite(selectorEntry.Value, selectorPath, origins[index])
return importDeclarationSpec{}, []Diagnostic{nodeImportDiagnostic(CodeImportInvalid, badPath, selectorEntry.Key+" contains an invalid source path", badNode)}
}
badPath, badNode := listMemberSite(selectorEntry.Value, selectorPath, origins[index])
spec.pathSites = append(spec.pathSites, importFieldSite{path: badPath.clone(), location: publicLocation(badNode.Location)})
}
spec.paths = values
case importSelectorGlob: