Closed goatshen closed 6 years ago
@goatshen Cool. And will be good if you add test case and fix test to pass.
And thanks for your contribution.
Hi @wingyplus .
The 'bdd style' test suite assumes that the first BDD word (e.g. Give, When, Then, And, But) will be tokenized. For the example, we expect that 'Given' will be tokenised with the scope ['text.robot', 'keyword.control.robot'].
expectedScopes = ['text.robot', 'keyword.control.robot']
it 'tokenizes Given', ->
{tokens} = grammar.tokenizeLine ' Given Do Something'
expect(tokens[1].scopes).toEqual expectedScopes
expect(tokens[1].value).toEqual 'Given'
With my additional changes to the grammar, 'Given Do Something' will now have the scope ['text.robot', 'keyword.control.robot'].
I was wondering if we should add an additional scope to the BDD words so it stands out from the keywords?
Also, I am able to use Travis to run the test cases but it takes a while. How do you locally run the test cases?
Cheers
Hi @wingyplus I fixed the test cases. Also made some adjustments to the Grammar since some variables were not being highlighted. Appreciate any feedback!
Sorry for late reply. I think BDD style keyword should have additional syntax. Maybe it will used underline hightlight. But it can do it later. :)
For running test on local you can do with apm test
.
@goatshen Thanks for your PR. I published this PR as a version 2.4.0. :)
Thanks for this enhancement. Is there any way to have different colors for the Keywords and the Keywords Definition like I would get in an IDE like PyCharm ?
As you can see in my screenshot, I have an orange font color for the Keywords and a light yellow color for the Keywords Definitions.
Thanks
Possible to do that. It's needs to modify regexp for keyword definitions because I re-use keyword syntax for both test case (or keyword) and keyword definitions.
I also have plan to revamp for new parser api (https://github.com/tree-sitter/tree-sitter). It'll be a good place to do this. :)
Thanks for the quick response.
If you're planning to revamp the regex, maybe it'll be a good idea to split everything up so it'll be easier to customize for everybody's needs.
Arguments (variables values, library values, tags values, etc)
Brackets (tags, documentation, arguments, etc)
Comments
Gherkin
Headings ( Settings , Variables , etc)
Settings (Library, Resource, etc)
Keywords
Keywords definitions
Variables
But that would only be nice to have. You already did a fantastic work on your plugin.
Thanks.
To improve the syntax highlighting of keywords. I hope this will resolve the following feature request: https://github.com/wingyplus/language-robot-framework/issues/37
How: I added two regex in robottxt.cson and gave them 'keyword.control.robot' scope.