You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

1.4.1RC3版本:条件中使用Scenario Outline变量时语法高亮失效

语法高亮异常示例(VSCode + Gherkin/Karate)

这是一个仅用于展示语法高亮问题的示例场景,代码功能不受影响,仅存在视觉层面异常。

Feature:

  Scenario Outline:
    * def x = 1

    * def output = x != null ? (100 + <add>) : null
            * print 'output for add is ', output
    * def output = x != null ? (100 - <subtract>) : null
            * print 'output for subtract is ', output
    * def output = x != null ? (100 * <times>) : null
            * print 'output for times is ', output
    * def output = x != null ? (100 / <divide>) : null
            * print 'output for divide is ', output
    
    * def output = <add> != null ? (100 + <add>) : null
            * print 'output for add is ', output
    * def output = <subtract> != null ? (100 - <subtract>) : null
            * print 'output for subtract is ', output
    * def output = <times> != null ? (100 * <times>) : null
            * print 'output for times is ', output
    * def output = <divide> != null ? (100 / <divide>) : null
            * print 'output for divide is ', output

    Examples:
            | add | subtract | times | divide |
            | 1   | 2        | 3     | null   |
            | 2   | 3        | null  | 4      |

VSCode中的语法高亮表现

  • 第一张截图显示,第一个包含<times>的行中,*符号之后的所有行语法高亮均异常;
  • 第二张截图中,将上述异常行注释后,初始部分之后的语法高亮仍处于异常状态;
  • 最后一组示例代码中,在条件判断里使用大纲变量时,同样出现首次使用后语法高亮异常的问题。

内容的提问来源于stack exchange,提问作者mike

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 17:32:51