Color or otherwise visually distinguish concepts from steps
Here is part of a Gauge scenario as it appears in IDEA. One of the steps is actually a concept. Can you tell which one?

Of course it's not possible to tell which one is the concept: there is nothing to visually distinguish the two. The only way to tell which one is the concept is by control-clicking on each of the steps and seeing if it leads to Java code or a concept file.
Concepts should appear visually different from regular steps in some way. This might be a different color, italicizing, or a special symbol in the editor (as Twist did). As is, it is impossible to tell which are steps and which are concepts.
me too!
It would be reeeallly helpful to be able to tell what is a step and what is a concept at first glance.
I am trying to figure out a strategy for how to implement this. Here is what I've figured out.
- The highlighting ultimately comes from
SpecSyntaxHighlighter, which assigns styles to predetermined tokens. - There is a token for
Step, but not forConcept. - The tokens appear to be generated by
_SpecLexer.java, which is auto-generated code created from_SpecLexer.flex. - The Flex file is only able to determine tokens based on syntax. Since Concepts within specs and Steps within specs have the same syntax, they are indistinguishable.
Is there some way that I can at a later point reclassify elements identified as Steps as Concepts instead? I do see code such as StepCollector.getSteps() as being able to distinguish between elements of type SpecStepImpl and ConceptStepImpl, but it's not clear to me if that might be able to be used in relation to syntax highlighting.
@Thunderforge IntelliJ-plugin defines specification and concept as two different languages.
See https://github.com/getgauge/Intellij-Plugin/blob/62da8766327de3e7a014457b5624ced27262bb2f/resources/META-INF/plugin.xml#L207 and https://github.com/getgauge/Intellij-Plugin/blob/62da8766327de3e7a014457b5624ced27262bb2f/resources/META-INF/plugin.xml#L209
The grammar for these languages are defined in concept.bnf and specification.bnf
While parsing I don't think there is a way for the plugin to differentiate between a step and a concept which is being used as step.
We have put some documentation related this here. Please feel free to have a look, and see if it helps you.
I do see code such as StepCollector.getSteps() as being able to distinguish between elements of type SpecStepImpl and ConceptStepImpl
This is actually not differentiating between step and concept being used as a step. It is checking if a step is defined in a Spec or Concept