Interface IContextProvider
- 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 Summary
Modifier and TypeMethodDescriptionleadingContext
(ILineFilter lineFilter, FileDiff fileDiff, int index) Determine the lines in the leading context of a change and return them.trailingContext
(ILineFilter lineFilter, FileDiff fileDiff, int index) Determine the lines in the trailing context of a change and return them.
-
Method Details
-
leadingContext
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 providedfileDiff
- The file diff containing the hunks for which a new context is to be determinedindex
- The line number of the change for which a context is to be provided- Returns:
- The leading context for the change
-
trailingContext
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 providedfileDiff
- The file diff containing the hunks for which a new context is to be determinedindex
- The line number of the change for which a context is to be provided- Returns:
- The trailing context for the change
-