Preserve native import alias identity
This commit is contained in:
@@ -79,6 +79,11 @@ func selectGlobImportCandidates(access *filesystemAccess, basePath string, spec
|
||||
continue
|
||||
}
|
||||
physicalPath := target.identity
|
||||
// Native source identity and relative imports use the namespace
|
||||
// spelling; resolved link identities belong only to discovery.
|
||||
if access.native != nil {
|
||||
physicalPath = accessPath
|
||||
}
|
||||
if physicalPath == "" {
|
||||
physicalPath, err = access.canonical(accessPath)
|
||||
if err != nil {
|
||||
|
||||
@@ -115,7 +115,9 @@ func selectDirectoryImportCandidates(access *filesystemAccess, basePath string,
|
||||
if targetErr != nil {
|
||||
return importSelection{}, []Diagnostic{*importDirectoryTargetDiagnostic(root.site, targetErr)}
|
||||
}
|
||||
root.accessPath = rootTarget.identity
|
||||
if access.native == nil {
|
||||
root.accessPath = rootTarget.identity
|
||||
}
|
||||
entries, missing, diagnostic := importDirectoryEntries(access, root.accessPath, root.site, limits, accounting)
|
||||
if diagnostic != nil {
|
||||
return importSelection{}, []Diagnostic{*diagnostic}
|
||||
@@ -175,13 +177,15 @@ func selectDirectoryImportCandidates(access *filesystemAccess, basePath string,
|
||||
return importSelection{}, []Diagnostic{*childDiagnostic}
|
||||
}
|
||||
if !vanished {
|
||||
candidate.accessPath = target.identity
|
||||
if access.native == nil {
|
||||
candidate.accessPath = target.identity
|
||||
}
|
||||
activeDirectories[target.identity] = struct{}{}
|
||||
stack = append(stack, importDirectoryFrame{directory: candidate, depth: frame.depth + 1, entries: childEntries, identity: target.identity})
|
||||
}
|
||||
continue
|
||||
}
|
||||
if target.identity != "" {
|
||||
if target.identity != "" && access.native == nil {
|
||||
candidate.accessPath = target.identity
|
||||
} else {
|
||||
canonical, canonicalErr := access.canonical(accessPath)
|
||||
|
||||
Reference in New Issue
Block a user