Documentation
¶
Index ¶
- type Document
- type DocumentManager
- func (dm *DocumentManager) Close(uri protocol.DocumentUri)
- func (dm *DocumentManager) Count() int
- func (dm *DocumentManager) Get(uri protocol.DocumentUri) (*Document, bool)
- func (dm *DocumentManager) GetAll() []*Document
- func (dm *DocumentManager) Open(uri protocol.DocumentUri, languageID string, version int32, text string) *Document
- func (dm *DocumentManager) Set(uri protocol.DocumentUri, doc *Document)
- func (dm *DocumentManager) Update(uri protocol.DocumentUri, version int32, text string) *Document
- type Handler
- func (h *Handler) Initialize(context *glsp.Context, params *protocol.InitializeParams) (any, error)
- func (h *Handler) Initialized(context *glsp.Context, params *protocol.InitializedParams) error
- func (h *Handler) IsInitialized() bool
- func (h *Handler) SetTrace(context *glsp.Context, params *protocol.SetTraceParams) error
- func (h *Handler) Shutdown(context *glsp.Context) error
- func (h *Handler) TextDocumentCompletion(context *glsp.Context, params *protocol.CompletionParams) (any, error)
- func (h *Handler) TextDocumentDefinition(context *glsp.Context, params *protocol.DefinitionParams) (any, error)
- func (h *Handler) TextDocumentDidChange(context *glsp.Context, params *protocol.DidChangeTextDocumentParams) error
- func (h *Handler) TextDocumentDidClose(context *glsp.Context, params *protocol.DidCloseTextDocumentParams) error
- func (h *Handler) TextDocumentDidOpen(context *glsp.Context, params *protocol.DidOpenTextDocumentParams) error
- func (h *Handler) TextDocumentDidSave(context *glsp.Context, params *protocol.DidSaveTextDocumentParams) error
- func (h *Handler) TextDocumentHover(context *glsp.Context, params *protocol.HoverParams) (*protocol.Hover, error)
- type Server
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 ¶
func (dm *DocumentManager) Get(uri protocol.DocumentUri) (*Document, bool)
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 (*Handler) Initialize ¶
Initialize handles the initialize request.
func (*Handler) Initialized ¶
Initialized handles the initialized notification.
func (*Handler) IsInitialized ¶
IsInitialized returns whether the server is initialized.
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 (*Server) GetHandler ¶
GetHandler returns the server's handler.
func (*Server) RunWebSocket ¶
RunWebSocket runs the LSP server using WebSocket transport.