Documentation
¶
Index ¶
- Variables
- type API
- func (api *API) Client() project.Client
- func (api *API) Close()
- func (api *API) DefaultLibraryPath() string
- func (api *API) DocumentRegistry() *project.DocumentRegistry
- func (api *API) FS() vfs.FS
- func (api *API) GetCurrentDirectory() string
- func (api *API) GetOrCreateScriptInfoForFile(fileName string, path tspath.Path, scriptKind core.ScriptKind) *project.ScriptInfo
- func (api *API) GetScriptInfoByPath(path tspath.Path) *project.ScriptInfo
- func (api *API) GetSourceFile(projectId Handle[project.Project], fileName string) (*ast.SourceFile, error)
- func (api *API) GetSymbolAtLocation(ctx context.Context, projectId Handle[project.Project], ...) (*SymbolResponse, error)
- func (api *API) GetSymbolAtPosition(ctx context.Context, projectId Handle[project.Project], fileName string, ...) (*SymbolResponse, error)
- func (api *API) GetTypeOfSymbol(ctx context.Context, projectId Handle[project.Project], ...) (*TypeResponse, error)
- func (api *API) HandleRequest(ctx context.Context, method string, payload []byte) ([]byte, error)
- func (api *API) IsWatchEnabled() bool
- func (api *API) LoadProject(configFileName string) (*ProjectResponse, error)
- func (api *API) Log(s string)
- func (api *API) NewLine() string
- func (api *API) OnDiscoveredSymlink(info *project.ScriptInfo)
- func (api *API) ParseConfigFile(configFileName string) (*ConfigFileResponse, error)
- func (api *API) PositionEncoding() lsproto.PositionEncodingKind
- type APIHost
- type APIOptions
- type Callback
- type ConfigFileResponse
- type ConfigureParams
- type GetSourceFileParams
- type GetSymbolAtLocationParams
- type GetSymbolAtPositionParams
- type GetSymbolsAtLocationsParams
- type GetSymbolsAtPositionsParams
- type GetTypeOfSymbolParams
- type GetTypesOfSymbolsParams
- type Handle
- type LoadProjectParams
- type MessagePackType
- type MessageType
- type Method
- type ParseConfigFileParams
- type ProjectResponse
- type Server
- func (s *Server) DefaultLibraryPath() string
- func (s *Server) DirectoryExists(path string) bool
- func (s *Server) FS() vfs.FS
- func (s *Server) FileExists(path string) bool
- func (s *Server) GetAccessibleEntries(path string) vfs.Entries
- func (s *Server) GetCurrentDirectory() string
- func (s *Server) NewLine() string
- func (s *Server) ReadFile(path string) (contents string, ok bool)
- func (s *Server) Realpath(path string) string
- func (s *Server) Remove(path string) error
- func (s *Server) Run() error
- func (s *Server) Stat(path string) vfs.FileInfo
- func (s *Server) UseCaseSensitiveFileNames() bool
- func (s *Server) WalkDir(root string, walkFn vfs.WalkDirFunc) error
- func (s *Server) WriteFile(path string, data string, writeByteOrderMark bool) error
- type ServerOptions
- type SymbolResponse
- type TypeResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidRequest = errors.New("api: invalid request") ErrClientError = errors.New("api: client error") )
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func NewAPI ¶
func NewAPI(host APIHost, options APIOptions) *API
func (*API) DefaultLibraryPath ¶
DefaultLibraryPath implements ProjectHost.
func (*API) DocumentRegistry ¶
func (api *API) DocumentRegistry() *project.DocumentRegistry
DocumentRegistry implements ProjectHost.
func (*API) GetCurrentDirectory ¶
GetCurrentDirectory implements ProjectHost.
func (*API) GetOrCreateScriptInfoForFile ¶
func (api *API) GetOrCreateScriptInfoForFile(fileName string, path tspath.Path, scriptKind core.ScriptKind) *project.ScriptInfo
GetOrCreateScriptInfoForFile implements ProjectHost.
func (*API) GetScriptInfoByPath ¶
func (api *API) GetScriptInfoByPath(path tspath.Path) *project.ScriptInfo
GetScriptInfoByPath implements ProjectHost.
func (*API) GetSourceFile ¶
func (*API) GetSymbolAtLocation ¶
func (*API) GetSymbolAtPosition ¶
func (*API) GetTypeOfSymbol ¶
func (*API) HandleRequest ¶
func (*API) IsWatchEnabled ¶
IsWatchEnabled implements ProjectHost.
func (*API) LoadProject ¶
func (api *API) LoadProject(configFileName string) (*ProjectResponse, error)
func (*API) OnDiscoveredSymlink ¶
func (api *API) OnDiscoveredSymlink(info *project.ScriptInfo)
OnDiscoveredSymlink implements ProjectHost.
func (*API) ParseConfigFile ¶
func (api *API) ParseConfigFile(configFileName string) (*ConfigFileResponse, error)
func (*API) PositionEncoding ¶
func (api *API) PositionEncoding() lsproto.PositionEncodingKind
PositionEncoding implements ProjectHost.
type APIOptions ¶
type ConfigFileResponse ¶
type ConfigFileResponse struct { FileNames []string `json:"fileNames"` Options *core.CompilerOptions `json:"options"` }
type ConfigureParams ¶
type GetSourceFileParams ¶
type GetTypeOfSymbolParams ¶
type GetTypesOfSymbolsParams ¶
type Handle ¶
func FileHandle ¶
func FileHandle(file *ast.SourceFile) Handle[ast.SourceFile]
type LoadProjectParams ¶
type LoadProjectParams struct {
ConfigFileName string `json:"configFileName"`
}
type MessagePackType ¶
type MessagePackType uint8
const ( MessagePackTypeFixedArray3 MessagePackType = 0x93 MessagePackTypeBin8 MessagePackType = 0xC4 MessagePackTypeBin16 MessagePackType = 0xC5 MessagePackTypeBin32 MessagePackType = 0xC6 MessagePackTypeU8 MessagePackType = 0xCC )
type MessageType ¶
type MessageType uint8
const ( MessageTypeUnknown MessageType = iota MessageTypeRequest MessageTypeCallResponse MessageTypeCallError MessageTypeResponse MessageTypeError MessageTypeCall )
func (MessageType) IsValid ¶
func (m MessageType) IsValid() bool
func (MessageType) String ¶
func (i MessageType) String() string
type Method ¶
type Method string
const ( MethodConfigure Method = "configure" MethodRelease Method = "release" MethodParseConfigFile Method = "parseConfigFile" MethodLoadProject Method = "loadProject" MethodGetSymbolAtPosition Method = "getSymbolAtPosition" MethodGetSymbolsAtPositions Method = "getSymbolsAtPositions" MethodGetSymbolAtLocation Method = "getSymbolAtLocation" MethodGetSymbolsAtLocations Method = "getSymbolsAtLocations" MethodGetTypeOfSymbol Method = "getTypeOfSymbol" MethodGetTypesOfSymbols Method = "getTypesOfSymbols" MethodGetSourceFile Method = "getSourceFile" )
type ParseConfigFileParams ¶
type ParseConfigFileParams struct {
FileName string `json:"fileName"`
}
type ProjectResponse ¶
type ProjectResponse struct { Id Handle[project.Project] `json:"id"` ConfigFileName string `json:"configFileName"` RootFiles []string `json:"rootFiles"` CompilerOptions *core.CompilerOptions `json:"compilerOptions"` }
func NewProjectResponse ¶
func NewProjectResponse(project *project.Project) *ProjectResponse
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(options *ServerOptions) *Server
func (*Server) DefaultLibraryPath ¶
DefaultLibraryPath implements APIHost.
func (*Server) DirectoryExists ¶
DirectoryExists implements vfs.FS.
func (*Server) FileExists ¶
FileExists implements vfs.FS.
func (*Server) GetAccessibleEntries ¶
GetAccessibleEntries implements vfs.FS.
func (*Server) GetCurrentDirectory ¶
GetCurrentDirectory implements APIHost.
func (*Server) UseCaseSensitiveFileNames ¶
UseCaseSensitiveFileNames implements vfs.FS.
type ServerOptions ¶
type SymbolResponse ¶
type SymbolResponse struct { Id Handle[ast.Symbol] `json:"id"` Name string `json:"name"` Flags uint32 `json:"flags"` CheckFlags uint32 `json:"checkFlags"` }
func NewSymbolResponse ¶
func NewSymbolResponse(symbol *ast.Symbol) *SymbolResponse
type TypeResponse ¶
func NewTypeData ¶
func NewTypeData(t *checker.Type) *TypeResponse
Click to show internal directories.
Click to hide internal directories.