shared

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanError

func CleanError(msg string) string

CleanError strips noisy artifacts from Go compiler errors, such as empty name quotes.

func ExtractErrorSnippet

func ExtractErrorSnippet(content string, err error) string

ExtractErrorSnippet attempts to parse a line number from an error message and returns a snippet of the content around that line.

func GetDocHint

func GetDocHint(errs []packages.Error) string

GetDocHint checks a list of package errors for API usage issues and returns a generic doc hint.

func GetDocHintFromOutput

func GetDocHintFromOutput(output string) string

GetDocHintFromOutput checks a raw output string for API usage issues and returns a generic doc hint.

func GetLineFromOffset

func GetLineFromOffset(content string, offset int) int

GetLineFromOffset calculates the 1-based line number for a given byte offset.

func GetLineOffsets

func GetLineOffsets(content string, startLine, endLine int) (int, int, error)

GetLineOffsets calculates the byte offsets for a given line range. line numbers are 1-based.

func GetSnippet

func GetSnippet(content string, lineNum int) string

GetSnippet returns a context window around the specified line number.

Types

This section is empty.

Jump to

Keyboard shortcuts

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