class EE::UI::Doc::SyntaxDefinition

Overview

#include <syntaxdefinition.hpp>

class SyntaxDefinition {
public:
    // construction

    SyntaxDefinition();

    SyntaxDefinition(
        const std::string& languageName,
        std::vector<std::string>&& files,
        std::vector<SyntaxPattern>&& patterns,
        UnorderedMap<std::string, std::string>&& symbols = {},
        const std::string& comment = "",
        std::vector<std::string>&& headers = {},
        const std::string& lspName = ""
    );

    // methods

    const std::string& getLanguageName() const;
    std::string getLanguageNameForFileSystem() const;
    const String::HashType& getLanguageId() const;
    const std::vector<std::string>& getFiles() const;
    std::string getFileExtension() const;
    const std::vector<SyntaxPattern>& getPatterns() const;
    const std::string& getComment() const;
    const UnorderedMap<std::string, SyntaxStyleType>& getSymbols() const;
    SyntaxStyleType getSymbol(const std::string& symbol) const;
    SyntaxDefinition& addFileType(const std::string& fileType);
    SyntaxDefinition& addPattern(const SyntaxPattern& pattern);
    SyntaxDefinition& setPatterns(const std::vector<SyntaxPattern>& patterns);
    SyntaxDefinition& addPatternToFront(const SyntaxPattern& pattern);
    SyntaxDefinition& addPatternsToFront(const std::vector<SyntaxPattern>& patterns);
    SyntaxDefinition& addSymbol(const std::string& symbolName, const std::string& typeName);
    SyntaxDefinition& addSymbols(const std::vector<std::string>& symbolNames, const std::string& typeName);
    SyntaxDefinition& setSymbols(const UnorderedMap<std::string, SyntaxStyleType>& symbols);
    SyntaxDefinition& setComment(const std::string& comment);
    const std::vector<std::string>& getHeaders() const;
    SyntaxDefinition& setHeaders(const std::vector<std::string>& headers);
    void clearPatterns();
    void clearSymbols();
    const std::string& getLSPName() const;
    SyntaxDefinition& setVisible(bool visible);
    bool isVisible() const;
    bool getAutoCloseXMLTags() const;
    SyntaxDefinition& setAutoCloseXMLTags(bool autoCloseXMLTags);
    SyntaxDefinition& setLanguageName(const std::string& languageName);
    SyntaxDefinition& setLSPName(const std::string& lSPName);
    std::vector<SyntaxPattern> getPatternsOfType(const SyntaxStyleType& type) const;
    SyntaxDefinition& setFileTypes(const std::vector<std::string>& types);
    bool hasExtensionPriority() const;
    SyntaxDefinition& setExtensionPriority(bool hasExtensionPriority);
    UnorderedMap<std::string, std::string> getSymbolNames() const;
    const Uint16& getLanguageIndex() const;
    bool isCaseInsensitive() const;
    SyntaxDefinition& setCaseInsensitive(bool caseInsensitive);
    FoldRangeType getFoldRangeType() const;
    SyntaxDefinition& setFoldRangeType(FoldRangeType foldRangeType);
    std::vector<std::pair<Int64, Int64>> getFoldBraces() const;
    SyntaxDefinition& setFoldBraces(const std::vector<std::pair<Int64, Int64>>& foldBraces);
};

Detailed Documentation

Methods

SyntaxDefinition& addFileType(const std::string& fileType)

Accepts lua patterns and file extensions.

SyntaxDefinition& setComment(const std::string& comment)

Sets the comment string used for auto-comment functionality.