All Known Implementing Classes:
DefaultContextProvider

public interface IContextProvider
A context provider is responsible for providing the correct context whenever lines in a patch are filtered. This becomes necessary, because filtering changes from a patch results in a new context for adjacent changes that have not been filtered.
  • Method Details

    • leadingContext

      List<Line> leadingContext(ILineFilter lineFilter, FileDiff fileDiff, int index)
      Determine the lines in the leading context of a change and return them. The context is determined based on a provided filter that may remove lines from the context.
      Parameters:
      lineFilter - The line filter that has been used to adjust the patch for which the context is provided
      fileDiff - The file diff containing the hunks for which a new context is to be determined
      index - The line number of the change for which a context is to be provided
      Returns:
      The leading context for the change
    • trailingContext

      List<Line> trailingContext(ILineFilter lineFilter, FileDiff fileDiff, int index)
      Determine the lines in the trailing context of a change and return them. The context is determined based on a provided filter that may remove lines from the context.
      Parameters:
      lineFilter - The line filter that has been used to adjust the patch for which the context is provided
      fileDiff - The file diff containing the hunks for which a new context is to be determined
      index - The line number of the change for which a context is to be provided
      Returns:
      The trailing context for the change