externalrule

package
v1.8.21 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ProtocolVersion = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type Diagnostic

type Diagnostic struct {
	RuleID      string            `json:"ruleId"`
	Code        string            `json:"code,omitempty"`
	Severity    string            `json:"severity"`
	Category    string            `json:"category"`
	Message     string            `json:"message"`
	Path        string            `json:"path"`
	StartOffset int               `json:"startOffset"`
	EndOffset   int               `json:"endOffset"`
	Related     []RelatedLocation `json:"related,omitempty"`
	Fix         *Fix              `json:"fix,omitempty"`
	Suggestions []Suggestion      `json:"suggestions,omitempty"`
}

type Edit

type Edit struct {
	StartOffset int    `json:"startOffset"`
	EndOffset   int    `json:"endOffset"`
	NewText     string `json:"newText"`
}

type File

type File struct {
	Path    string `json:"path"`
	Content string `json:"content"`
}

type Fix

type Fix struct {
	Description string `json:"description"`
	Edits       []Edit `json:"edits"`
}

type Program

type Program struct {
	Command     string
	Arguments   []string
	Directory   string
	Environment []string
	Timeout     time.Duration
}

type RelatedLocation

type RelatedLocation struct {
	Path        string `json:"path"`
	StartOffset int    `json:"startOffset"`
	EndOffset   int    `json:"endOffset"`
	Message     string `json:"message"`
}

type Request

type Request struct {
	ProtocolVersion  int            `json:"protocolVersion"`
	WorkingDirectory string         `json:"workingDirectory"`
	Build            string         `json:"build,omitempty"`
	Target           string         `json:"target,omitempty"`
	Defines          []string       `json:"defines,omitempty"`
	Configuration    map[string]any `json:"configuration,omitempty"`
	Targets          []string       `json:"targets"`
	Files            []File         `json:"files"`
}

type Response

type Response struct {
	ProtocolVersion int          `json:"protocolVersion"`
	Diagnostics     []Diagnostic `json:"diagnostics"`
}

func Run

func Run(ctx context.Context, program Program, request Request) (Response, error)

type Suggestion

type Suggestion struct {
	Description string `json:"description"`
	Edits       []Edit `json:"edits,omitempty"`
}

Jump to

Keyboard shortcuts

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