Documentation
¶
Overview ¶
Package ide provides IDE opening functionality through hooks.
Package ide provides IDE opening functionality through hooks.
Package ide is a generated GoMock package.
Index ¶
- Constants
- Variables
- type Cursor
- type Dummy
- type IDE
- type Manager
- type ManagerInterface
- type MockIDE
- type MockIDEMockRecorder
- type MockManagerInterface
- type MockManagerInterfaceMockRecorder
- type OpeningHook
- func (h *OpeningHook) Execute(_ *hooks.HookContext) error
- func (h *OpeningHook) Name() string
- func (h *OpeningHook) OnError(_ *hooks.HookContext) error
- func (h *OpeningHook) PostExecute(ctx *hooks.HookContext) error
- func (h *OpeningHook) PreExecute(_ *hooks.HookContext) error
- func (h *OpeningHook) Priority() int
- func (h *OpeningHook) RegisterForOperations(registerHook func(operation string, hook hooks.Hook) error) error
- type VSCode
Constants ¶
const ( // CursorName is the name identifier for the Cursor IDE. CursorName = "cursor" // CursorCommand is the command to open Cursor. CursorCommand = "cursor" )
const ( // VSCodeName is the name identifier for the VS Code IDE. VSCodeName = "vscode" // VSCodeCommand is the command to open VS Code. VSCodeCommand = "code" )
const DefaultIDE = VSCodeName
DefaultIDE is the default IDE name used when no IDE is specified.
const (
// DummyName is the name identifier for the Dummy IDE.
DummyName = "dummy"
)
Variables ¶
var ( // ErrIDENotInstalled is returned when an IDE is not installed on the system. ErrIDENotInstalled = errors.New("IDE not installed") // ErrUnsupportedIDE is returned when an IDE is not supported. ErrUnsupportedIDE = errors.New("unsupported IDE") // ErrIDEExecutionFailed is returned when IDE command execution fails. ErrIDEExecutionFailed = errors.New("failed to execute IDE command") // ErrWorktreeNotFound is returned when a worktree is not found in status.yaml. ErrWorktreeNotFound = errors.New("worktree not found") )
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor represents the Cursor IDE implementation.
func (*Cursor) IsInstalled ¶
IsInstalled checks if Cursor is installed on the system.
func (*Cursor) OpenRepository ¶
OpenRepository opens Cursor with the specified repository path.
type Dummy ¶
type Dummy struct {
// contains filtered or unexported fields
}
Dummy represents a dummy IDE implementation for testing.
func (*Dummy) IsInstalled ¶
IsInstalled always returns true for the dummy IDE.
func (*Dummy) OpenRepository ¶
OpenRepository does nothing but returns success.
type IDE ¶
type IDE interface { // Name returns the name of the IDE Name() string // IsInstalled checks if the IDE is installed on the system IsInstalled() bool // OpenRepository opens the IDE with the specified repository path OpenRepository(path string) error }
IDE interface defines the methods that all IDE implementations must provide.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages IDE implementations and provides a unified interface.
func NewManager ¶
NewManager creates a new IDE manager with registered IDE implementations.
type ManagerInterface ¶
type ManagerInterface interface { // GetIDE returns the IDE implementation for the given name GetIDE(name string) (IDE, error) // OpenIDE opens the specified IDE with the given path OpenIDE(name, path string, verbose bool) error }
ManagerInterface defines the interface for IDE management.
type MockIDE ¶
type MockIDE struct {
// contains filtered or unexported fields
}
MockIDE is a mock of IDE interface.
func NewMockIDE ¶
func NewMockIDE(ctrl *gomock.Controller) *MockIDE
NewMockIDE creates a new mock instance.
func (*MockIDE) EXPECT ¶
func (m *MockIDE) EXPECT() *MockIDEMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockIDE) OpenRepository ¶
OpenRepository mocks base method.
type MockIDEMockRecorder ¶
type MockIDEMockRecorder struct {
// contains filtered or unexported fields
}
MockIDEMockRecorder is the mock recorder for MockIDE.
func (*MockIDEMockRecorder) IsInstalled ¶
func (mr *MockIDEMockRecorder) IsInstalled() *gomock.Call
IsInstalled indicates an expected call of IsInstalled.
func (*MockIDEMockRecorder) Name ¶
func (mr *MockIDEMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name.
func (*MockIDEMockRecorder) OpenRepository ¶
func (mr *MockIDEMockRecorder) OpenRepository(path any) *gomock.Call
OpenRepository indicates an expected call of OpenRepository.
type MockManagerInterface ¶
type MockManagerInterface struct {
// contains filtered or unexported fields
}
MockManagerInterface is a mock of ManagerInterface interface.
func NewMockManagerInterface ¶
func NewMockManagerInterface(ctrl *gomock.Controller) *MockManagerInterface
NewMockManagerInterface creates a new mock instance.
func (*MockManagerInterface) EXPECT ¶
func (m *MockManagerInterface) EXPECT() *MockManagerInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockManagerInterfaceMockRecorder ¶
type MockManagerInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockManagerInterfaceMockRecorder is the mock recorder for MockManagerInterface.
type OpeningHook ¶
type OpeningHook struct {
IDEManager ManagerInterface
}
OpeningHook provides IDE opening functionality as a post-hook.
func NewOpeningHook ¶
func NewOpeningHook() *OpeningHook
NewOpeningHook creates a new OpeningHook instance and registers it for appropriate operations.
func (*OpeningHook) Execute ¶
func (h *OpeningHook) Execute(_ *hooks.HookContext) error
Execute is a no-op for OpeningHook as it implements specific methods.
func (*OpeningHook) OnError ¶
func (h *OpeningHook) OnError(_ *hooks.HookContext) error
OnError is a no-op for OpeningHook.
func (*OpeningHook) PostExecute ¶
func (h *OpeningHook) PostExecute(ctx *hooks.HookContext) error
PostExecute validates IDE opening parameters and opens the IDE after successful operations.
func (*OpeningHook) PreExecute ¶
func (h *OpeningHook) PreExecute(_ *hooks.HookContext) error
PreExecute is a no-op for OpeningHook.
func (*OpeningHook) Priority ¶
func (h *OpeningHook) Priority() int
Priority returns the hook priority (lower numbers execute first).
func (*OpeningHook) RegisterForOperations ¶
func (h *OpeningHook) RegisterForOperations(registerHook func(operation string, hook hooks.Hook) error) error
RegisterForOperations registers this hook for the operations that create worktrees.
type VSCode ¶
type VSCode struct {
// contains filtered or unexported fields
}
VSCode represents the VS Code IDE implementation.
func (*VSCode) IsInstalled ¶
IsInstalled checks if VS Code is installed on the system.
func (*VSCode) OpenRepository ¶
OpenRepository opens VS Code with the specified repository path.