Documentation
¶
Index ¶
- func CleanError(msg string) string
- func ExtractErrorSnippet(content string, err error) string
- func GetDocHint(errs []packages.Error) string
- func GetDocHintFromOutput(output string) string
- func GetLineFromOffset(content string, offset int) int
- func GetLineOffsets(content string, startLine, endLine int) (int, int, error)
- func GetSnippet(content string, lineNum int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanError ¶
CleanError strips noisy artifacts from Go compiler errors, such as empty name quotes.
func ExtractErrorSnippet ¶
ExtractErrorSnippet attempts to parse a line number from an error message and returns a snippet of the content around that line.
func GetDocHint ¶
GetDocHint checks a list of package errors for API usage issues and returns a generic doc hint.
func GetDocHintFromOutput ¶
GetDocHintFromOutput checks a raw output string for API usage issues and returns a generic doc hint.
func GetLineFromOffset ¶
GetLineFromOffset calculates the 1-based line number for a given byte offset.
func GetLineOffsets ¶
GetLineOffsets calculates the byte offsets for a given line range. line numbers are 1-based.
func GetSnippet ¶
GetSnippet returns a context window around the specified line number.
Types ¶
This section is empty.