Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v1.233.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	URI        protocol.DocumentUri
	LanguageID string
	Version    int32
	Text       string
}

Document represents an open document in the LSP server.

type DocumentManager

type DocumentManager struct {
	// contains filtered or unexported fields
}

DocumentManager manages open documents.

func NewDocumentManager

func NewDocumentManager() *DocumentManager

NewDocumentManager creates a new document manager.

func (*DocumentManager) Close

func (dm *DocumentManager) Close(uri protocol.DocumentUri)

Close removes a document from the manager.

func (*DocumentManager) Count

func (dm *DocumentManager) Count() int

Count returns the number of open documents.

func (*DocumentManager) Get

Get retrieves a document by URI.

func (*DocumentManager) GetAll

func (dm *DocumentManager) GetAll() []*Document

GetAll returns all open documents.

func (*DocumentManager) Open

func (dm *DocumentManager) Open(uri protocol.DocumentUri, languageID string, version int32, text string) *Document

Open adds a new document to the manager.

func (*DocumentManager) Set

func (dm *DocumentManager) Set(uri protocol.DocumentUri, doc *Document)

Set sets a document directly (used for testing).

func (*DocumentManager) Update

func (dm *DocumentManager) Update(uri protocol.DocumentUri, version int32, text string) *Document

Update updates an existing document's content.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler implements LSP protocol handlers.

func NewHandler

func NewHandler(server *Server) *Handler

NewHandler creates a new LSP handler.

func (*Handler) Initialize

func (h *Handler) Initialize(context *glsp.Context, params *protocol.InitializeParams) (any, error)

Initialize handles the initialize request.

func (*Handler) Initialized

func (h *Handler) Initialized(context *glsp.Context, params *protocol.InitializedParams) error

Initialized handles the initialized notification.

func (*Handler) IsInitialized

func (h *Handler) IsInitialized() bool

IsInitialized returns whether the server is initialized.

func (*Handler) SetTrace

func (h *Handler) SetTrace(context *glsp.Context, params *protocol.SetTraceParams) error

SetTrace handles the setTrace notification.

func (*Handler) Shutdown

func (h *Handler) Shutdown(context *glsp.Context) error

Shutdown handles the shutdown request.

func (*Handler) TextDocumentCompletion

func (h *Handler) TextDocumentCompletion(context *glsp.Context, params *protocol.CompletionParams) (any, error)

TextDocumentCompletion handles the textDocument/completion request.

func (*Handler) TextDocumentDefinition

func (h *Handler) TextDocumentDefinition(context *glsp.Context, params *protocol.DefinitionParams) (any, error)

TextDocumentDefinition handles the textDocument/definition request.

func (*Handler) TextDocumentDidChange

func (h *Handler) TextDocumentDidChange(context *glsp.Context, params *protocol.DidChangeTextDocumentParams) error

TextDocumentDidChange handles the textDocument/didChange notification.

func (*Handler) TextDocumentDidClose

func (h *Handler) TextDocumentDidClose(context *glsp.Context, params *protocol.DidCloseTextDocumentParams) error

TextDocumentDidClose handles the textDocument/didClose notification.

func (*Handler) TextDocumentDidOpen

func (h *Handler) TextDocumentDidOpen(context *glsp.Context, params *protocol.DidOpenTextDocumentParams) error

TextDocumentDidOpen handles the textDocument/didOpen notification.

func (*Handler) TextDocumentDidSave

func (h *Handler) TextDocumentDidSave(context *glsp.Context, params *protocol.DidSaveTextDocumentParams) error

TextDocumentDidSave handles the textDocument/didSave notification.

func (*Handler) TextDocumentHover

func (h *Handler) TextDocumentHover(context *glsp.Context, params *protocol.HoverParams) (*protocol.Hover, error)

TextDocumentHover handles the textDocument/hover request.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents the Atmos LSP server.

func NewServer

func NewServer(ctx context.Context, atmosConfig *schema.AtmosConfiguration) (*Server, error)

NewServer creates a new Atmos LSP server.

func (*Server) GetHandler

func (s *Server) GetHandler() *Handler

GetHandler returns the server's handler.

func (*Server) RunStdio

func (s *Server) RunStdio() error

RunStdio runs the LSP server using stdio transport.

func (*Server) RunTCP

func (s *Server) RunTCP(address string) error

RunTCP runs the LSP server using TCP transport.

func (*Server) RunWebSocket

func (s *Server) RunWebSocket(address string) error

RunWebSocket runs the LSP server using WebSocket transport.

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown gracefully shuts down the server.

Jump to

Keyboard shortcuts

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