Fix AST cache key consistency.
Ensures the AST cache always consistently loads/stores by using the normalized file path as the key.
This commit is contained in:
parent
a5c44d2076
commit
7514bf8239
@ -129,10 +129,12 @@ func (c *Cache) loadFromPackage(pkg *packages.Package) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
c.m[pos.Filename] = &File{
|
filePath := c.normalizeFilename(pos.Filename)
|
||||||
|
|
||||||
|
c.m[filePath] = &File{
|
||||||
F: f,
|
F: f,
|
||||||
Fset: pkg.Fset,
|
Fset: pkg.Fset,
|
||||||
Name: pos.Filename,
|
Name: filePath,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user