ide

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package ide provides interfaces and implementations for interacting with various IDEs.

Package ide is a generated GoMock package.

Index

Constants

View Source
const (
	// CursorName is the name identifier for the Cursor IDE.
	CursorName = "cursor"
	// CursorCommand is the command to open Cursor.
	CursorCommand = "cursor"
)
View Source
const (
	// DummyName is the name identifier for the Dummy IDE.
	DummyName = "dummy"
)

Variables

View Source
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 NewCursor

func NewCursor(fs fs.FS) *Cursor

NewCursor creates a new Cursor IDE instance.

func (*Cursor) IsInstalled

func (c *Cursor) IsInstalled() bool

IsInstalled checks if Cursor is installed on the system.

func (*Cursor) Name

func (c *Cursor) Name() string

Name returns the name of the IDE.

func (*Cursor) OpenRepository

func (c *Cursor) OpenRepository(path string) error

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 NewDummy

func NewDummy(fs fs.FS) *Dummy

NewDummy creates a new Dummy IDE instance.

func (*Dummy) IsInstalled

func (d *Dummy) IsInstalled() bool

IsInstalled always returns true for the dummy IDE.

func (*Dummy) Name

func (d *Dummy) Name() string

Name returns the name of the IDE.

func (*Dummy) OpenRepository

func (d *Dummy) OpenRepository(path string) error

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

func NewManager(fs fs.FS, logger logger.Logger) *Manager

NewManager creates a new IDE manager with registered IDE implementations.

func (*Manager) GetIDE

func (m *Manager) GetIDE(name string) (IDE, error)

GetIDE returns the IDE implementation for the given name.

func (*Manager) OpenIDE

func (m *Manager) OpenIDE(name, path string, verbose bool) error

OpenIDE opens the specified IDE with the given path.

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) IsInstalled

func (m *MockIDE) IsInstalled() bool

IsInstalled mocks base method.

func (*MockIDE) Name

func (m *MockIDE) Name() string

Name mocks base method.

func (*MockIDE) OpenRepository

func (m *MockIDE) OpenRepository(path string) error

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

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockManagerInterface) GetIDE

func (m *MockManagerInterface) GetIDE(name string) (IDE, error)

GetIDE mocks base method.

func (*MockManagerInterface) OpenIDE

func (m *MockManagerInterface) OpenIDE(name, path string, verbose bool) error

OpenIDE mocks base method.

type MockManagerInterfaceMockRecorder

type MockManagerInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockManagerInterfaceMockRecorder is the mock recorder for MockManagerInterface.

func (*MockManagerInterfaceMockRecorder) GetIDE

func (mr *MockManagerInterfaceMockRecorder) GetIDE(name any) *gomock.Call

GetIDE indicates an expected call of GetIDE.

func (*MockManagerInterfaceMockRecorder) OpenIDE

func (mr *MockManagerInterfaceMockRecorder) OpenIDE(name, path, verbose any) *gomock.Call

OpenIDE indicates an expected call of OpenIDE.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL