goplssetting

package
v0.0.0-...-4fcd1d8 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 4 more Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Experimental = Status(iota)
	Debug
	Advanced
	None
)

Variables

This section is empty.

Functions

func Generate

func Generate(inputFile string, skipCleanup bool) ([]byte, error)

Generate reads package.json and updates the gopls settings section based on `gopls api-json` output. This function requires `jq` to manipulate package.json.

Types

type API

type API struct {
	Options   map[string][]*Option
	Lenses    []*Lens
	Analyzers []*Analyzer
	Hints     []*Hint
}

API is a JSON-encodable representation of gopls' public interfaces.

Types are copied from golang.org/x/tools/gopls/internal/doc/api.go.

type Analyzer

type Analyzer struct {
	Name    string
	Doc     string // from analysis.Analyzer.Doc ("title: summary\ndescription"; not Markdown)
	URL     string
	Default bool
}

type EnumKey

type EnumKey struct {
	Name    string // in JSON syntax (quoted)
	Doc     string
	Default string
	Status  string // = "" | "advanced" | "experimental" | "deprecated"
}

type EnumKeys

type EnumKeys struct {
	ValueType string
	Keys      []EnumKey
}

type EnumValue

type EnumValue struct {
	Value  string // in JSON syntax (quoted)
	Doc    string // doc comment; always starts with `Value`
	Status string // = "" | "advanced" | "experimental" | "deprecated"
}

type Hint

type Hint struct {
	Name    string
	Doc     string
	Default bool
	Status  string // = "" | "advanced" | "experimental" | "deprecated"
}

type Lens

type Lens struct {
	FileType string // e.g. "Go", "go.mod"
	Lens     string
	Title    string
	Doc      string
	Default  bool
	Status   string // = "" | "advanced" | "experimental" | "deprecated"
}

type Object

type Object struct {
	Type                     any                `json:"type,omitempty"` // string | []string
	MarkdownDescription      string             `json:"markdownDescription,omitempty"`
	AdditionalProperties     bool               `json:"additionalProperties,omitempty"`
	Enum                     []any              `json:"enum,omitempty"`
	MarkdownEnumDescriptions []string           `json:"markdownEnumDescriptions,omitempty"`
	Default                  interface{}        `json:"default,omitempty"`
	Scope                    string             `json:"scope,omitempty"`
	Properties               map[string]*Object `json:"properties,omitempty"`
	DeprecationMessage       string             `json:"deprecationMessage,omitempty"`
}

Object represents a VS Code settings object.

type Option

type Option struct {
	Name               string
	Type               string // T = bool | string | int | enum | any | []T | map[T]T | time.Duration
	Doc                string
	EnumKeys           EnumKeys
	EnumValues         []EnumValue
	Default            string
	Status             string
	Hierarchy          string
	DeprecationMessage string
}

type Status

type Status int

Jump to

Keyboard shortcuts

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