(tour: CodeTour, stepNumber: number)
| 177 | } |
| 178 | |
| 179 | async function updateMarkerTitleForStep(tour: CodeTour, stepNumber: number) { |
| 180 | if (!isMarkerStep(tour, stepNumber)) { |
| 181 | return; |
| 182 | } |
| 183 | |
| 184 | const uri = await getStepFileUri( |
| 185 | tour.steps[stepNumber], |
| 186 | getWorkspaceUri(tour), |
| 187 | tour.ref |
| 188 | ); |
| 189 | |
| 190 | const document = await workspace.openTextDocument(uri); |
| 191 | const stepMarkerPrefix = getStepMarkerPrefix(tour); |
| 192 | |
| 193 | const markerPattern = new RegExp( |
| 194 | `${stepMarkerPrefix}\\.${stepNumber + 1}\\s*[-:]\\s*(.*)` |
| 195 | ); |
| 196 | |
| 197 | const match = document.getText().match(markerPattern); |
| 198 | if (match) { |
| 199 | tour.steps[stepNumber].markerTitle = match[1]; |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | async function updateMarkerTitlesForTour(tour: CodeTour) { |
| 204 | if (!isMarkerTour(tour)) { |
no test coverage detected