class JavaScriptImportSorter
Declaration
class JavaScriptImportSorter : public TokenAnalyzer { /* full declaration omitted */ };
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:133
Inherits from: TokenAnalyzer
Member Variables
- private clang::format::FormatToken* Current
- private clang::format::FormatToken* LineEnd
- private clang::format::FormatToken invalidToken
- private llvm::StringRef FileContents
Inherited from TokenAnalyzer:
Method Overview
- public JavaScriptImportSorter(const clang::format::Environment & Env, const clang::format::FormatStyle & Style)
- public std::pair<tooling::Replacements, unsigned int> analyze(clang::format::TokenAnnotator & Annotator, SmallVectorImpl<clang::format::AnnotatedLine *> & AnnotatedLines, clang::format::FormatTokenLexer & Tokens)
- private void appendReference(std::string & Buffer, clang::format::JsModuleReference & Reference)
- private llvm::StringRef getSourceText(clang::SourceRange Range)
- private llvm::StringRef getSourceText(clang::SourceLocation Begin, clang::SourceLocation End)
- private void mergeModuleReferences(SmallVector<clang::format::JsModuleReference, 16> & References)
- private void nextToken()
- private bool parseModuleBindings(const clang::format::AdditionalKeywords & Keywords, clang::format::JsModuleReference & Reference)
- private bool parseModuleReference(const clang::format::AdditionalKeywords & Keywords, clang::format::JsModuleReference & Reference)
- private std::pair<SmallVector<JsModuleReference, 16>, AnnotatedLine *> parseModuleReferences(const clang::format::AdditionalKeywords & Keywords, SmallVectorImpl<clang::format::AnnotatedLine *> & AnnotatedLines)
- private bool parseNamedBindings(const clang::format::AdditionalKeywords & Keywords, clang::format::JsModuleReference & Reference)
- private bool parseStarBinding(const clang::format::AdditionalKeywords & Keywords, clang::format::JsModuleReference & Reference)
- private void skipComments()
- private clang::format::FormatToken * skipComments(clang::format::FormatToken * Tok)
- private SmallVector<clang::format::JsModuleReference, 16> sortModuleReferences(const SmallVector<clang::format::JsModuleReference, 16> & References)
Inherited from TokenAnalyzer:
Inherited from UnwrappedLineConsumer:
Methods
¶JavaScriptImportSorter(
const clang::format::Environment& Env,
const clang::format::FormatStyle& Style)
JavaScriptImportSorter(
const clang::format::Environment& Env,
const clang::format::FormatStyle& Style)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:135
Parameters
- const clang::format::Environment& Env
- const clang::format::FormatStyle& Style
¶std::pair<tooling::Replacements, unsigned int>
analyze(clang::format::TokenAnnotator& Annotator,
SmallVectorImpl<
clang::format::AnnotatedLine*>&
AnnotatedLines,
clang::format::FormatTokenLexer& Tokens)
std::pair<tooling::Replacements, unsigned int>
analyze(clang::format::TokenAnnotator& Annotator,
SmallVectorImpl<
clang::format::AnnotatedLine*>&
AnnotatedLines,
clang::format::FormatTokenLexer& Tokens)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:143
Parameters
- clang::format::TokenAnnotator& Annotator
- SmallVectorImpl<clang::format::AnnotatedLine*>& AnnotatedLines
- clang::format::FormatTokenLexer& Tokens
¶void appendReference(
std::string& Buffer,
clang::format::JsModuleReference& Reference)
void appendReference(
std::string& Buffer,
clang::format::JsModuleReference& Reference)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:327
Parameters
- std::string& Buffer
- clang::format::JsModuleReference& Reference
¶llvm::StringRef getSourceText(
clang::SourceRange Range)
llvm::StringRef getSourceText(
clang::SourceRange Range)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:245
Parameters
- clang::SourceRange Range
¶llvm::StringRef getSourceText(
clang::SourceLocation Begin,
clang::SourceLocation End)
llvm::StringRef getSourceText(
clang::SourceLocation Begin,
clang::SourceLocation End)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:249
Parameters
¶void mergeModuleReferences(
SmallVector<clang::format::JsModuleReference,
16>& References)
void mergeModuleReferences(
SmallVector<clang::format::JsModuleReference,
16>& References)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:296
Parameters
- SmallVector<clang::format::JsModuleReference, 16>& References
¶void nextToken()
void nextToken()
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:235
¶bool parseModuleBindings(
const clang::format::AdditionalKeywords&
Keywords,
clang::format::JsModuleReference& Reference)
bool parseModuleBindings(
const clang::format::AdditionalKeywords&
Keywords,
clang::format::JsModuleReference& Reference)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:482
Parameters
- const clang::format::AdditionalKeywords& Keywords
- clang::format::JsModuleReference& Reference
¶bool parseModuleReference(
const clang::format::AdditionalKeywords&
Keywords,
clang::format::JsModuleReference& Reference)
bool parseModuleReference(
const clang::format::AdditionalKeywords&
Keywords,
clang::format::JsModuleReference& Reference)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:444
Parameters
- const clang::format::AdditionalKeywords& Keywords
- clang::format::JsModuleReference& Reference
¶std::pair<SmallVector<JsModuleReference, 16>,
AnnotatedLine*>
parseModuleReferences(
const clang::format::AdditionalKeywords&
Keywords,
SmallVectorImpl<
clang::format::AnnotatedLine*>&
AnnotatedLines)
std::pair<SmallVector<JsModuleReference, 16>,
AnnotatedLine*>
parseModuleReferences(
const clang::format::AdditionalKeywords&
Keywords,
SmallVectorImpl<
clang::format::AnnotatedLine*>&
AnnotatedLines)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:364
Parameters
- const clang::format::AdditionalKeywords& Keywords
- SmallVectorImpl<clang::format::AnnotatedLine*>& AnnotatedLines
¶bool parseNamedBindings(
const clang::format::AdditionalKeywords&
Keywords,
clang::format::JsModuleReference& Reference)
bool parseNamedBindings(
const clang::format::AdditionalKeywords&
Keywords,
clang::format::JsModuleReference& Reference)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:505
Parameters
- const clang::format::AdditionalKeywords& Keywords
- clang::format::JsModuleReference& Reference
¶bool parseStarBinding(
const clang::format::AdditionalKeywords&
Keywords,
clang::format::JsModuleReference& Reference)
bool parseStarBinding(
const clang::format::AdditionalKeywords&
Keywords,
clang::format::JsModuleReference& Reference)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:489
Parameters
- const clang::format::AdditionalKeywords& Keywords
- clang::format::JsModuleReference& Reference
¶void skipComments()
void skipComments()
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:227
¶clang::format::FormatToken* skipComments(
clang::format::FormatToken* Tok)
clang::format::FormatToken* skipComments(
clang::format::FormatToken* Tok)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:229
Parameters
¶SmallVector<clang::format::JsModuleReference, 16>
sortModuleReferences(
const SmallVector<
clang::format::JsModuleReference,
16>& References)
SmallVector<clang::format::JsModuleReference, 16>
sortModuleReferences(
const SmallVector<
clang::format::JsModuleReference,
16>& References)
Declared at: clang/lib/Format/SortJavaScriptImports.cpp:260
Parameters
- const SmallVector< clang::format::JsModuleReference, 16>& References