generator

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

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileGenerator

type FileGenerator struct {
	// contains filtered or unexported fields
}

FileGenerator handles generating Go files

func NewFileGenerator

func NewFileGenerator(model *vscodemetamodel.MetaModel) *FileGenerator

NewFileGenerator creates a new file generator

func (*FileGenerator) GenerateFiles

func (g *FileGenerator) GenerateFiles(ctx context.Context, packageName string) ([]FileOutput, error)

GenerateFiles generates all Go files for the types

type FileOutput

type FileOutput struct {
	Path     string // Relative path to write the file
	Contents string // File contents
}

FileOutput represents a generated file

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator handles the generation of LSP protocol code

func NewGenerator

func NewGenerator(model *vscodemetamodel.MetaModel) *Generator

NewGenerator creates a new LSP protocol code generator

func (*Generator) GenerateUnionType

func (g *Generator) GenerateUnionType(ctx context.Context, union *vscodemetamodel.OrType) (string, error)

GenerateUnionType generates a Go type for a union type

type TypeInfo

type TypeInfo struct {
	Name          string   // The Go type name
	GoType        string   // The actual Go type (e.g., string, int, etc.)
	IsPointer     bool     // Whether this is a pointer type
	IsBuiltin     bool     // Whether this is a builtin type
	IsNullable    bool     // Whether this type can be null
	IsUnion       bool     // Whether this is a union type
	Documentation string   // Documentation for this type
	Dependencies  []string // Names of other types this type depends on
	IsRecursive   bool     // Whether this type references itself
}

TypeInfo represents information about a type in our system

type TypeNamer

type TypeNamer struct {
	// contains filtered or unexported fields
}

TypeNamer handles type naming in our system

func NewTypeNamer

func NewTypeNamer() *TypeNamer

NewTypeNamer creates a new type namer

func (*TypeNamer) GenerateUnionTypeName

func (n *TypeNamer) GenerateUnionTypeName(union *vscodemetamodel.OrType) (string, error)

GenerateUnionTypeName generates a name for a union type based on its members

func (*TypeNamer) GetDependencyGraph

func (n *TypeNamer) GetDependencyGraph() map[string][]string

GetDependencyGraph returns a map of type names to their dependencies

func (*TypeNamer) GetDocumentation

func (n *TypeNamer) GetDocumentation(typeName string) string

GetDocumentation returns the documentation for a type

func (*TypeNamer) GetTypeInfo

func (n *TypeNamer) GetTypeInfo(t interface{}) (TypeInfo, error)

GetTypeInfo returns type information for a given type

func (*TypeNamer) GetTypeInfoFromRaw

func (n *TypeNamer) GetTypeInfoFromRaw(t interface{}) (TypeInfo, error)

GetTypeInfoFromRaw gets or creates type info from a raw interface{} value

Jump to

Keyboard shortcuts

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