go-lang-plugin-org / go-lang-idea-plugin

Google Go language IDE built using the IntelliJ Platform
https://plugins.jetbrains.com/plugin/5047
Other
4.56k stars 570 forks source link

Support struct fields documentation #1987

Open zolotov opened 9 years ago

zolotov commented 9 years ago

Definition:

// TemplateNode represents a {{template}} action.
type TemplateNode struct {
    NodeType
    Pos
    tr   *Tree
    Line int       // The line number in the input. Deprecated: Kept for compatibility.
    Name string    // The name of the template (unquoted).
    Pipe *PipeNode // The command to evaluate as dot for the template.
}

Usage:

func (t *TemplateNode) String() string {
    if t.P<caret>ipe == nil {
        return fmt.Sprintf("{{template %q}}", t.Name)
    }
    return fmt.Sprintf("{{template %q %s}}", t.Name, t.Pipe)
}

Should show The command to evaluate as dot for the template.

zolotov commented 8 years ago

One more example:

type Logger struct {
    // The logs are `io.Copy`'d to this in a mutex. It's common to set this to a
    // file, or leave it default which is `os.Stderr`. You can also set this to
    // something more adventorous, such as logging to Kafka.
    Out io.Writer
    // Hooks for the logger instance. These allow firing events based on logging
    // levels and log entries. For example, to send errors to an error tracking
    // service, log to StatsD or dump the core on fatal errors.
    Hooks LevelHooks
    // All log entries pass through the formatter before logged to Out. The
    // included formatters are `TextFormatter` and `JSONFormatter` for which
    // TextFormatter is the default. In development (when a TTY is attached) it
    // logs with colors, but to a file it wouldn't. You can easily implement your
    // own that implements the `Formatter` interface, see the `README` or included
    // formatters for examples.
    Formatter Formatter
    // The logging level the logger should log at. This is typically (and defaults
    // to) `logrus.Info`, which allows Info(), Warn(), Error() and Fatal() to be
    // logged. `logrus.Debug` is useful in
    Level Level
    // contains filtered or unexported fields
}