1
0
mirror of https://github.com/golang/go synced 2024-10-01 05:38:32 -06:00
Commit Graph

80 Commits

Author SHA1 Message Date
Shenghou Ma
35875c1a92 go.tools/cmd/godoc/static: fix text template for variable examples.
Fixes golang/go#7771.

LGTM=bgarcia
R=golang-codereviews, bradfitz, bgarcia
CC=golang-codereviews
https://golang.org/cl/87180044
2014-04-22 18:46:26 -04:00
Alan Donovan
f1247de572 go.tools/cmd/doc: make filename logic separator-agnostic
(Speculative fix for broken cmd/godoc test on Windows.)

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/90090043
2014-04-21 18:34:22 -04:00
Alan Donovan
4843aaee02 godoc: add very basic integration test of godoc -analysis=type.
Also: fix careless regression introduced yesterday.

LGTM=bgarcia
R=bgarcia
CC=golang-codereviews
https://golang.org/cl/88880043
2014-04-17 15:51:27 -04:00
Alan Donovan
503140c72e godoc: documentation of -analysis features.
The text and images are "baked in" to the godoc executable's
rodata section (~300KB) and are accessible from the godoc
server itself at /lib/godoc/analysis/help.html.

In due course, the page will become visible at
http://golang.org/lib/godoc/analysis/help.html, which will be
the canonical location for this doc (in announcements, etc).

The page is temporarily visible here, for those on the Google corp network:
http://172.26.104.127:7777/lib/godoc/analysis/help.html

Also:
- add link to new doc from source view pages.
- document -analysis flag in cmd/godoc/doc.go
- fix indentation of -analysis flag's help string

LGTM=gri
R=gri, bgarcia, r
CC=golang-codereviews
https://golang.org/cl/87110045
2014-04-16 16:35:08 -04:00
Alan Donovan
83a7488b3d go.tools/godoc: remove nil deference panic on loading error
Also:
- remove stale comment about line numbers.
- log a warning if file's package root not found.

LGTM=bgarcia
R=bgarcia
CC=golang-codereviews
https://golang.org/cl/88510044
2014-04-16 15:01:23 -04:00
Alan Donovan
7f24a8300e go.tools/godoc: restore line anchors to the source view.
These were removed when adding the -analysis flag (CL
60540044), ostensibly for performance, but I can't reproduce
the serious slowdowns I saw then.  In any case, they are
needed for certain URLs.

Fixes golang/go#7743

LGTM=bgarcia
R=bgarcia
CC=golang-codereviews
https://golang.org/cl/86150043
2014-04-09 15:41:18 -04:00
Robert Griesemer
42a4cd3392 go.tools/godoc: sanitize function signatures for object index
Fixes golang/go#7703.

LGTM=bgarcia
R=bgarcia
CC=golang-codereviews
https://golang.org/cl/84410045
2014-04-07 12:54:28 -07:00
Robert Griesemer
55ea531257 go.tools/godoc: ignore //line comments in source code
Per suggestion from Gary Burd.

Fixes golang/go#5247.

LGTM=rsc
R=bgarcia, rsc
CC=golang-codereviews
https://golang.org/cl/84050044
2014-04-03 13:12:54 -07:00
Alan Donovan
f35b5691f3 go.tools/godoc: fix two regressions caused by -analysis CL.
- Add missing methodset.html template file.
- Suppress initial display of package callgraph.
  Client-side JS will make it visible if there is data.

LGTM=bgarcia
R=crawshaw, bgarcia
CC=golang-codereviews
https://golang.org/cl/81550043
2014-03-27 15:30:14 -04:00
Alan Donovan
7877131709 cmd/godoc: fix careless crash introduced by recent analysis CL
+ basic integration test

LGTM=bgarcia
R=bgarcia, bradfitz
CC=golang-codereviews
https://golang.org/cl/76410045
2014-03-16 16:17:13 -04:00
Alan Donovan
80c4f06c0f go.tools/godoc: server mode: add support for type and pointer analysis.
See analysis.go for overview of new features.
See README for known bugs and issues.

Much UI polish, testing and optimization work remains, but
this is a starting point.

Flag: we add a new flag -analysis=type,pointer, default "",
for adventurous users only at this stage.
Type analysis takes ~10s for stdlib + go.tools;
Pointer analysis (currently) takes several minutes.

Dependencies: we now include jquery.treeview.js and its GIF
images among the resources.  (bake.go now handles binary.)

LGTM=crawshaw, bgarcia
R=crawshaw, bgarcia
CC=bradfitz, golang-codereviews
https://golang.org/cl/60540044
2014-03-14 18:58:22 -04:00
Brad Garcia
a81074af88 godoc: Output "No match found" only if there is no ast or docs included in info.
Fixes golang/go#7499.

R=minux.ma
CC=golang-codereviews
https://golang.org/cl/75400043
2014-03-14 10:00:10 -04:00
Andrew Gerrand
1a2b7a26cc godoc/static: update site policies link
Fixes golang/go#7520.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/74900047
2014-03-13 10:50:06 +11:00
Brad Garcia
aaca3a4f95 godoc: Remove bogus messages referring to "/target".
Fix package text display spacing.
Fixes golang/go#7395.

R=bradfitz, sameer
CC=golang-codereviews
https://golang.org/cl/68210043
2014-02-26 13:21:44 -05:00
Brad Garcia
61bd98e5b3 godoc: Fix m=src URLs.
For source code links, prepend /src/pkg if not already prefixed.
Fixes golang/go#7383.

R=bradfitz, sameer
CC=golang-codereviews
https://golang.org/cl/67110043
2014-02-21 19:51:51 -05:00
Brad Garcia
0cf8ab65b2 godoc: identifiers can contain underscores, not spaces.
Fixes golang/go#7382.

R=bradfitz, sameer
CC=golang-codereviews
https://golang.org/cl/67090043
2014-02-21 19:51:15 -05:00
Brad Garcia
804b9654fe godoc: Fix dereference of nil *SearchResult.
Fixes golang/go#7364.

R=bradfitz
CC=golang-codereviews, sameer
https://golang.org/cl/66470044
2014-02-20 11:26:05 -05:00
Andrew Gerrand
1a5e5b083b go.tools/godoc/redirect: remove race detector blog post redirect
Update golang/go#7275

LGTM=minux.ma, dvyukov
R=dvyukov, minux.ma
CC=golang-codereviews
https://golang.org/cl/60900044
2014-02-11 09:26:17 +11:00
Robert Griesemer
5351a1ccd2 go.tools/godoc: don't associate builtin nil with a type
Special case for (fake) package builtin: don't associate
any constant, variable, or factory function with a type.

Fixes golang/go#6645.

LGTM=bgarcia
R=bgarcia, r, bradfitz
CC=golang-codereviews
https://golang.org/cl/54820044
2014-02-04 10:26:38 -08:00
Brad Garcia
d682175c6e godoc: test fixes for recent cmdline changes.
Tests broken by:
https://code.google.com/p/go/source/detail?r=1666da2583f4&repo=tools

R=gri, adonovan
CC=golang-codereviews
https://golang.org/cl/58780043
2014-01-30 15:32:23 -05:00
Brad Garcia
2ca2bfc172 godoc: Fix commandline mode output.
Fix output of packages with multiple files.
Remove extra output when filter is requested.
Fixes golang/go#7115.

R=bradfitz, adg
CC=golang-codereviews
https://golang.org/cl/52750044
2014-01-30 06:28:19 -05:00
Brad Garcia
efd232e270 godoc: set expvar for http.ResponseWriter errors.
R=bradfitz
CC=adg, golang-codereviews
https://golang.org/cl/56680044
2014-01-29 10:53:45 -05:00
Brad Garcia
7ecad5bf71 godoc: periodically refresh package directory and search index.
R=adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/55080043
2014-01-28 09:30:23 -05:00
Brad Garcia
26542a8bc5 godoc: Update identifier indexing tests.
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/48170043
2014-01-06 14:53:03 -05:00
Brad Garcia
27d851fc2c godoc: Add package identifiers to documentation indexing.
This allows us to show package synopsis in search results.
Fix skipping of test files (prefix changed from "test/" to "/test/").

R=bradfitz, bradfitz
CC=golang-codereviews
https://golang.org/cl/44790044
2014-01-06 13:26:25 -05:00
Brad Garcia
a28efa5d8c godoc: add ability to change or disable the display of search results.
The display of search results can now be changed. A slice of functions for displaying the results can now be provided.  By default, three functions are provided to display documentation, source code, and textual results.
This makes it possible to replace them with equivalents that, say,
obtain search results from alternative source code search engines.

R=bradfitz, adg
CC=golang-codereviews
https://golang.org/cl/43470043
2014-01-06 09:51:01 -05:00
Andrew Gerrand
1de4f6df60 go.tools/godoc/static: add 'fmtImportEl' option to playground
The 'fmtImportEl' option lets the called specify a checkbox element
that determines whether to send the 'imports=true' key/value pair when
calling '/fmt'.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/43240043
2013-12-18 09:32:51 +11:00
Brad Fitzpatrick
59db975409 godoc: limit concurrency to local disk filesystem
Not for Go 1.2.  Still needs a flag.

Linux at least (and likely other OSes) don't like you doing
a few hundred readdirs at once and spawing as many threads.

R=golang-dev, adg, jeremyjackins
CC=golang-dev
https://golang.org/cl/30620043
2013-12-16 11:25:50 -08:00
Brad Garcia
ff7cfafc58 godoc: Add URLForSrcQuery option to godoc.Presentation.
This allows the creation of URLs to lines of source code with a query
term highlighted without assuming godoc source code URL parameters.
Needed for interfacing with other source code viewing servers.

R=bradfitz
CC=golang-dev
https://golang.org/cl/34200043
2013-12-04 10:37:01 -05:00
Brad Garcia
f2a9326f67 godoc: fix cmdline_test under Windows. Make sure the absolute path
testcase starts with a volume name for windows platforms.

R=bradfitz
CC=alex.brainman, golang-dev
https://golang.org/cl/32800043
2013-11-26 13:28:43 -05:00
Brad Garcia
8880e2e9d7 godoc: Add tests for corpus indexing options.
R=bradfitz
CC=golang-dev
https://golang.org/cl/31370043
2013-11-25 14:23:36 -05:00
Brad Garcia
60954257d5 godoc: Update cmdline_test to no longer rely on having GOROOT set
to a valid Go environment.

R=bradfitz
CC=golang-dev
https://golang.org/cl/30960043
2013-11-22 13:58:59 -05:00
Brad Garcia
f3faf8b6e0 godoc: add search results that point to documentation instead of source.
Add explicit options to Corpus to control search indexing of documentation, Go source code, and full-text.

R=bradfitz, r
CC=golang-dev
https://golang.org/cl/24190043
2013-11-21 11:55:42 -05:00
Brad Garcia
b844907f9f godoc: refactor command-line mode handling.
R=bradfitz
CC=golang-dev
https://golang.org/cl/29230044
2013-11-20 09:56:10 -05:00
Marko Mikulicic
ae3dd78063 godoc: Index const and vars in godoc.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/26990043
2013-11-15 11:03:25 -08:00
Brad Fitzpatrick
88f792caef godoc: be quiet by default about bad examples
Fixes golang/go#6759

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/26420044
2013-11-14 09:01:08 -08:00
Brad Fitzpatrick
515bcdc536 godoc: update Index.{Write,Reader}, add tests
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/24490043
2013-11-12 14:58:47 -08:00
Brad Fitzpatrick
56a1b4d0b7 godoc: index import counts, package name to path(s), and exported symbols
R=golang-dev, crawshaw
CC=golang-dev
https://golang.org/cl/22190047
2013-11-06 15:00:26 -05:00
Brad Fitzpatrick
42513df8b8 godoc: add IndexInterval option
This will permit deleting some forked code elsewhere.

R=golang-dev, crawshaw
CC=golang-dev
https://golang.org/cl/22010046
2013-11-06 13:31:30 -05:00
Brad Fitzpatrick
964f0f559c godoc: feed indexer concurrently, add selective indexing hook, tests
On big corpuses, the indexer was spending most of its time waiting
for filesystem operations (especially with network filesystems)
and not actually indexing.  This keeps the filesystem busy and indexer
running in different goroutines.

Also, add a hook to let godoc hosts disable indexing of certain
directories.

And finally, start adding tests for godoc, which required
fleshing out (and testing) the mapfs code.

R=golang-dev, adg, bgarcia
CC=golang-dev
https://golang.org/cl/21520045
2013-11-05 09:35:58 -05:00
Brad Garcia
d9d5e51406 godoc: add ability to override generation of links to source code.
R=bradfitz
CC=golang-dev
https://golang.org/cl/19850046
2013-11-01 13:20:32 -04:00
Brad Fitzpatrick
766a70612a godoc: add a Corpus hook to summarize a package
This lets godoc implementations provide a more efficient means
of getting this information, without reading files and parsing the
package docs.

This is especially important when the files themselves don't
actually exist and the VFS is synthesizing them on demand
(e.g. protocol buffer files -> their generated *.pb.go files).
This means corpus.Init can run quickly, without generating
every protocol file in a large corpus (or fetching it from a
cache).

In the future, this hook could also be used for caching the summaries of
regular packages.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/19440043
2013-10-30 11:34:32 -07:00
Andrew Gerrand
99890b82e7 go.tools/godoc/static: use preferred JS for Google+ buttons
R=bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/19070044
2013-10-30 13:13:42 +11:00
Brad Fitzpatrick
452c763fc7 godoc: parallelize corpus init
Massive win for high-latency network filesystems.
Also benefits the local disk/ssd case too, though.

R=golang-dev, bgarcia
CC=golang-dev
https://golang.org/cl/18650043
2013-10-28 12:51:01 -07:00
Shenghou Ma
1e6b0db4b9 go.tools/godoc/static: fix & escape in codewalks
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/14426053
2013-10-13 22:22:48 -04:00
Andrew Gerrand
c8494e30f9 go.tools/godoc/redirect: remove redundant redirect rules
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14365043
2013-10-04 09:49:25 +10:00
Andrew Gerrand
0ccb6234c3 undo CL 14368043 / 7750fc1a6bd2
Not the right approach.

««« original CL description
go.tools/godoc: reverse reversed redirects

Make godoc work again for go spec and memory model doc.

TBR=rsc
CC=golang-dev
https://golang.org/cl/14368043
»»»

R=gri
CC=golang-dev
https://golang.org/cl/14370043
2013-10-04 09:48:07 +10:00
Robert Griesemer
40ede1040a go.tools/godoc: reverse reversed redirects
Make godoc work again for go spec and memory model doc.

TBR=rsc
CC=golang-dev
https://golang.org/cl/14368043
2013-10-03 16:36:34 -07:00
Russ Cox
5785dc19d7 godoc: redirect bogus /doc/spec links to /ref/spec
It was not enough to make /ref/spec work (which it now does),
because some of the docs on golang.org (in particular golang.org/doc)
are pulled from tip, and tip links to /doc/spec now.
Make those "too new" links work by redirecting /doc/spec
back to /ref/spec for now.

TBR=adg
CC=golang-dev
https://golang.org/cl/14348043
2013-10-03 13:41:38 -04:00
Russ Cox
c11b695c55 go.tools/godoc: remove Go 1.2 redirects
They are breaking golang.org
(try loading golang.org/ref/spec).

TBR=adg
CC=golang-dev
https://golang.org/cl/14165044
2013-10-03 13:16:17 -04:00