goplssetting

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 10 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 APIJSON

type APIJSON struct {
	Options   map[string][]*OptionJSON
	Commands  []*CommandJSON
	Lenses    []*LensJSON
	Analyzers []*AnalyzerJSON
}

APIJSON is the output json type of `gopls api-json`. Types copied from golang.org/x/tools/internal/lsp/source/options.go.

type AnalyzerJSON

type AnalyzerJSON struct {
	Name    string
	Doc     string
	Default bool
}

type CommandJSON

type CommandJSON struct {
	Command string
	Title   string
	Doc     string
}

type EnumKey

type EnumKey struct {
	Name    string
	Doc     string
	Default string
}

type EnumKeys

type EnumKeys struct {
	ValueType string
	Keys      []EnumKey
}

type EnumValue

type EnumValue struct {
	Value string
	Doc   string
}

type LensJSON

type LensJSON struct {
	Lens  string
	Title string
	Doc   string
}

type Object

type Object struct {
	Type                     string             `json:"type,omitempty"`
	MarkdownDescription      string             `json:"markdownDescription,omitempty"`
	AdditionalProperties     bool               `json:"additionalProperties,omitempty"`
	Enum                     []string           `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"`
}

Object represents a VS Code settings object.

type OptionJSON

type OptionJSON struct {
	Name       string
	Type       string
	Doc        string
	EnumKeys   EnumKeys
	EnumValues []EnumValue
	Default    string
	Status     string
	Hierarchy  string
}

type Status

type Status int

Jump to

Keyboard shortcuts

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