change

package
v0.0.0-...-6fb55b7 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeOptions

type NodeOptions struct {
	// Text to be inserted before the new node
	Prefix string

	// Text to be inserted after the new node
	Suffix string
	// contains filtered or unexported fields
}

type Tracker

type Tracker struct {
	*printer.EmitContext

	*ast.NodeFactory
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker(ctx context.Context, compilerOptions *core.CompilerOptions, formatOptions *format.FormatCodeSettings, converters *lsconv.Converters) *Tracker

func (*Tracker) GetChanges

func (t *Tracker) GetChanges() map[string][]*lsproto.TextEdit

!!! address strada note

  • Note: after calling this, the TextChanges object must be discarded!

func (*Tracker) InsertAtTopOfFile

func (t *Tracker) InsertAtTopOfFile(sourceFile *ast.SourceFile, insert []*ast.Statement, blankLineBetween bool)

func (*Tracker) InsertImportSpecifierAtIndex

func (t *Tracker) InsertImportSpecifierAtIndex(sourceFile *ast.SourceFile, newSpecifier *ast.Node, namedImports *ast.Node, index int)

InsertImportSpecifierAtIndex inserts a new import specifier at the specified index in a NamedImports list

func (*Tracker) InsertNodeAfter

func (t *Tracker) InsertNodeAfter(sourceFile *ast.SourceFile, after *ast.Node, newNode *ast.Node)

func (*Tracker) InsertNodeAt

func (t *Tracker) InsertNodeAt(sourceFile *ast.SourceFile, pos core.TextPos, newNode *ast.Node, options NodeOptions)

func (*Tracker) InsertNodeBefore

func (t *Tracker) InsertNodeBefore(sourceFile *ast.SourceFile, before *ast.Node, newNode *ast.Node, blankLineBetween bool)

func (*Tracker) InsertNodeInListAfter

func (t *Tracker) InsertNodeInListAfter(sourceFile *ast.SourceFile, after *ast.Node, newNode *ast.Node, containingList []*ast.Node)

* * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, * i.e. arguments in arguments lists, parameters in parameter lists etc. * Note that separators are part of the node in statements and class elements.

func (*Tracker) InsertNodesAfter

func (t *Tracker) InsertNodesAfter(sourceFile *ast.SourceFile, after *ast.Node, newNodes []*ast.Node)

func (*Tracker) InsertNodesAt

func (t *Tracker) InsertNodesAt(sourceFile *ast.SourceFile, pos core.TextPos, newNodes []*ast.Node, options NodeOptions)

func (*Tracker) InsertText

func (t *Tracker) InsertText(sourceFile *ast.SourceFile, pos lsproto.Position, text string)

func (*Tracker) ReplaceNode

func (t *Tracker) ReplaceNode(sourceFile *ast.SourceFile, oldNode *ast.Node, newNode *ast.Node, options *NodeOptions)

func (*Tracker) ReplaceRange

func (t *Tracker) ReplaceRange(sourceFile *ast.SourceFile, lsprotoRange lsproto.Range, newNode *ast.Node, options NodeOptions)

func (*Tracker) ReplaceRangeWithNodes

func (t *Tracker) ReplaceRangeWithNodes(sourceFile *ast.SourceFile, lsprotoRange lsproto.Range, newNodes []*ast.Node, options NodeOptions)

func (*Tracker) ReplaceRangeWithText

func (t *Tracker) ReplaceRangeWithText(sourceFile *ast.SourceFile, lsprotoRange lsproto.Range, text string)

Jump to

Keyboard shortcuts

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