new BookmarkFacilitator(kwargsopt)
Class implementing bookmark-related operations
- Source:
Properties:
Name | Type | Description |
---|---|---|
logger |
Logger | Logger used for error and warning messages |
editor |
Editor | Editor integration object, providing access to unsaved file content |
gitOps |
GitInteraction | Used to execute |
diffOps |
DiffInteraction | Used to execute |
A BookmarkFacilitator needs a GitInteraction and a DiffInteraction for carrying out its various methods. If these are not provided in the kwargs.gitOps and kwargs.diffOps parameters, they will be constructed from the parameters that are provided.
Construction of a GitInteraction requires a runGitCommand
which, if not provided in kwargs.runGitCommand, is constructed based
on kwargs.toolOptions (though passing usesSubcommands
as true
).
Similarly, construction of a DiffInteraction requires a
runDiffCommand
which, if not provided in kwargs.runDiffCommand,
is constructed based on kwargs.toolOptions (though passing
usesSubcommands
as false
).
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kwargs |
object |
<optional> |
Properties
|
Methods
(async) computeLinePeg(filePath, currentLine, kwargsopt) → {Promise.<{line: number, commit: ?string}>}
Compute peg for bookmark
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
filePath |
string | Path of file |
|||||||||
currentLine |
number | Line (1-based) of file |
|||||||||
kwargs |
object |
<optional> |
Properties
|
Returns:
- Type
- Promise.<{line: number, commit: ?string}>
(async) currentLocation(bookmark) → {Promise.<{file: string, line: number, col: number}>}
Find the location of a bookmark in the current file content
- Source:
Parameters:
Name | Type | Description |
---|---|---|
bookmark |
Bookmark | Bookmark whose current location to determine |
Returns:
- Type
- Promise.<{file: string, line: number, col: number}>