Skip to main content

Function: createSourceFragment()

createSourceFragment(line, source, contextLines?): FragmentLine[]

Defined in: sourceFragment.ts:18

Create fragment of code lines around input line (above and below), created created from provided source code.

Parameters​

line​

number

Source code line number, around which you want to created source fragment.

source​

string

Source file's source code.

contextLines?​

number = 4

Number of lines to generate, below and after watched line.

Returns​

FragmentLine[]

Array of source code lines.