mirror of
https://github.com/golang/go
synced 2024-11-22 07:54:40 -07:00
godoc: revert change 5089, per gri's instructions
R=gri CC=golang-dev https://golang.org/cl/630043
This commit is contained in:
parent
7190fdd3bf
commit
e8fb0b014c
@ -1,5 +1,4 @@
|
|||||||
QUERY
|
QUERY = {Query}
|
||||||
{Query}
|
|
||||||
|
|
||||||
{.section Accurate}
|
{.section Accurate}
|
||||||
{.or}
|
{.or}
|
||||||
@ -22,7 +21,7 @@ package {Pak.Name}
|
|||||||
{.repeated section Files}
|
{.repeated section Files}
|
||||||
{.repeated section Groups}
|
{.repeated section Groups}
|
||||||
{.repeated section Infos}
|
{.repeated section Infos}
|
||||||
{File.Path}:{@|infoLine}
|
{File.Path|url-src}:{@|infoLine}
|
||||||
{.end}
|
{.end}
|
||||||
{.end}
|
{.end}
|
||||||
{.end}
|
{.end}
|
||||||
@ -37,7 +36,7 @@ package {Pak.Name}
|
|||||||
{.repeated section Files}
|
{.repeated section Files}
|
||||||
{.repeated section Groups}
|
{.repeated section Groups}
|
||||||
{.repeated section Infos}
|
{.repeated section Infos}
|
||||||
{File.Path}:{@|infoLine}
|
{File.Path|url-src}:{@|infoLine}
|
||||||
{.end}
|
{.end}
|
||||||
{.end}
|
{.end}
|
||||||
{.end}
|
{.end}
|
||||||
|
@ -1375,6 +1375,9 @@ func indexer() {
|
|||||||
nwords, nspots := index.Size()
|
nwords, nspots := index.Size()
|
||||||
log.Stderrf("index updated (%gs, %d unique words, %d spots)", secs, nwords, nspots)
|
log.Stderrf("index updated (%gs, %d unique words, %d spots)", secs, nwords, nspots)
|
||||||
}
|
}
|
||||||
|
log.Stderrf("bytes=%d footprint=%d\n", runtime.MemStats.HeapAlloc, runtime.MemStats.InusePages<<12)
|
||||||
|
runtime.GC()
|
||||||
|
log.Stderrf("bytes=%d footprint=%d\n", runtime.MemStats.HeapAlloc, runtime.MemStats.InusePages<<12)
|
||||||
}
|
}
|
||||||
time.Sleep(1 * 60e9) // try once a minute
|
time.Sleep(1 * 60e9) // try once a minute
|
||||||
}
|
}
|
||||||
@ -1394,29 +1397,5 @@ type IndexServer struct{}
|
|||||||
|
|
||||||
func (s *IndexServer) Lookup(query *Query, result *SearchResult) os.Error {
|
func (s *IndexServer) Lookup(query *Query, result *SearchResult) os.Error {
|
||||||
*result = lookup(query.Query)
|
*result = lookup(query.Query)
|
||||||
if hit := result.Hit; hit != nil {
|
|
||||||
// the hitlists contain absolute server file paths;
|
|
||||||
// convert them into relative paths on the server
|
|
||||||
// because the client usually has a different file
|
|
||||||
// mapping
|
|
||||||
mapHitList(hit.Decls)
|
|
||||||
mapHitList(hit.Others)
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func mapHitList(list HitList) {
|
|
||||||
for _, prun := range list {
|
|
||||||
for _, frun := range prun.Files {
|
|
||||||
// convert absolute file paths to relative paths
|
|
||||||
f := frun.File
|
|
||||||
if f != nil && len(f.Path) > 0 && f.Path[0] == '/' {
|
|
||||||
f.Path = relativePath(f.Path)
|
|
||||||
}
|
|
||||||
// TODO(gri) convert SpotInfos containing snippets
|
|
||||||
// so that the line number is available
|
|
||||||
// on the client side
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user