Skip to content

Commit eed15b8

Browse files
committed
gopls: add asmFiles in cache.Package
The asmFiles field supports storing assembly files. Fixes golang/go#71754
1 parent 375a478 commit eed15b8

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

gopls/internal/cache/load.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,13 @@ func buildMetadata(updates map[PackageID]*metadata.Package, loadDir string, stan
454454
*dst = append(*dst, protocol.URIFromPath(filename))
455455
}
456456
}
457-
copyAsmURIs := func(dst *[]protocol.DocumentURI, src []string) {
458-
for _, filename := range src {
459-
if !strings.HasSuffix(filename, ".s") {
460-
continue
461-
}
462-
*dst = append(*dst, protocol.URIFromPath(filename))
457+
// Copy SFiles to AsmFiles.
458+
for _, filename := range pkg.OtherFiles {
459+
if !strings.HasSuffix(filename, ".s") {
460+
continue
463461
}
462+
mp.AsmFiles = append(mp.AsmFiles, protocol.URIFromPath(filename))
464463
}
465-
copyAsmURIs(&mp.AsmFiles, pkg.OtherFiles)
466464
copyURIs(&mp.CompiledGoFiles, pkg.CompiledGoFiles)
467465
copyURIs(&mp.GoFiles, pkg.GoFiles)
468466
copyURIs(&mp.IgnoredFiles, pkg.IgnoredFiles)

0 commit comments

Comments
 (0)