// New creates an LSP server and binds it to handle incoming client // messages on the supplied stream. func New(session *cache.Session, client protocol.ClientCloser, options *settings.Options) protocol.Server { … } type serverState … const serverCreated … const serverInitializing … const serverInitialized … const serverShutDown … func (s serverState) String() string { … } type server … func (s *server) WorkDoneProgressCancel(ctx context.Context, params *protocol.WorkDoneProgressCancelParams) error { … } type web … // getWeb returns the web server associated with this // LSP server, creating it on first request. func (s *server) getWeb() (*web, error) { … } // initWeb starts the local web server through which gopls // serves package documentation and suchlike. // // Clients should use [getWeb]. func (s *server) initWeb() (*web, error) { … } var assets … // SrcURL returns a /src URL that, when visited, causes the client // editor to open the specified file/line/column (in 1-based UTF-8 // coordinates). // // (Rendering may generate hundreds of positions across files of many // packages, so don't convert to LSP coordinates yet: wait until the // URL is opened.) func (w *web) SrcURL(filename string, line, col8 int) protocol.URI { … } // PkgURL returns a /pkg URL for the documentation of the specified package. // The optional fragment must be of the form "Println" or "Buffer.WriteString". func (w *web) PkgURL(viewID string, path golang.PackagePath, fragment string) protocol.URI { … } // freesymbolsURL returns a /freesymbols URL for a report // on the free symbols referenced within the selection span (loc). func (w *web) freesymbolsURL(viewID string, loc protocol.Location) protocol.URI { … } // assemblyURL returns the URL of an assembly listing of the specified function symbol. func (w *web) assemblyURL(viewID, packageID, symbol string) protocol.URI { … } // url returns a URL by joining a relative path, an (encoded) query, // and an (unencoded) fragment onto the authenticated base URL of the // web server. func (w *web) url(path, query, fragment string) protocol.URI { … } // withPanicHandler wraps an HTTP handler with telemetry-reporting of // panics that would otherwise be silently recovered by the net/http // root handler. func withPanicHandler(h http.Handler) http.HandlerFunc { … }