types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

internal/types/position.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EditInfo

type EditInfo struct {
	StartIndex     uint32       // Start byte of the edit
	OldEndIndex    uint32       // End byte of the old text
	NewEndIndex    uint32       // End byte of the new text
	StartPosition  sitter.Point // Start position (row, column)
	OldEndPosition sitter.Point // Old end position
	NewEndPosition sitter.Point // New end position
}

EditInfo encapsulates the information needed for tree-sitter's Edit function.

type HighlightRegion

type HighlightRegion struct {
	Start Position
	End   Position
	Type  HighlightType
}

HighlightRegion defines a text range with a specific highlight type.

type HighlightType

type HighlightType string

HighlightType identifies the reason for highlighting.

const (
	HighlightSearch HighlightType = "search"
)

type Position

type Position struct {
	Line int
	Col  int // Rune index
}

Position represents a cursor or text position within the buffer. Line is the 0-based line index. Col is the 0-based column (rune) index within the line. Using Rune index is important for future Unicode handling.

type StyledRange

type StyledRange struct {
	StartCol  int    // Rune column index (inclusive)
	EndCol    int    // Rune column index (exclusive)
	StyleName string // Semantic style name (e.g., "keyword", "comment", "string")
}

StyledRange represents a segment of text with an associated style name (for theming).

Jump to

Keyboard shortcuts

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