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:
Trevor Pounds 2019-03-04 17:21:43 -05:00 committed by Isaev Denis
parent a5c44d2076
commit 7514bf8239

View File

@ -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,
} }
} }
} }