organizeimports

package
v0.0.0-...-8beb55c Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareImportsOrRequireStatements

func CompareImportsOrRequireStatements(s1 *ast.Statement, s2 *ast.Statement, comparer func(a, b string) int) int

compareImportsOrRequireStatements compares two import or require statements for sorting

func GetImportDeclarationInsertIndex

func GetImportDeclarationInsertIndex(sortedImports []*ast.Statement, newImport *ast.Statement, comparer func(a, b *ast.Statement) int) int

statement = anyImportOrRequireStatement

func GetImportSpecifierInsertionIndex

func GetImportSpecifierInsertionIndex(sortedImports []*ast.Node, newImport *ast.Node, comparer func(s1, s2 *ast.Node) int) int

getImportSpecifierInsertionIndex finds the insertion index for a new import specifier

func GetNamedImportSpecifierComparer

func GetNamedImportSpecifierComparer(preferences *lsutil.UserPreferences, comparer func(a, b string) int) func(s1, s2 *ast.Node) int

GetNamedImportSpecifierComparer returns a comparer function for import/export specifiers

func GetNamedImportSpecifierComparerWithDetection

func GetNamedImportSpecifierComparerWithDetection(importDecl *ast.Node, sourceFile *ast.SourceFile, preferences *lsutil.UserPreferences) (specifierComparer func(s1, s2 *ast.Node) int, isSorted core.Tristate)

GetNamedImportSpecifierComparerWithDetection detects the appropriate comparer for named imports

func GetOrganizeImportsStringComparerWithDetection

func GetOrganizeImportsStringComparerWithDetection(originalImportDecls []*ast.Statement, preferences *lsutil.UserPreferences) (comparer func(a, b string) int, isSorted bool)

getOrganizeImportsStringComparerWithDetection detects the string comparer to use based on existing imports

Types

This section is empty.

Jump to

Keyboard shortcuts

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