Documentation
¶
Index ¶
- Constants
- func DetectSchemaType(text string) string
- func DetectSchemaTypeForDocument(text, uri string) string
- func ExtractRawValues(text string, doc *tomlparser.TomlDocument) map[string]any
- func PropertyExists(doc *tomlparser.TomlDocument, tablePath []string, keyName string) bool
- func ResolveSchema(root *jsonschema.Schema, path []string, defs map[string]*jsonschema.Schema) *jsonschema.Schema
- func TomlTypeOf(value any) string
- func Values(text string, doc *tomlparser.TomlDocument) map[string]any
- type Diagnostic
Constants ¶
const ( SeverityError = "error" SeverityWarning = "warning" )
Variables ¶
This section is empty.
Functions ¶
func DetectSchemaType ¶
DetectSchemaType returns the schema type from the first comment line.
func DetectSchemaTypeForDocument ¶
DetectSchemaTypeForDocument uses the leading comment, then branch.toml.
func ExtractRawValues ¶
func ExtractRawValues(text string, doc *tomlparser.TomlDocument) map[string]any
extractRawValues extracts raw value strings from TOML text when strict parsing fails This allows type checking even for invalid TOML syntax like "terraform_version = 1.2.3"
func PropertyExists ¶
func PropertyExists(doc *tomlparser.TomlDocument, tablePath []string, keyName string) bool
func ResolveSchema ¶
func ResolveSchema(root *jsonschema.Schema, path []string, defs map[string]*jsonschema.Schema) *jsonschema.Schema
func TomlTypeOf ¶
func Values ¶
func Values(text string, doc *tomlparser.TomlDocument) map[string]any
Values fills parsed values, falling back to raw text when strict parse fails.
Types ¶
type Diagnostic ¶
type Diagnostic struct {
Severity string
Message string
StartLine int
StartChar int
EndLine int
EndChar int
}
Diagnostic is a per-file schema finding. Line and character are zero-based, matching the TOML parser and the language server.
func Diagnose ¶
func Diagnose(doc *tomlparser.TomlDocument, rootSchema *jsonschema.Schema) []Diagnostic
DiagnoseDocument generates diagnostics for a TOML document
func DiagnoseFile ¶
func DiagnoseFile(filename, text string) []Diagnostic
DiagnoseFile runs the same per-file checks as the language server. A file with no schema comment returns no diagnostics.