Documentation
¶
Index ¶
- Constants
- func CanUseGopls(workspaceRoot string) bool
- func CanUsePyright(workspaceRoot string) bool
- func CanUseTsserver(workspaceRoot string) bool
- func DiscoverRepoRoot(start string) (string, error)
- func ErrUnsupportedBackend(backendType string) error
- func FindBundledWorkerBinary(toolRoot string) (string, error)
- func FindBundledWorkerBinaryForRID(toolRoot string, rid string) (string, error)
- func FindInstalledWorkerBinary() (string, error)
- func FindInstalledWorkerBinaryForRID(rid string) (string, error)
- func HasDotnet() bool
- func InstallWorker(toolRoot string, rid string) (string, error)
- func InstalledWorkerDir() (string, error)
- func InstalledWorkerDirForRID(rid string) (string, error)
- func ReadFrame(reader io.Reader, payload any) error
- func ResolveRID() string
- func ResolveToolRoot(start string) (string, string)
- func WriteFrame(writer io.Writer, payload any) error
- type Client
- type EphemeralCaller
- type LSPClient
- type LSPConfig
- type LaunchSpec
- type RuntimeClient
- type TsserverClient
- type WorkerCandidateStatus
- type WorkerRuntimeInfo
Constants ¶
View Source
const MaxFrameSize = 256 << 20
MaxFrameSize is the maximum allowed frame size (256MB). Frames exceeding this size are rejected to prevent OOM DoS attacks.
Variables ¶
This section is empty.
Functions ¶
func CanUseGopls ¶ added in v0.3.0
func CanUsePyright ¶
CanUsePyright checks if Pyright is available for the workspace.
func CanUseTsserver ¶
func DiscoverRepoRoot ¶
func ErrUnsupportedBackend ¶
func FindBundledWorkerBinary ¶
func InstalledWorkerDir ¶
func ResolveRID ¶
func ResolveRID() string
func ResolveToolRoot ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(repoRoot string, workspace model.WorkspaceRegistration) (*Client, error)
func (*Client) Call ¶
func (c *Client) Call(ctx context.Context, request model.WorkerRequest) (model.WorkerResponse, error)
type EphemeralCaller ¶
type EphemeralCaller struct {
RepoRoot string
}
func (EphemeralCaller) Call ¶
func (e EphemeralCaller) Call(ctx context.Context, workspace model.WorkspaceRegistration, request model.WorkerRequest) (model.WorkerResponse, error)
func (EphemeralCaller) Status ¶
func (e EphemeralCaller) Status() []model.WorkerStatus
type LSPClient ¶
type LSPClient struct {
// contains filtered or unexported fields
}
LSPClient implements RuntimeClient via a standard LSP server.
func NewGoplsClient ¶ added in v0.3.0
func NewGoplsClient(workspace model.WorkspaceRegistration) (*LSPClient, error)
func NewLSPClient ¶
func NewLSPClient(config LSPConfig, workspace model.WorkspaceRegistration) *LSPClient
NewLSPClient creates a new generic LSP client.
func NewPyrightClient ¶
func NewPyrightClient(workspace model.WorkspaceRegistration) (*LSPClient, error)
NewPyrightClient creates an LSPClient configured for Pyright.
func (*LSPClient) Call ¶
func (c *LSPClient) Call(ctx context.Context, request model.WorkerRequest) (model.WorkerResponse, error)
Call dispatches a mi-lsp request to the LSP server.
type LaunchSpec ¶
type LaunchSpec struct {
Source string
CandidatePath string
Command string
Args []string
WorkDir string
}
func ResolveLaunchSpec ¶
func ResolveLaunchSpec(toolRoot string) (LaunchSpec, error)
func ResolveLaunchSpecs ¶ added in v0.2.0
func ResolveLaunchSpecs(toolRoot string) ([]LaunchSpec, error)
type RuntimeClient ¶
type RuntimeClient interface {
Call(context.Context, model.WorkerRequest) (model.WorkerResponse, error)
Close() error
PID() int
}
func NewRuntimeClient ¶
func NewRuntimeClient(repoRoot string, workspace model.WorkspaceRegistration, request model.WorkerRequest) (RuntimeClient, error)
type TsserverClient ¶
type TsserverClient struct {
// contains filtered or unexported fields
}
func NewTsserverClient ¶
func NewTsserverClient(workspace model.WorkspaceRegistration) (*TsserverClient, error)
func (*TsserverClient) Call ¶
func (c *TsserverClient) Call(ctx context.Context, request model.WorkerRequest) (model.WorkerResponse, error)
func (*TsserverClient) Close ¶
func (c *TsserverClient) Close() error
func (*TsserverClient) PID ¶
func (c *TsserverClient) PID() int
func (*TsserverClient) Start ¶
func (c *TsserverClient) Start() error
type WorkerCandidateStatus ¶
type WorkerRuntimeInfo ¶
type WorkerRuntimeInfo struct {
RID string `json:"rid,omitempty"`
ToolRoot string `json:"tool_root,omitempty"`
ToolRootKind string `json:"tool_root_kind,omitempty"`
Dotnet bool `json:"dotnet,omitempty"`
InstallHint string `json:"install_hint,omitempty"`
Selected WorkerCandidateStatus `json:"selected,omitempty"`
Bundled WorkerCandidateStatus `json:"bundled,omitempty"`
Installed WorkerCandidateStatus `json:"installed,omitempty"`
DevLocal WorkerCandidateStatus `json:"dev_local,omitempty"`
}
func InspectWorkerRuntime ¶
func InspectWorkerRuntime(toolRoot string, rid string) WorkerRuntimeInfo
Click to show internal directories.
Click to hide internal directories.