vscodegit

package
v0.0.120 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildGitOpenRepoURI

func BuildGitOpenRepoURI(absPath string) string

BuildGitOpenRepoURI constructs the vscode:// deep link for opening a git repo.

func BuildOpenURI

func BuildOpenURI(absPath string, replace bool) string

BuildOpenURI constructs the vscode:// deep link for opening a directory.

func EnsureCodeCLI

func EnsureCodeCLI() error

EnsureCodeCLI verifies the VS Code `code` CLI is available.

func EnsureExtensionListed

func EnsureExtensionListed() error

EnsureExtensionListed verifies xhd2015.open-in-new-window is installed.

func OpenDir

func OpenDir(path string, cwd string, replace bool) error

OpenDir validates the path, runs precheck, tries IPC, and falls back to URI.

func OpenDirOptions

func OpenDirOptions(path string, cwd string, opts OpenOptions) error

OpenDirOptions is the full open pipeline with IPC-only and JSON output options.

func OpenGitRepo

func OpenGitRepo(path string, cwd string) error

OpenGitRepo validates the path, runs precheck, tries IPC, and falls back to URI.

func SetCodeCommandForTest

func SetCodeCommandForTest(cmd string)

SetCodeCommandForTest overrides the code CLI path for tests. Pass empty string to reset.

func SetExecCommandHook

func SetExecCommandHook(hook func(name string, arg ...string) *exec.Cmd)

func SetGOOSForTest

func SetGOOSForTest(goos string)

func SetIPC_SOCKETPathForTest

func SetIPC_SOCKETPathForTest(path string)

SetIPC_SOCKETPathForTest overrides the IPC socket path for tests.

func SetStderrWriterForTest

func SetStderrWriterForTest(w io.Writer)

SetStderrWriterForTest redirects stderr hint output for tests.

func SetStdoutWriterForTest

func SetStdoutWriterForTest(w io.Writer)

SetStdoutWriterForTest redirects JSON stdout for tests.

func ValidateDirPath

func ValidateDirPath(path string, cwd string) (string, error)

ValidateDirPath resolves path against cwd, verifies it is an existing directory, and returns the normalized absolute path.

func ValidateGitRepoPath

func ValidateGitRepoPath(path string, cwd string) (string, error)

ValidateGitRepoPath resolves path against cwd, verifies it is an existing directory containing .git (file or directory), and returns the normalized absolute path.

Types

type OpenOptions

type OpenOptions struct {
	Replace bool
	IpcOnly bool
	Json    bool
}

OpenOptions configures directory open behavior.

Jump to

Keyboard shortcuts

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