Versions in this module Expand all Collapse all v0 v0.0.2 Apr 25, 2026 v0.0.1 Apr 11, 2026 Changes in this version + var ErrClientError = errors.New("api: client error") + var ErrConnClosed = errors.New("api: connection closed") + var ErrInvalidRequest = errors.New("api: invalid request") + var ErrRequestTimeout = errors.New("api: request timeout") + func GeneratePipePath(name string) string + func UnmarshalParams[T any](params json.Value) (*T, error) + type APIFileChangeSummary struct + Changed []DocumentIdentifier + Created []DocumentIdentifier + Deleted []DocumentIdentifier + type APIFileChanges struct + Changed []DocumentIdentifier + Created []DocumentIdentifier + Deleted []DocumentIdentifier + InvalidateAll bool + type AsyncConn struct + func NewAsyncConn(rwc io.ReadWriteCloser, handler Handler) *AsyncConn + func NewAsyncConnWithProtocol(rwc io.ReadWriteCloser, protocol Protocol, handler Handler) *AsyncConn + func (c *AsyncConn) Call(ctx context.Context, method string, params any) (json.Value, error) + func (c *AsyncConn) Notify(ctx context.Context, method string, params any) error + func (c *AsyncConn) Run(ctx context.Context) error + type CheckerSignatureParams struct + Project Handle[project.Project] + Signature Handle[checker.Signature] + Snapshot Handle[project.Snapshot] + type CheckerTypeParams struct + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + Type Handle[checker.Type] + type ConfigFileResponse struct + FileNames []string + Options *core.CompilerOptions + type Conn interface + Call func(ctx context.Context, method string, params any) (json.Value, error) + Notify func(ctx context.Context, method string, params any) error + Run func(ctx context.Context) error + type DiagnosticResponse struct + Category diagnostics.Category + Code int32 + End int + FileName string + MessageChain []*DiagnosticResponse + Pos int + RelatedInformation []*DiagnosticResponse + ReportsDeprecated bool + ReportsUnnecessary bool + Text string + func NewDiagnosticResponse(d *ast.Diagnostic) *DiagnosticResponse + func NewDiagnosticResponses(diags []*ast.Diagnostic) []*DiagnosticResponse + type DocumentIdentifier struct + FileName string + URI lsproto.DocumentUri + func (d *DocumentIdentifier) UnmarshalJSONFrom(dec *json.Decoder) error + func (d DocumentIdentifier) String() string + func (d DocumentIdentifier) ToAbsoluteFileName(cwd string) string + func (d DocumentIdentifier) ToFileName() string + func (d DocumentIdentifier) ToURI() lsproto.DocumentUri + type GetBaseTypeOfLiteralTypeParams struct + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + Type Handle[checker.Type] + type GetContextualTypeParams struct + Location Handle[ast.Node] + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetDefaultProjectForFileParams struct + File DocumentIdentifier + Snapshot Handle[project.Snapshot] + type GetDiagnosticsParams struct + File *DocumentIdentifier + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetExportSymbolOfSymbolParams struct + Snapshot Handle[project.Snapshot] + Symbol Handle[ast.Symbol] + type GetExportsOfSymbolParams struct + Snapshot Handle[project.Snapshot] + Symbol Handle[ast.Symbol] + type GetIntrinsicTypeParams struct + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetMembersOfSymbolParams struct + Snapshot Handle[project.Snapshot] + Symbol Handle[ast.Symbol] + type GetParentOfSymbolParams struct + Snapshot Handle[project.Snapshot] + Symbol Handle[ast.Symbol] + type GetProjectDiagnosticsParams struct + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetSignaturesOfTypeParams struct + Kind int32 + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + Type Handle[checker.Type] + type GetSourceFileParams struct + File DocumentIdentifier + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetSymbolAtLocationParams struct + Location Handle[ast.Node] + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetSymbolAtPositionParams struct + File DocumentIdentifier + Position uint32 + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetSymbolOfTypeParams struct + Snapshot Handle[project.Snapshot] + Type Handle[checker.Type] + type GetSymbolsAtLocationsParams struct + Locations []Handle[ast.Node] + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetSymbolsAtPositionsParams struct + File DocumentIdentifier + Positions []uint32 + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetTypeAtLocationParams struct + Location Handle[ast.Node] + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetTypeAtLocationsParams struct + Locations []Handle[ast.Node] + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetTypeAtPositionParams struct + File DocumentIdentifier + Position uint32 + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetTypeOfSymbolAtLocationParams struct + Location Handle[ast.Node] + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + Symbol Handle[ast.Symbol] + type GetTypeOfSymbolParams struct + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + Symbol Handle[ast.Symbol] + type GetTypePropertyParams struct + Snapshot Handle[project.Snapshot] + Type Handle[checker.Type] + type GetTypesAtPositionsParams struct + File DocumentIdentifier + Positions []uint32 + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type GetTypesOfSymbolsParams struct + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + Symbols []Handle[ast.Symbol] + type Handle string + func NodeHandleFrom(node *ast.Node) Handle[ast.Node] + func ProjectHandle(p *project.Project) Handle[project.Project] + func SignatureHandle(id uint64) Handle[checker.Signature] + func SymbolHandle(symbol *ast.Symbol) Handle[ast.Symbol] + func TypeHandle(t *checker.Type) Handle[checker.Type] + type Handler interface + HandleNotification func(ctx context.Context, method string, params json.Value) error + HandleRequest func(ctx context.Context, method string, params json.Value) (any, error) + type IndexInfoResponse struct + IsReadonly bool + KeyType TypeResponse + ValueType TypeResponse + type InitializeResponse struct + CurrentDirectory string + UseCaseSensitiveFileNames bool + type JSONRPCProtocol struct + func NewJSONRPCProtocol(rw io.ReadWriter) *JSONRPCProtocol + func (p *JSONRPCProtocol) ReadMessage() (*Message, error) + func (p *JSONRPCProtocol) WriteError(id *jsonrpc.ID, respErr *jsonrpc.ResponseError) error + func (p *JSONRPCProtocol) WriteNotification(method string, params any) error + func (p *JSONRPCProtocol) WriteRequest(id *jsonrpc.ID, method string, params any) error + func (p *JSONRPCProtocol) WriteResponse(id *jsonrpc.ID, result any) error + type Message = jsonrpc.Message + type MessagePackProtocol struct + func NewMessagePackProtocol(rw io.ReadWriter) *MessagePackProtocol + func (p *MessagePackProtocol) ReadMessage() (*Message, error) + func (p *MessagePackProtocol) WriteError(id *jsonrpc.ID, respErr *jsonrpc.ResponseError) error + func (p *MessagePackProtocol) WriteNotification(method string, params any) error + func (p *MessagePackProtocol) WriteRequest(id *jsonrpc.ID, method string, params any) error + func (p *MessagePackProtocol) WriteResponse(id *jsonrpc.ID, result any) error + type MessageType uint8 + const MessageTypeCall + const MessageTypeCallError + const MessageTypeCallResponse + const MessageTypeError + const MessageTypeRequest + const MessageTypeResponse + const MessageTypeUnknown + func (i MessageType) String() string + func (m MessageType) IsValid() bool + type Method string + const MethodGetAnyType + const MethodGetBaseTypeOfLiteralType + const MethodGetBaseTypeOfType + const MethodGetBaseTypes + const MethodGetBigIntType + const MethodGetBooleanType + const MethodGetCheckTypeOfType + const MethodGetConfigFileParsingDiagnostics + const MethodGetConstraintOfType + const MethodGetConstraintOfTypeParameter + const MethodGetContextualType + const MethodGetDeclarationDiagnostics + const MethodGetDeclaredTypeOfSymbol + const MethodGetDefaultProjectForFile + const MethodGetESSymbolType + const MethodGetExportSymbolOfSymbol + const MethodGetExportsOfSymbol + const MethodGetExtendsTypeOfType + const MethodGetIndexInfosOfType + const MethodGetIndexTypeOfType + const MethodGetLocalTypeParametersOfType + const MethodGetMembersOfSymbol + const MethodGetNeverType + const MethodGetNullType + const MethodGetNumberType + const MethodGetObjectTypeOfType + const MethodGetOuterTypeParametersOfType + const MethodGetParentOfSymbol + const MethodGetPropertiesOfType + const MethodGetRestTypeOfSignature + const MethodGetReturnTypeOfSignature + const MethodGetSemanticDiagnostics + const MethodGetShorthandAssignmentValueSymbol + const MethodGetSignaturesOfType + const MethodGetSourceFile + const MethodGetStringType + const MethodGetSuggestionDiagnostics + const MethodGetSymbolAtLocation + const MethodGetSymbolAtPosition + const MethodGetSymbolOfType + const MethodGetSymbolsAtLocations + const MethodGetSymbolsAtPositions + const MethodGetSyntacticDiagnostics + const MethodGetTargetOfType + const MethodGetTypeArguments + const MethodGetTypeAtLocation + const MethodGetTypeAtLocations + const MethodGetTypeAtPosition + const MethodGetTypeOfSymbol + const MethodGetTypeOfSymbolAtLocation + const MethodGetTypeParametersOfType + const MethodGetTypePredicateOfSignature + const MethodGetTypesAtPositions + const MethodGetTypesOfSymbols + const MethodGetTypesOfType + const MethodGetUndefinedType + const MethodGetUnknownType + const MethodGetVoidType + const MethodInitialize + const MethodIsContextSensitive + const MethodParseConfigFile + const MethodPrintNode + const MethodRelease + const MethodResolveName + const MethodTypeToString + const MethodTypeToTypeNode + const MethodUpdateSnapshot + type ParseConfigFileParams struct + File DocumentIdentifier + type PipeTransport struct + func NewPipeTransport(path string) (*PipeTransport, error) + func (t *PipeTransport) Accept() (io.ReadWriteCloser, error) + func (t *PipeTransport) Close() error + func (t *PipeTransport) Path() string + type PrintNodeParams struct + Data string + NeverAsciiEscape bool + PreserveSourceNewlines bool + TerminateUnterminatedLiterals bool + type ProjectFileChanges struct + ChangedFiles []tspath.Path + DeletedFiles []tspath.Path + type ProjectResponse struct + CompilerOptions *core.CompilerOptions + ConfigFileName string + Id Handle[project.Project] + RootFiles []string + func NewProjectResponse(p *project.Project) *ProjectResponse + type Protocol interface + ReadMessage func() (*Message, error) + WriteError func(id *jsonrpc.ID, err *jsonrpc.ResponseError) error + WriteNotification func(method string, params any) error + WriteRequest func(id *jsonrpc.ID, method string, params any) error + WriteResponse func(id *jsonrpc.ID, result any) error + type RawBinary []byte + type ReleaseParams struct + Handle string + type ResolveNameParams struct + ExcludeGlobals bool + File *DocumentIdentifier + Location Handle[ast.Node] + Meaning uint32 + Name string + Position *uint32 + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + type Session struct + func NewSession(projectSession *project.Session, options *SessionOptions) *Session + func (s *Session) Close() + func (s *Session) HandleNotification(ctx context.Context, method string, params json.Value) error + func (s *Session) HandleRequest(ctx context.Context, method string, params json.Value) (any, error) + func (s *Session) ID() string + func (s *Session) ProjectSession() *project.Session + type SessionOptions struct + UseBinaryResponses bool + type SignatureResponse struct + Declaration Handle[ast.Node] + Flags uint32 + Id Handle[checker.Signature] + Parameters []Handle[ast.Symbol] + Target Handle[checker.Signature] + ThisParameter Handle[ast.Symbol] + TypeParameters []Handle[checker.Type] + type SnapshotChanges struct + ChangedProjects map[Handle[project.Project]]*ProjectFileChanges + RemovedProjects []Handle[project.Project] + type SourceFileResponse struct + Data string + type StdioServer struct + func NewStdioServer(options *StdioServerOptions) *StdioServer + func (s *StdioServer) Run(ctx context.Context) error + type StdioServerOptions struct + Async bool + Callbacks []string + Cwd string + DefaultLibraryPath string + Err io.Writer + In io.ReadCloser + Out io.WriteCloser + PipePath string + type StdioTransport struct + func NewStdioTransport(stdin io.ReadCloser, stdout io.WriteCloser) *StdioTransport + func (t *StdioTransport) Accept() (io.ReadWriteCloser, error) + func (t *StdioTransport) Close() error + type SymbolResponse struct + CheckFlags uint32 + Declarations []Handle[ast.Node] + Flags uint32 + Id Handle[ast.Symbol] + Name string + ValueDeclaration Handle[ast.Node] + func NewSymbolResponse(symbol *ast.Symbol) *SymbolResponse + type SyncConn struct + func NewSyncConn(rwc io.ReadWriteCloser, protocol Protocol, handler Handler) *SyncConn + func (c *SyncConn) Call(ctx context.Context, method string, params any) (json.Value, error) + func (c *SyncConn) Notify(ctx context.Context, method string, params any) error + func (c *SyncConn) Run(ctx context.Context) error + type Transport interface + Accept func() (io.ReadWriteCloser, error) + Close func() error + type TypePredicateResponse struct + Kind int32 + ParameterIndex int32 + ParameterName string + Type *TypeResponse + type TypeResponse struct + BaseType Handle[checker.Type] + CheckType Handle[checker.Type] + ElementFlags []checker.ElementFlags + ExtendsType Handle[checker.Type] + FixedLength *int + Flags uint32 + Id Handle[checker.Type] + IndexType Handle[checker.Type] + LocalTypeParameters []Handle[checker.Type] + ObjectFlags uint32 + ObjectType Handle[checker.Type] + OuterTypeParameters []Handle[checker.Type] + SubstConstraint Handle[checker.Type] + Symbol Handle[ast.Symbol] + Target Handle[checker.Type] + Texts []string + TupleReadonly *bool + TypeParameters []Handle[checker.Type] + Value any + type TypeToTypeNodeParams struct + Flags int32 + Location Handle[ast.Node] + Project Handle[project.Project] + Snapshot Handle[project.Snapshot] + Type Handle[checker.Type] + type UpdateSnapshotParams struct + FileChanges *APIFileChanges + OpenProject string + type UpdateSnapshotResponse struct + Changes *SnapshotChanges + Projects []*ProjectResponse + Snapshot Handle[project.Snapshot]