Documentation ¶
Overview ¶
Package dart implements methods for manipulating Dart code.
Package dart implements methods for manipulating Dart code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BraceLevel ¶
type BraceLevel int
BraceLevel represents the current brace level the cursor is within.
const ( BraceUnknown BraceLevel = iota BraceNormal // Most recent unmatched '{' was not string literal related. BraceSingle // Most recent unmatched '{' was `'...${`. BraceDouble // Most recent unmatched '{' was `"...${`. BraceTripleSingle // Most recent unmatched '{' was `”'...${`. BraceTripleDouble // Most recent unmatched '{' was `"""...${`. )
type Class ¶
type Class struct {
// contains filtered or unexported fields
}
Class represents a Dart class.
func NewClass ¶
func NewClass(editor *Editor, classType, className string, openCurlyOffset, closeCurlyOffset int, groupAndSortGetterMethods, separatePrivateMethods bool) *Class
NewClass returns a new Dart Class.
editor is the editor used to parse the class. className is the name of the class. openCurlyOffset is the position of the "{" for that class. closeCurlyOffset is the position of the "}" for that class. groupAndSortGetterMethods determines how getter methods are processed.
func (*Class) FindFeatures ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Dart processor.
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor represents an editor cursor and is used to advance through the Dart source code.
func (*Cursor) CloseMatchingPair ¶ added in v0.1.3
func (c *Cursor) CloseMatchingPair(close string, matchingPairStack []*MatchingPair) []*MatchingPair
CloseMatchingPair closes the last open matching pair on the stack.
func (*Cursor) NewMatchingPair ¶ added in v0.1.3
func (c *Cursor) NewMatchingPair(open string, matchingPairs MatchingPairsMap, matchingPairStack []*MatchingPair) []*MatchingPair
NewMatchingPair adds the start of a new matching pair onto the stack.
type Edit ¶
type Edit struct {
// contains filtered or unexported fields
}
Edit represents an edit of an editor buffer.
type Editor ¶
type Editor struct { Verbose bool // contains filtered or unexported fields }
Editor represents a text editor that understands Dart syntax.
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
Entity represents a single, independent feature of a Dart.Class.
type EntityType ¶
type EntityType int
EntityType represents a type of Dart Line.
const ( Unknown EntityType = iota BlankLine SingleLineComment MultiLineComment MainConstructor NamedConstructor StaticVariable InstanceVariable OverrideVariable StaticPrivateVariable PrivateInstanceVariable OverrideMethod OtherMethod BuildMethod GetterMethod LeaveUnmodified // for everything else, like enum values. )
func (EntityType) String ¶
func (e EntityType) String() string
type Line ¶
type Line struct {
// contains filtered or unexported fields
}
Line represents a line of Dart code.
type MatchingPair ¶ added in v0.1.3
type MatchingPair struct {
// contains filtered or unexported fields
}
MatchingPair represents a matching pair of features in the Dart source code, such as r”'=>”', (=>), {=>}, etc.
type MatchingPairsMap ¶ added in v0.1.3
type MatchingPairsMap map[int]*MatchingPair
MatchingPairsMap represents a map of matching pairs keyed by the openAbsOffset value.
type Options ¶
type Options struct { Debug bool Diff bool List bool Quiet bool Verbose bool Write bool GroupAndSortGetterMethods bool GroupAndSortVariableTypes bool MemberOrdering []string ProcessEnumsLikeClasses bool SortClassesWithinFile bool SortOtherMethods bool SeparatePrivateMethods bool }
Options represents the configuration options for the Dart processor.