diff --git a/src/com/millennialmedia/intellibot/psi/RobotKeywordProvider.java b/src/com/millennialmedia/intellibot/psi/RobotKeywordProvider.java index 341dcb39..3dc3087d 100644 --- a/src/com/millennialmedia/intellibot/psi/RobotKeywordProvider.java +++ b/src/com/millennialmedia/intellibot/psi/RobotKeywordProvider.java @@ -31,6 +31,8 @@ public static RobotKeywordProvider getInstance() { KEYWORD_TABLE.addSyntax(RobotTokenTypes.HEADING, "*** Setting ***"); KEYWORD_TABLE.addSyntax(RobotTokenTypes.HEADING, "*** Test Cases ***"); KEYWORD_TABLE.addSyntax(RobotTokenTypes.HEADING, "*** Test Case ***"); + KEYWORD_TABLE.addSyntax(RobotTokenTypes.HEADING, "*** Tasks ***"); + KEYWORD_TABLE.addSyntax(RobotTokenTypes.HEADING, "*** Task ***"); KEYWORD_TABLE.addSyntax(RobotTokenTypes.HEADING, "*** Keywords ***"); KEYWORD_TABLE.addSyntax(RobotTokenTypes.HEADING, "*** Keyword ***"); KEYWORD_TABLE.addSyntax(RobotTokenTypes.HEADING, "*** Metadata ***"); @@ -41,6 +43,7 @@ public static RobotKeywordProvider getInstance() { addRecommendation(RobotTokenTypes.HEADING, "*** Settings ***", "Settings"); addRecommendation(RobotTokenTypes.HEADING, "*** Test Cases ***", "Test Cases"); + addRecommendation(RobotTokenTypes.HEADING, "*** Tasks ***", "Task"); addRecommendation(RobotTokenTypes.HEADING, "*** Keywords ***", "Keywords"); addRecommendation(RobotTokenTypes.HEADING, "*** Variables ***", "Variables"); @@ -54,6 +57,10 @@ public static RobotKeywordProvider getInstance() { KEYWORD_TABLE.addSyntax(RobotTokenTypes.SETTING, "Test Teardown"); KEYWORD_TABLE.addSyntax(RobotTokenTypes.SETTING, "Test Postcondition"); KEYWORD_TABLE.addSyntax(RobotTokenTypes.SETTING, "Test Template"); + KEYWORD_TABLE.addSyntax(RobotTokenTypes.SETTING, "Task Timeout"); + KEYWORD_TABLE.addSyntax(RobotTokenTypes.SETTING, "Task Setup"); + KEYWORD_TABLE.addSyntax(RobotTokenTypes.SETTING, "Task Teardown"); + KEYWORD_TABLE.addSyntax(RobotTokenTypes.SETTING, "Task Template"); KEYWORD_TABLE.addSyntax(RobotTokenTypes.SETTING, "Documentation"); KEYWORD_TABLE.addSyntax(RobotTokenTypes.SETTING, "Metadata"); KEYWORD_TABLE.addSyntax(RobotTokenTypes.SETTING, "Force Tags"); @@ -77,6 +84,10 @@ public static RobotKeywordProvider getInstance() { addRecommendation(RobotTokenTypes.SETTING, "Test Teardown", "Test Teardown"); addRecommendation(RobotTokenTypes.SETTING, "Test Template", "Test Template"); addRecommendation(RobotTokenTypes.SETTING, "Test Timeout", "Test Timeout"); + addRecommendation(RobotTokenTypes.SETTING, "Task Setup", "Task Setup"); + addRecommendation(RobotTokenTypes.SETTING, "Task Teardown", "Task Teardown"); + addRecommendation(RobotTokenTypes.SETTING, "Task Template", "Task Template"); + addRecommendation(RobotTokenTypes.SETTING, "Task Timeout", "Task Timeout"); KEYWORD_TABLE.addSyntax(RobotTokenTypes.BRACKET_SETTING, "[Setup]"); KEYWORD_TABLE.addSyntax(RobotTokenTypes.BRACKET_SETTING, "[Precondition]"); @@ -127,25 +138,32 @@ public static RobotKeywordProvider getInstance() { GLOBAL_SETTINGS.add("Suite Teardown"); GLOBAL_SETTINGS.add("Suite Postcondition"); GLOBAL_SETTINGS.add("Test Setup"); + GLOBAL_SETTINGS.add("Task Setup"); GLOBAL_SETTINGS.add("Test Precondition"); GLOBAL_SETTINGS.add("Test Teardown"); + GLOBAL_SETTINGS.add("Task Teardown"); GLOBAL_SETTINGS.add("Test PostCondition"); GLOBAL_SETTINGS.add("Test Template"); + GLOBAL_SETTINGS.add("Task Template"); GLOBAL_SETTINGS.add("Documentation"); GLOBAL_SETTINGS.add("Metadata"); GLOBAL_SETTINGS.add("Force Tags"); GLOBAL_SETTINGS.add("Default Tags"); GLOBAL_SETTINGS.add("Test Timeout"); + GLOBAL_SETTINGS.add("Task Timeout"); SETTINGS_FOLLOWED_BY_KEYWORDS.add("Suite Setup"); SETTINGS_FOLLOWED_BY_KEYWORDS.add("Suite Precondition"); SETTINGS_FOLLOWED_BY_KEYWORDS.add("Suite Teardown"); SETTINGS_FOLLOWED_BY_KEYWORDS.add("Suite Postcondition"); SETTINGS_FOLLOWED_BY_KEYWORDS.add("Test Setup"); + SETTINGS_FOLLOWED_BY_KEYWORDS.add("Task Setup"); SETTINGS_FOLLOWED_BY_KEYWORDS.add("Test Precondition"); SETTINGS_FOLLOWED_BY_KEYWORDS.add("Test Teardown"); + SETTINGS_FOLLOWED_BY_KEYWORDS.add("Task Teardown"); SETTINGS_FOLLOWED_BY_KEYWORDS.add("Test PostCondition"); SETTINGS_FOLLOWED_BY_KEYWORDS.add("Test Template"); + SETTINGS_FOLLOWED_BY_KEYWORDS.add("Task Template"); SETTINGS_FOLLOWED_BY_KEYWORDS.add("Setup"); SETTINGS_FOLLOWED_BY_KEYWORDS.add("[Setup]"); SETTINGS_FOLLOWED_BY_KEYWORDS.add("Precondition"); @@ -163,6 +181,7 @@ public static RobotKeywordProvider getInstance() { SETTINGS_FOLLOWED_BY_STRINGS.add("Force Tags"); SETTINGS_FOLLOWED_BY_STRINGS.add("Default Tags"); SETTINGS_FOLLOWED_BY_STRINGS.add("Test Timeout"); + SETTINGS_FOLLOWED_BY_STRINGS.add("Task Timeout"); SETTINGS_FOLLOWED_BY_STRINGS.add("Tags"); SETTINGS_FOLLOWED_BY_STRINGS.add("[Tags]"); SETTINGS_FOLLOWED_BY_STRINGS.add("Return"); diff --git a/src/com/millennialmedia/intellibot/psi/RobotLexer.java b/src/com/millennialmedia/intellibot/psi/RobotLexer.java index d6887abe..621ad09a 100644 --- a/src/com/millennialmedia/intellibot/psi/RobotLexer.java +++ b/src/com/millennialmedia/intellibot/psi/RobotLexer.java @@ -42,7 +42,7 @@ private static boolean isSettings(String line) { } private static boolean isTestCases(String line) { - return "*** Test Cases ***".equals(line) || "*** Test Case ***".equals(line); + return line.matches("\\*\\*\\* (Test Cases?|Tasks?) \\*\\*\\*"); } private static boolean isKeywords(String line) { diff --git a/src/com/millennialmedia/intellibot/psi/element/HeadingImpl.java b/src/com/millennialmedia/intellibot/psi/element/HeadingImpl.java index 578a0ab3..c71e537b 100644 --- a/src/com/millennialmedia/intellibot/psi/element/HeadingImpl.java +++ b/src/com/millennialmedia/intellibot/psi/element/HeadingImpl.java @@ -63,7 +63,7 @@ private boolean containsVariables() { public boolean containsTestCases() { // TODO: better OO String text = getPresentableText(); - return text.startsWith("*** Test Case"); + return text.matches("^\\*\\*\\* (Test Case|Task).*"); } @Override