codeprinter

package
v0.0.0-...-094b1a8 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodePrintMode

type CodePrintMode string
const (
	CodePrintModeOneLine CodePrintMode = "oneLine"
	CodePrintModeExtend  CodePrintMode = "extend"
)

type CodePrintOpts

type CodePrintOpts struct {
	Borders     bool
	LineNumbers bool
	Arrows      bool
	ColumnArrow bool
	Mode        CodePrintMode
}

type ExtractorHL

type ExtractorHL struct {
}

func NewExtractorHL

func NewExtractorHL() *ExtractorHL

func (*ExtractorHL) ExtractLines

func (e *ExtractorHL) ExtractLines(fileAbs string, from int, to int) ([]string, error)

type ExtractorRaw

type ExtractorRaw struct{}

func NewExtractorRaw

func NewExtractorRaw() *ExtractorRaw

func (*ExtractorRaw) ExtractLines

func (e *ExtractorRaw) ExtractLines(fileAbs string, from int, to int) ([]string, error)

type Printer

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

func NewPrinter

func NewPrinter(
	rawExtractor linesExtractor,
	highlightedExtractor linesExtractor,
	useColors bool,
) *Printer

func (*Printer) Print

func (p *Printer) Print(ref Reference, externalOpts CodePrintOpts) (string, error)

type Reference

type Reference struct {
	File   string
	Line   int
	Column int
	Valid  bool
}

Reference is copy of arch.Reference it required because /pkg should not depend on SDK models

Jump to

Keyboard shortcuts

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