Documentation
¶
Index ¶
- func AssertHasRealPosition(node *ast.Node)
- func GetFirstToken(node *ast.Node, sourceFile *ast.SourceFile) *ast.Node
- func GetLastChild(node *ast.Node, sourceFile *ast.SourceFile) *ast.Node
- func GetLastToken(node *ast.Node, sourceFile *ast.SourceFile) *ast.Node
- func GetLastVisitedChild(node *ast.Node, sourceFile *ast.SourceFile) *ast.Node
- func NodeIsASICandidate(node *ast.Node, file *ast.SourceFile) bool
- func PositionIsASICandidate(pos int, context *ast.Node, file *ast.SourceFile) bool
- func SyntaxMayBeASICandidate(kind ast.Kind) bool
- func SyntaxRequiresTrailingCommaOrSemicolonOrASI(kind ast.Kind) bool
- func SyntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind ast.Kind) bool
- func SyntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind ast.Kind) bool
- func SyntaxRequiresTrailingSemicolonOrASI(kind ast.Kind) bool
- type EditorSettings
- type FormatCodeSettings
- type IndentStyle
- type SemicolonPreference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertHasRealPosition ¶
func GetFirstToken ¶
func GetLastChild ¶
Replaces last(node.getChildren(sourceFile))
func GetLastToken ¶
func GetLastVisitedChild ¶
Gets the last visited child of the given node. NOTE: This doesn't include unvisited tokens; for this, use `getLastChild` or `getLastToken`.
func NodeIsASICandidate ¶
func NodeIsASICandidate(node *ast.Node, file *ast.SourceFile) bool
func PositionIsASICandidate ¶
func SyntaxMayBeASICandidate ¶
Types ¶
type EditorSettings ¶
type FormatCodeSettings ¶
type FormatCodeSettings struct {
EditorSettings
InsertSpaceAfterCommaDelimiter core.Tristate
InsertSpaceAfterSemicolonInForStatements core.Tristate
InsertSpaceBeforeAndAfterBinaryOperators core.Tristate
InsertSpaceAfterConstructor core.Tristate
InsertSpaceAfterKeywordsInControlFlowStatements core.Tristate
InsertSpaceAfterFunctionKeywordForAnonymousFunctions core.Tristate
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis core.Tristate
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets core.Tristate
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces core.Tristate
InsertSpaceAfterOpeningAndBeforeClosingEmptyBraces core.Tristate
InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces core.Tristate
InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces core.Tristate
InsertSpaceAfterTypeAssertion core.Tristate
InsertSpaceBeforeFunctionParenthesis core.Tristate
PlaceOpenBraceOnNewLineForFunctions core.Tristate
PlaceOpenBraceOnNewLineForControlBlocks core.Tristate
InsertSpaceBeforeTypeAnnotation core.Tristate
IndentMultiLineObjectLiteralBeginningOnBlankLine core.Tristate
Semicolons SemicolonPreference
IndentSwitchCase core.Tristate
}
func GetDefaultFormatCodeSettings ¶
func GetDefaultFormatCodeSettings() *FormatCodeSettings
func (*FormatCodeSettings) Copy ¶
func (settings *FormatCodeSettings) Copy() *FormatCodeSettings
func (*FormatCodeSettings) Parse ¶
func (settings *FormatCodeSettings) Parse(prefs any) bool
func (*FormatCodeSettings) ParseEditorSettings ¶
func (settings *FormatCodeSettings) ParseEditorSettings(editorSettings map[string]any) *FormatCodeSettings
type IndentStyle ¶
type IndentStyle int
const ( IndentStyleNone IndentStyle = iota IndentStyleBlock IndentStyleSmart )
type SemicolonPreference ¶
type SemicolonPreference string
const ( SemicolonPreferenceIgnore SemicolonPreference = "ignore" SemicolonPreferenceInsert SemicolonPreference = "insert" SemicolonPreferenceRemove SemicolonPreference = "remove" )
Click to show internal directories.
Click to hide internal directories.