New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/cmd/godoc: comments in [][]T are omitted in doc rendering #6917

Open
kortschak opened this Issue Dec 9, 2013 · 2 comments

Comments

Projects
None yet
5 participants
@kortschak
Contributor

kortschak commented Dec 9, 2013

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. mkdir foo && cd foo
2. curl http://play.golang.org/p/MdnYIPw4Ee.go > foo.go
3. godoc .

What is the expected output?

PACKAGE DOCUMENTATION

package foo
    import "."



VARIABLES

var NUC_4 = [][]int{
    /*       - A C G T */
    /* - */ {0, 0, 0, 0, 0},
    /* A */ {0, 5, -4, -4, -4},
    /* C */ {0, -4, 5, -4, -4},
    /* G */ {0, -4, -4, 5, -4},
    /* T */ {0, -4, -4, -4, 5},
}


What do you see instead?

PACKAGE DOCUMENTATION

package foo
    import "."



VARIABLES

var NUC_4 = [][]int{

    {0, 0, 0, 0, 0},
    {0, 5, -4, -4, -4},
    {0, -4, 5, -4, -4},
    {0, -4, -4, 5, -4},
    {0, -4, -4, -4, 5},
}


Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux

Which version are you using?  (run 'go version')
go1.2
go.tools 25a7477727f3

Please provide any additional information below.
@robpike

This comment has been minimized.

Contributor

robpike commented Dec 9, 2013

Comment 1:

This is a tool bug but godoc is included in the release. Looks like a serious bug,
relatively speaking: godoc shouldn't throw away comments. It's probably easy to fix,
though. Tagging for 1.3.

Labels changed: added repo-tools, release-go1.3.

Owner changed to @griesemer.

Status changed to Accepted.

@griesemer

This comment has been minimized.

Contributor

griesemer commented Feb 11, 2014

Comment 2:

This is non-trivial to fix: At the moment, godoc shows only comments that are collected
by go/doc; and go/doc only collects comments that are associated with a declaration
(above, or on the same line).
It should be possible to use the newer CommentMap mechanism instead (or in addition),
but that will require quite a bit of re-engineering in go/doc and godoc.
This should be fixed eventually, but before putting in the work, the long-term strategy
of go/ast, go/doc, and friends needs to be worked out first. There are higher-priority
issues for 1.3.

Labels changed: added release-none, removed release-go1.3.

Owner changed to ---.

Status changed to LongTerm.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc removed the release-none label Apr 10, 2015

@rsc rsc changed the title from go.tools/cmd/godoc: comments in [][]T are omitted in doc rendering to x/tools/cmd/godoc: comments in [][]T are omitted in doc rendering Apr 14, 2015

@rsc rsc removed the repo-tools label Apr 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment