server

package
v0.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package server defines gopls' implementation of the LSP server interface, protocol.Server. Call New to create an instance.

Index

Constants

View Source
const (
	// FromDidOpen is from a didOpen notification.
	FromDidOpen = ModificationSource(iota)

	// FromDidChange is from a didChange notification.
	FromDidChange

	// FromDidChangeWatchedFiles is from didChangeWatchedFiles notification.
	FromDidChangeWatchedFiles

	// FromDidSave is from a didSave notification.
	FromDidSave

	// FromDidClose is from a didClose notification.
	FromDidClose

	// FromDidChangeConfiguration is from a didChangeConfiguration notification.
	FromDidChangeConfiguration

	// FromInitialWorkspaceLoad refers to the loading of all packages in the
	// workspace when the view is first created.
	FromInitialWorkspaceLoad

	// FromCheckUpgrades refers to state changes resulting from the CheckUpgrades
	// command, which queries module upgrades.
	FromCheckUpgrades

	// FromResetGoModDiagnostics refers to state changes resulting from the
	// ResetGoModDiagnostics command.
	FromResetGoModDiagnostics

	// FromToggleGCDetails refers to state changes resulting from toggling
	// gc_details on or off for a package.
	FromToggleGCDetails
)

Variables

This section is empty.

Functions

func ChangeTypeToFileAction

func ChangeTypeToFileAction(ct protocol.FileChangeType) file.Action

ChangeTypeToFileAction converts a protocol.FileChangeType to a file.Action. FileChangeTypes are used in watched file notifications, and file actions are used within the broader file.Modification type.

func DiagnosticWorkTitle

func DiagnosticWorkTitle(cause ModificationSource) string

DiagnosticWorkTitle returns the title of the diagnostic work resulting from a file change originating from the given cause.

func WatchedFilesCapabilityID

func WatchedFilesCapabilityID(id int) string

Types

type ModificationSource

type ModificationSource int

ModificationSource identifies the origin of a change.

func (ModificationSource) String

func (m ModificationSource) String() string

type ServerWithID

type ServerWithID interface {
	protocol.Server

	// ID returns a unique, human-readable string for this server, for
	// the purpose of log messages and debugging.
	ID() string
}

func New

func New(cache *cache.Cache, client protocol.ClientCloser, options *settings.Options) ServerWithID

New creates an LSP server and binds it to handle incoming client messages on the supplied stream.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL