diagnosticfix

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndpointHeaderReplacement

func EndpointHeaderReplacement(message string) (string, bool)

EndpointHeaderReplacement extracts the current endpoint declaration from an old endpoint syntax diagnostic message.

func MissingUseAlias

func MissingUseAlias(message string) (string, bool)

MissingUseAlias extracts the missing GOWDK use alias from a diagnostic.

Types

type Diagnostic

type Diagnostic struct {
	Code    string
	Message string
	Range   Range
}

Diagnostic is the small diagnostic shape needed by registry rewriters.

type Position

type Position struct {
	Line   int
	Column int
}

Position is a 1-based text position.

func UseInsertionPosition

func UseInsertionPosition(source string, fallback Position) Position

UseInsertionPosition inserts use declarations before view when possible.

type Range

type Range struct {
	Start Position
	End   Position
}

Range is a 1-based text range. End is exclusive.

type TextEdit

type TextEdit struct {
	Range   Range
	NewText string
}

TextEdit replaces Range with NewText.

func Edits

func Edits(fix diagnostics.Fix, source string, diagnostic Diagnostic) ([]TextEdit, error)

Edits returns source edits for a registry fix and diagnostic.

Jump to

Keyboard shortcuts

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