formatter

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package formatter implements a deterministic, comment-preserving TypeRB printer. Parsing happens first; the printer then uses the lossless token stream so comments, strings, percent literals, and heredocs are never lost.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(source []byte) ([]byte, []diagnostic.Diagnostic)

func FormatWithOptions added in v0.3.9

func FormatWithOptions(source []byte, options Options) ([]byte, []diagnostic.Diagnostic)

Types

type Options added in v0.3.9

type Options struct {
	// CanonicalImportPath returns the authored spelling that should be printed
	// for one parsed import. Project-aware callers may use their shared module
	// resolver; source-only callers leave it nil and preserve import paths.
	CanonicalImportPath func(string) string
}

Jump to

Keyboard shortcuts

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