Skip to content

Commit

Permalink
Drop line number redeclaration
Browse files Browse the repository at this point in the history
  • Loading branch information
kieran-ryan committed Jul 14, 2024
1 parent a731afb commit a0f19ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Fixed
- Leading spaces breaks syntax highlighting for scenario outline ([#219](https://github.com/cucumber/language-service/pull/219))
- Parameter highlighting for scenario outline steps with leading spaces ([#219](https://github.com/cucumber/language-service/pull/219))
- (Ruby) Support `And` and `But` step definition annotations ([#211](https://github.com/cucumber/language-service/pull/211))
- (Python) Title variants of Behave's decorators (`Step`, `Given`, `When`, `Then`) ([#213](https://github.com/cucumber/language-service/pull/213))
- (PHP) Scoped query to match annotations only (`@Given`) ([#214](https://github.com/cucumber/language-service/pull/214))
Expand Down
4 changes: 2 additions & 2 deletions src/service/getGherkinSemanticTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ export function getGherkinSemanticTokens(
arr = makeLocationToken(step.location, step.keyword, SemanticTokenTypes.keyword, arr)
if (inScenarioOutline) {
const regexp = /(<[^>]+>)/g
let match: RegExpExecArray | null = null
const line = step.location.line - 1
const startOfText = lines[line].indexOf(step.text)

let match: RegExpExecArray | null
while ((match = regexp.exec(step.text)) !== null) {
const line = step.location.line - 1
const character = startOfText + match.index
arr = makeToken(line, character, match[0], SemanticTokenTypes.variable, arr)
}
Expand Down

0 comments on commit a0f19ef

Please sign in to comment.