Interface IContentFormatterExtension

    • Method Detail

      • format

        void format​(IDocument document,
                    IFormattingContext context)
        Formats the given region of the specified document.

        The formatter may safely assume that it is the only subject that modifies the document at this point in time. This method is fully reentrant, but not thread-safe.

        The formatting process performed by format(IDocument, IFormattingContext) happens as follows:

        • In a first pass the content formatter formats the range of the document to be formatted by using the master formatting strategy. This happens regardless of the content type of the underlying partition.
        • In the second pass, the range is formatted again, this time using the registered slave formatting strategies. For each partition contained in the range to be formatted, the content formatter determines its content type and formats the partition with the correct formatting strategy.
        Parameters:
        document - the document to be formatted
        context - the formatting context to pass to the formatting strategies. This argument must not be null.