quickfix

package
v0.0.0-...-c6dfda3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(src []byte, edits []TextEdit) (out []byte, indexes []int)

Apply returns updated src with edits applied to it.

Second return value contains indexes from edits slice that were not applied due to overlapping.

func Sort

func Sort(slice interface{}, get func(i int) TextEdit)

Types

type TextEdit

type TextEdit struct {
	StartOffset int
	EndOffset   int

	// Replacement is a text to be inserted as a Replacement.
	Replacement []byte
}

TextEdit is a suggested issue fix.

More or less, it represents our version of the https://godoc.org/golang.org/x/tools/go/analysis#TextEdit which is a part of https://godoc.org/golang.org/x/tools/go/analysis#SuggestedFix.

Jump to

Keyboard shortcuts

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