-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Gherkin support #3643
base: main
Are you sure you want to change the base?
Improve Gherkin support #3643
Conversation
thanks very much |
Can't we do this with multi-match and |
Is the colon part of the keyword though? |
Updated with a new version that removes the custom keyword pattern and fixes false positives. I couldn't figure out a good way to match for "beginning of line, skipping the whitespace" as |
src/languages/gherkin.js
Outdated
scope: 'string' | ||
}, | ||
{ | ||
begin: /^[ \t]+/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This repetition is frustrating. Could a single top-level rule to eat tabs at the start of lines accomplish this same thing (probably would leave to false positives)? If not why not add it to each multi-match rule as an optional first component:
begin: [
LINE_BEGINS_WS,
/(Feature|Rule|Examples?|Scenario(?:s| Outline| Template)?|Background)/,
/:/
],
beginScope: {
2: 'keyword',
3: 'punctuation',
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, eating whitespace of the beginning of the line with an empty mode seems to work. Is that what you had in mind? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The multi-match method I show above is what I had in mind, yes. That's the best way I know to handle this kind of thing (without putting the whitespace inside the highlight zone).
Any progress for this pr? |
@Hirse is this ready to go? sorry for long wait. coud you update changes.md? |
Resolves #3638
Resolves #3639
Changes
*
fromsymbol
tokeyword
since that is how it's described in the referenceReference
Checklist
CHANGES.md