diff --git a/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotPreferences.java b/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotPreferences.java index c85685e715..fce9587945 100644 --- a/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotPreferences.java +++ b/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotPreferences.java @@ -25,6 +25,7 @@ class RobotState { public String robotPythonEnv = ""; public String robotVariables = ""; public String robotLoadVariablesFromArgumentsFile = ""; + public String robotLoadVariablesFromVariablesFile = ""; public String robotPythonpath = ""; public String robotLibrariesLibdocNeedsArgs = ""; public String robotLibrariesLibdocPreGenerate = ""; @@ -60,6 +61,7 @@ class RobotState { public String robotTimeoutCodeFormatting = ""; public String robotTimeoutCollectDocsTimeout = ""; public String robotTimeoutListTestsTimeout = ""; + public String robotTestViewEnabled = ""; } // IMPORTANT: Autogenerated. Don't change manually. Run codegen.py to regenerate. @@ -74,6 +76,7 @@ public class RobotPreferences implements PersistentStateComponent { public static final String ROBOT_PYTHON_ENV = "robot.python.env"; public static final String ROBOT_VARIABLES = "robot.variables"; public static final String ROBOT_LOAD_VARIABLES_FROM_ARGUMENTS_FILE = "robot.loadVariablesFromArgumentsFile"; + public static final String ROBOT_LOAD_VARIABLES_FROM_VARIABLES_FILE = "robot.loadVariablesFromVariablesFile"; public static final String ROBOT_PYTHONPATH = "robot.pythonpath"; public static final String ROBOT_LIBRARIES_LIBDOC_NEEDS_ARGS = "robot.libraries.libdoc.needsArgs"; public static final String ROBOT_LIBRARIES_LIBDOC_PRE_GENERATE = "robot.libraries.libdoc.preGenerate"; @@ -109,6 +112,7 @@ public class RobotPreferences implements PersistentStateComponent { public static final String ROBOT_TIMEOUT_CODE_FORMATTING = "robot.timeout.codeFormatting"; public static final String ROBOT_TIMEOUT_COLLECT_DOCS_TIMEOUT = "robot.timeout.collectDocsTimeout"; public static final String ROBOT_TIMEOUT_LIST_TESTS_TIMEOUT = "robot.timeout.listTestsTimeout"; + public static final String ROBOT_TEST_VIEW_ENABLED = "robot.testView.enabled"; private static final Logger LOG = Logger.getInstance(RobotPreferences.class); @@ -125,6 +129,7 @@ public RobotState getState() { robotState.robotPythonEnv = getRobotPythonEnv(); robotState.robotVariables = getRobotVariables(); robotState.robotLoadVariablesFromArgumentsFile = getRobotLoadVariablesFromArgumentsFile(); + robotState.robotLoadVariablesFromVariablesFile = getRobotLoadVariablesFromVariablesFile(); robotState.robotPythonpath = getRobotPythonpath(); robotState.robotLibrariesLibdocNeedsArgs = getRobotLibrariesLibdocNeedsArgs(); robotState.robotLibrariesLibdocPreGenerate = getRobotLibrariesLibdocPreGenerate(); @@ -160,6 +165,7 @@ public RobotState getState() { robotState.robotTimeoutCodeFormatting = getRobotTimeoutCodeFormatting(); robotState.robotTimeoutCollectDocsTimeout = getRobotTimeoutCollectDocsTimeout(); robotState.robotTimeoutListTestsTimeout = getRobotTimeoutListTestsTimeout(); + robotState.robotTestViewEnabled = getRobotTestViewEnabled(); return robotState; } @@ -174,6 +180,7 @@ public void loadState(@NotNull RobotState robotState) { setRobotPythonEnv(robotState.robotPythonEnv); setRobotVariables(robotState.robotVariables); setRobotLoadVariablesFromArgumentsFile(robotState.robotLoadVariablesFromArgumentsFile); + setRobotLoadVariablesFromVariablesFile(robotState.robotLoadVariablesFromVariablesFile); setRobotPythonpath(robotState.robotPythonpath); setRobotLibrariesLibdocNeedsArgs(robotState.robotLibrariesLibdocNeedsArgs); setRobotLibrariesLibdocPreGenerate(robotState.robotLibrariesLibdocPreGenerate); @@ -209,6 +216,7 @@ public void loadState(@NotNull RobotState robotState) { setRobotTimeoutCodeFormatting(robotState.robotTimeoutCodeFormatting); setRobotTimeoutCollectDocsTimeout(robotState.robotTimeoutCollectDocsTimeout); setRobotTimeoutListTestsTimeout(robotState.robotTimeoutListTestsTimeout); + setRobotTestViewEnabled(robotState.robotTestViewEnabled); } // IMPORTANT: Autogenerated. Don't change manually. Run codegen.py to regenerate. @@ -278,6 +286,15 @@ public JsonObject asJsonObject() { } } + if(!robotLoadVariablesFromVariablesFile.isEmpty()){ + + try { + jsonObject.add(ROBOT_LOAD_VARIABLES_FROM_VARIABLES_FILE, new JsonPrimitive(robotLoadVariablesFromVariablesFile)); + } catch(Exception e) { + LOG.error(e); + } + } + if(!robotPythonpath.isEmpty()){ Gson g = new Gson(); try { @@ -593,6 +610,15 @@ public JsonObject asJsonObject() { } } + if(!robotTestViewEnabled.isEmpty()){ + + try { + jsonObject.add(ROBOT_TEST_VIEW_ENABLED, new JsonPrimitive(Boolean.parseBoolean(robotTestViewEnabled))); + } catch(Exception e) { + LOG.error(e); + } + } + return jsonObject; } @@ -926,6 +952,53 @@ public void setRobotLoadVariablesFromArgumentsFile(String s) { } } + private String robotLoadVariablesFromVariablesFile = ""; + + public @NotNull String getRobotLoadVariablesFromVariablesFile() { + return robotLoadVariablesFromVariablesFile; + } + + public @Nullable JsonPrimitive getRobotLoadVariablesFromVariablesFileAsJson() { + if(robotLoadVariablesFromVariablesFile.isEmpty()){ + return null; + } + + return new JsonPrimitive(robotLoadVariablesFromVariablesFile); + } + + public @NotNull String validateRobotLoadVariablesFromVariablesFile(String robotLoadVariablesFromVariablesFile) { + if(robotLoadVariablesFromVariablesFile.isEmpty()) { + return ""; + } + try { + + new JsonPrimitive(robotLoadVariablesFromVariablesFile); + + return ""; + + } catch(Exception e) { + return e.toString(); + } + } + + public void setRobotLoadVariablesFromVariablesFile(String s) { + if (s == null) { + s = ""; + } + if (s.equals(robotLoadVariablesFromVariablesFile)) { + return; + } + String old = robotLoadVariablesFromVariablesFile; + robotLoadVariablesFromVariablesFile = s; + for (LanguageServerDefinition.IPreferencesListener listener : listeners) { + try { + listener.onChanged(ROBOT_LOAD_VARIABLES_FROM_VARIABLES_FILE, old, s); + } catch (CancelledException e) { + // just ignore at this point + } + } + } + private String robotPythonpath = ""; public @NotNull String getRobotPythonpath() { @@ -2604,6 +2677,53 @@ public void setRobotTimeoutListTestsTimeout(String s) { } } + private String robotTestViewEnabled = ""; + + public @NotNull String getRobotTestViewEnabled() { + return robotTestViewEnabled; + } + + public @Nullable JsonPrimitive getRobotTestViewEnabledAsJson() { + if(robotTestViewEnabled.isEmpty()){ + return null; + } + + return new JsonPrimitive(Boolean.parseBoolean(robotTestViewEnabled)); + } + + public @NotNull String validateRobotTestViewEnabled(String robotTestViewEnabled) { + if(robotTestViewEnabled.isEmpty()) { + return ""; + } + try { + + new JsonPrimitive(Boolean.parseBoolean(robotTestViewEnabled)); + + return ""; + + } catch(Exception e) { + return e.toString(); + } + } + + public void setRobotTestViewEnabled(String s) { + if (s == null) { + s = ""; + } + if (s.equals(robotTestViewEnabled)) { + return; + } + String old = robotTestViewEnabled; + robotTestViewEnabled = s; + for (LanguageServerDefinition.IPreferencesListener listener : listeners) { + try { + listener.onChanged(ROBOT_TEST_VIEW_ENABLED, old, s); + } catch (CancelledException e) { + // just ignore at this point + } + } + } + private Collection listeners = new CopyOnWriteArraySet<>(); diff --git a/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotPreferencesPage.java b/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotPreferencesPage.java index 32a7730cf8..a2e1e4f34e 100644 --- a/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotPreferencesPage.java +++ b/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotPreferencesPage.java @@ -27,6 +27,7 @@ class RobotPreferencesComponent { private final JBTextField robotPythonEnv = new JBTextField(); private final JBTextField robotVariables = new JBTextField(); private final JBTextField robotLoadVariablesFromArgumentsFile = new JBTextField(); + private final JBTextField robotLoadVariablesFromVariablesFile = new JBTextField(); private final JBTextField robotPythonpath = new JBTextField(); private final JBTextField robotLibrariesLibdocNeedsArgs = new JBTextField(); private final JBTextField robotLibrariesLibdocPreGenerate = new JBTextField(); @@ -62,6 +63,7 @@ class RobotPreferencesComponent { private final JBTextField robotTimeoutCodeFormatting = new JBTextField(); private final JBTextField robotTimeoutCollectDocsTimeout = new JBTextField(); private final JBTextField robotTimeoutListTestsTimeout = new JBTextField(); + private final JBTextField robotTestViewEnabled = new JBTextField(); public RobotPreferencesComponent() { panel = FormBuilder.createFormBuilder() @@ -79,6 +81,8 @@ public RobotPreferencesComponent() { .addComponent(createJTextArea("Custom variables passed to RobotFramework\n(used when resolving variables and automatically passed to the launch config as --variable entries).\n(i.e.: {\"EXECDIR\": \"c:/my/proj/src\"})\nNote: expected format: JSON Object\n")) .addLabeledComponent(new JBLabel("Load Variables From Arguments File"), robotLoadVariablesFromArgumentsFile, 1, false) .addComponent(createJTextArea("Load variables for code-completion and code-analysis based on an arguments file. Multiple files\naccepted by separating with a comma.\n")) + .addLabeledComponent(new JBLabel("Load Variables From Variables File"), robotLoadVariablesFromVariablesFile, 1, false) + .addComponent(createJTextArea("Load variables for code-completion and code-analysis based on an variables file. Multiple files\naccepted by separating with a comma.\n")) .addLabeledComponent(new JBLabel("Pythonpath"), robotPythonpath, 1, false) .addComponent(createJTextArea("Entries to be added to the PYTHONPATH\n(used when resolving resources and imports and automatically passed to the launch config as\n--pythonpath entries).\n(i.e.: [\"c:/my/pro/src\"])\nNote: expected format: JSON Array\n")) .addLabeledComponent(new JBLabel("Libraries Libdoc Needs Args"), robotLibrariesLibdocNeedsArgs, 1, false) @@ -149,6 +153,8 @@ public RobotPreferencesComponent() { .addComponent(createJTextArea("This is the timeout used for collecting documentation to show in the ROBOT DOCUMENTATION view. Set\nto 0 to disable it.\n")) .addLabeledComponent(new JBLabel("Timeout List Tests Timeout"), robotTimeoutListTestsTimeout, 1, false) .addComponent(createJTextArea("This is the timeout used for listing the tests from a robot file. Set to 0 to disable it.\n")) + .addLabeledComponent(new JBLabel("Test View Enabled"), robotTestViewEnabled, 1, false) + .addComponent(createJTextArea("Whether to show robot tests in the test view. You may want to disable this if you are using another\ntest runner\n(eg. https://github.com/DetachHead/pytest-robotframework)\nNote: expected 'true' or 'false'\n")) .addComponentFillVertically(new JPanel(), 0) .getPanel(); @@ -236,6 +242,15 @@ public void setRobotLoadVariablesFromArgumentsFile (@NotNull String newText) { robotLoadVariablesFromArgumentsFile.setText(newText); } + @NotNull + public String getRobotLoadVariablesFromVariablesFile() { + return robotLoadVariablesFromVariablesFile.getText(); + } + + public void setRobotLoadVariablesFromVariablesFile (@NotNull String newText) { + robotLoadVariablesFromVariablesFile.setText(newText); + } + @NotNull public String getRobotPythonpath() { return robotPythonpath.getText(); @@ -551,6 +566,15 @@ public void setRobotTimeoutListTestsTimeout (@NotNull String newText) { robotTimeoutListTestsTimeout.setText(newText); } + @NotNull + public String getRobotTestViewEnabled() { + return robotTestViewEnabled.getText(); + } + + public void setRobotTestViewEnabled (@NotNull String newText) { + robotTestViewEnabled.setText(newText); + } + } @@ -612,6 +636,10 @@ public boolean isModified() { return true; } + if(!settings.getRobotLoadVariablesFromVariablesFile().equals(component.getRobotLoadVariablesFromVariablesFile())){ + return true; + } + if(!settings.getRobotPythonpath().equals(component.getRobotPythonpath())){ return true; } @@ -752,6 +780,10 @@ public boolean isModified() { return true; } + if(!settings.getRobotTestViewEnabled().equals(component.getRobotTestViewEnabled())){ + return true; + } + return false; } @@ -771,6 +803,7 @@ public void reset() { component.setRobotPythonEnv(settings.getRobotPythonEnv()); component.setRobotVariables(settings.getRobotVariables()); component.setRobotLoadVariablesFromArgumentsFile(settings.getRobotLoadVariablesFromArgumentsFile()); + component.setRobotLoadVariablesFromVariablesFile(settings.getRobotLoadVariablesFromVariablesFile()); component.setRobotPythonpath(settings.getRobotPythonpath()); component.setRobotLibrariesLibdocNeedsArgs(settings.getRobotLibrariesLibdocNeedsArgs()); component.setRobotLibrariesLibdocPreGenerate(settings.getRobotLibrariesLibdocPreGenerate()); @@ -806,6 +839,7 @@ public void reset() { component.setRobotTimeoutCodeFormatting(settings.getRobotTimeoutCodeFormatting()); component.setRobotTimeoutCollectDocsTimeout(settings.getRobotTimeoutCollectDocsTimeout()); component.setRobotTimeoutListTestsTimeout(settings.getRobotTimeoutListTestsTimeout()); + component.setRobotTestViewEnabled(settings.getRobotTestViewEnabled()); } @Override @@ -846,6 +880,10 @@ public void apply() throws ConfigurationException { if(!s.isEmpty()) { throw new ConfigurationException("Error in Load Variables From Arguments File:\n" + s); } + s = settings.validateRobotLoadVariablesFromVariablesFile(component.getRobotLoadVariablesFromVariablesFile()); + if(!s.isEmpty()) { + throw new ConfigurationException("Error in Load Variables From Variables File:\n" + s); + } s = settings.validateRobotPythonpath(component.getRobotPythonpath()); if(!s.isEmpty()) { throw new ConfigurationException("Error in Pythonpath:\n" + s); @@ -986,6 +1024,10 @@ public void apply() throws ConfigurationException { if(!s.isEmpty()) { throw new ConfigurationException("Error in Timeout List Tests Timeout:\n" + s); } + s = settings.validateRobotTestViewEnabled(component.getRobotTestViewEnabled()); + if(!s.isEmpty()) { + throw new ConfigurationException("Error in Test View Enabled:\n" + s); + } settings.setRobotLanguageServerPython(component.getRobotLanguageServerPython()); settings.setRobotLanguageServerArgs(component.getRobotLanguageServerArgs()); @@ -994,6 +1036,7 @@ public void apply() throws ConfigurationException { settings.setRobotPythonEnv(component.getRobotPythonEnv()); settings.setRobotVariables(component.getRobotVariables()); settings.setRobotLoadVariablesFromArgumentsFile(component.getRobotLoadVariablesFromArgumentsFile()); + settings.setRobotLoadVariablesFromVariablesFile(component.getRobotLoadVariablesFromVariablesFile()); settings.setRobotPythonpath(component.getRobotPythonpath()); settings.setRobotLibrariesLibdocNeedsArgs(component.getRobotLibrariesLibdocNeedsArgs()); settings.setRobotLibrariesLibdocPreGenerate(component.getRobotLibrariesLibdocPreGenerate()); @@ -1029,5 +1072,6 @@ public void apply() throws ConfigurationException { settings.setRobotTimeoutCodeFormatting(component.getRobotTimeoutCodeFormatting()); settings.setRobotTimeoutCollectDocsTimeout(component.getRobotTimeoutCollectDocsTimeout()); settings.setRobotTimeoutListTestsTimeout(component.getRobotTimeoutListTestsTimeout()); + settings.setRobotTestViewEnabled(component.getRobotTestViewEnabled()); } } \ No newline at end of file diff --git a/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotProjectPreferences.java b/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotProjectPreferences.java index 25ecaf2a30..bd8d4847b0 100644 --- a/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotProjectPreferences.java +++ b/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotProjectPreferences.java @@ -25,6 +25,7 @@ class RobotProjectState { public String robotPythonEnv = ""; public String robotVariables = ""; public String robotLoadVariablesFromArgumentsFile = ""; + public String robotLoadVariablesFromVariablesFile = ""; public String robotPythonpath = ""; public String robotLibrariesLibdocNeedsArgs = ""; public String robotLibrariesLibdocPreGenerate = ""; @@ -60,6 +61,7 @@ class RobotProjectState { public String robotTimeoutCodeFormatting = ""; public String robotTimeoutCollectDocsTimeout = ""; public String robotTimeoutListTestsTimeout = ""; + public String robotTestViewEnabled = ""; } // IMPORTANT: Autogenerated. Don't change manually. Run codegen.py to regenerate. @@ -74,6 +76,7 @@ public class RobotProjectPreferences implements PersistentStateComponent listeners = new CopyOnWriteArraySet<>(); diff --git a/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotProjectPreferencesPage.java b/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotProjectPreferencesPage.java index d05ef368a9..e679ef0011 100644 --- a/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotProjectPreferencesPage.java +++ b/robotframework-intellij/src/main/java/robocorp/robot/intellij/RobotProjectPreferencesPage.java @@ -27,6 +27,7 @@ class RobotProjectPreferencesComponent { private final JBTextField robotPythonEnv = new JBTextField(); private final JBTextField robotVariables = new JBTextField(); private final JBTextField robotLoadVariablesFromArgumentsFile = new JBTextField(); + private final JBTextField robotLoadVariablesFromVariablesFile = new JBTextField(); private final JBTextField robotPythonpath = new JBTextField(); private final JBTextField robotLibrariesLibdocNeedsArgs = new JBTextField(); private final JBTextField robotLibrariesLibdocPreGenerate = new JBTextField(); @@ -62,6 +63,7 @@ class RobotProjectPreferencesComponent { private final JBTextField robotTimeoutCodeFormatting = new JBTextField(); private final JBTextField robotTimeoutCollectDocsTimeout = new JBTextField(); private final JBTextField robotTimeoutListTestsTimeout = new JBTextField(); + private final JBTextField robotTestViewEnabled = new JBTextField(); public RobotProjectPreferencesComponent() { panel = FormBuilder.createFormBuilder() @@ -79,6 +81,8 @@ public RobotProjectPreferencesComponent() { .addComponent(createJTextArea("Custom variables passed to RobotFramework\n(used when resolving variables and automatically passed to the launch config as --variable entries).\n(i.e.: {\"EXECDIR\": \"c:/my/proj/src\"})\nNote: expected format: JSON Object\n")) .addLabeledComponent(new JBLabel("Load Variables From Arguments File"), robotLoadVariablesFromArgumentsFile, 1, false) .addComponent(createJTextArea("Load variables for code-completion and code-analysis based on an arguments file. Multiple files\naccepted by separating with a comma.\n")) + .addLabeledComponent(new JBLabel("Load Variables From Variables File"), robotLoadVariablesFromVariablesFile, 1, false) + .addComponent(createJTextArea("Load variables for code-completion and code-analysis based on an variables file. Multiple files\naccepted by separating with a comma.\n")) .addLabeledComponent(new JBLabel("Pythonpath"), robotPythonpath, 1, false) .addComponent(createJTextArea("Entries to be added to the PYTHONPATH\n(used when resolving resources and imports and automatically passed to the launch config as\n--pythonpath entries).\n(i.e.: [\"c:/my/pro/src\"])\nNote: expected format: JSON Array\n")) .addLabeledComponent(new JBLabel("Libraries Libdoc Needs Args"), robotLibrariesLibdocNeedsArgs, 1, false) @@ -149,6 +153,8 @@ public RobotProjectPreferencesComponent() { .addComponent(createJTextArea("This is the timeout used for collecting documentation to show in the ROBOT DOCUMENTATION view. Set\nto 0 to disable it.\n")) .addLabeledComponent(new JBLabel("Timeout List Tests Timeout"), robotTimeoutListTestsTimeout, 1, false) .addComponent(createJTextArea("This is the timeout used for listing the tests from a robot file. Set to 0 to disable it.\n")) + .addLabeledComponent(new JBLabel("Test View Enabled"), robotTestViewEnabled, 1, false) + .addComponent(createJTextArea("Whether to show robot tests in the test view. You may want to disable this if you are using another\ntest runner\n(eg. https://github.com/DetachHead/pytest-robotframework)\nNote: expected 'true' or 'false'\n")) .addComponentFillVertically(new JPanel(), 0) .getPanel(); @@ -236,6 +242,15 @@ public void setRobotLoadVariablesFromArgumentsFile (@NotNull String newText) { robotLoadVariablesFromArgumentsFile.setText(newText); } + @NotNull + public String getRobotLoadVariablesFromVariablesFile() { + return robotLoadVariablesFromVariablesFile.getText(); + } + + public void setRobotLoadVariablesFromVariablesFile (@NotNull String newText) { + robotLoadVariablesFromVariablesFile.setText(newText); + } + @NotNull public String getRobotPythonpath() { return robotPythonpath.getText(); @@ -551,6 +566,15 @@ public void setRobotTimeoutListTestsTimeout (@NotNull String newText) { robotTimeoutListTestsTimeout.setText(newText); } + @NotNull + public String getRobotTestViewEnabled() { + return robotTestViewEnabled.getText(); + } + + public void setRobotTestViewEnabled (@NotNull String newText) { + robotTestViewEnabled.setText(newText); + } + } @@ -621,6 +645,10 @@ public boolean isModified() { return true; } + if(!settings.getRobotLoadVariablesFromVariablesFile().equals(component.getRobotLoadVariablesFromVariablesFile())){ + return true; + } + if(!settings.getRobotPythonpath().equals(component.getRobotPythonpath())){ return true; } @@ -761,6 +789,10 @@ public boolean isModified() { return true; } + if(!settings.getRobotTestViewEnabled().equals(component.getRobotTestViewEnabled())){ + return true; + } + return false; } @@ -780,6 +812,7 @@ public void reset() { component.setRobotPythonEnv(settings.getRobotPythonEnv()); component.setRobotVariables(settings.getRobotVariables()); component.setRobotLoadVariablesFromArgumentsFile(settings.getRobotLoadVariablesFromArgumentsFile()); + component.setRobotLoadVariablesFromVariablesFile(settings.getRobotLoadVariablesFromVariablesFile()); component.setRobotPythonpath(settings.getRobotPythonpath()); component.setRobotLibrariesLibdocNeedsArgs(settings.getRobotLibrariesLibdocNeedsArgs()); component.setRobotLibrariesLibdocPreGenerate(settings.getRobotLibrariesLibdocPreGenerate()); @@ -815,6 +848,7 @@ public void reset() { component.setRobotTimeoutCodeFormatting(settings.getRobotTimeoutCodeFormatting()); component.setRobotTimeoutCollectDocsTimeout(settings.getRobotTimeoutCollectDocsTimeout()); component.setRobotTimeoutListTestsTimeout(settings.getRobotTimeoutListTestsTimeout()); + component.setRobotTestViewEnabled(settings.getRobotTestViewEnabled()); } @Override @@ -855,6 +889,10 @@ public void apply() throws ConfigurationException { if(!s.isEmpty()) { throw new ConfigurationException("Error in Load Variables From Arguments File:\n" + s); } + s = settings.validateRobotLoadVariablesFromVariablesFile(component.getRobotLoadVariablesFromVariablesFile()); + if(!s.isEmpty()) { + throw new ConfigurationException("Error in Load Variables From Variables File:\n" + s); + } s = settings.validateRobotPythonpath(component.getRobotPythonpath()); if(!s.isEmpty()) { throw new ConfigurationException("Error in Pythonpath:\n" + s); @@ -995,6 +1033,10 @@ public void apply() throws ConfigurationException { if(!s.isEmpty()) { throw new ConfigurationException("Error in Timeout List Tests Timeout:\n" + s); } + s = settings.validateRobotTestViewEnabled(component.getRobotTestViewEnabled()); + if(!s.isEmpty()) { + throw new ConfigurationException("Error in Test View Enabled:\n" + s); + } settings.setRobotLanguageServerPython(component.getRobotLanguageServerPython()); settings.setRobotLanguageServerArgs(component.getRobotLanguageServerArgs()); @@ -1003,6 +1045,7 @@ public void apply() throws ConfigurationException { settings.setRobotPythonEnv(component.getRobotPythonEnv()); settings.setRobotVariables(component.getRobotVariables()); settings.setRobotLoadVariablesFromArgumentsFile(component.getRobotLoadVariablesFromArgumentsFile()); + settings.setRobotLoadVariablesFromVariablesFile(component.getRobotLoadVariablesFromVariablesFile()); settings.setRobotPythonpath(component.getRobotPythonpath()); settings.setRobotLibrariesLibdocNeedsArgs(component.getRobotLibrariesLibdocNeedsArgs()); settings.setRobotLibrariesLibdocPreGenerate(component.getRobotLibrariesLibdocPreGenerate()); @@ -1038,5 +1081,6 @@ public void apply() throws ConfigurationException { settings.setRobotTimeoutCodeFormatting(component.getRobotTimeoutCodeFormatting()); settings.setRobotTimeoutCollectDocsTimeout(component.getRobotTimeoutCollectDocsTimeout()); settings.setRobotTimeoutListTestsTimeout(component.getRobotTimeoutListTestsTimeout()); + settings.setRobotTestViewEnabled(component.getRobotTestViewEnabled()); } } \ No newline at end of file diff --git a/robotframework-interactive/src/robotframework_interactive/server/rf_interpreter_generated_lsp_constants.py b/robotframework-interactive/src/robotframework_interactive/server/rf_interpreter_generated_lsp_constants.py index 8c0aa65bfb..90a0544418 100644 --- a/robotframework-interactive/src/robotframework_interactive/server/rf_interpreter_generated_lsp_constants.py +++ b/robotframework-interactive/src/robotframework_interactive/server/rf_interpreter_generated_lsp_constants.py @@ -8,6 +8,7 @@ OPTION_ROBOT_PYTHON_ENV = "robot.python.env" OPTION_ROBOT_VARIABLES = "robot.variables" OPTION_ROBOT_LOAD_VARIABLES_FROM_ARGUMENTS_FILE = "robot.loadVariablesFromArgumentsFile" +OPTION_ROBOT_LOAD_VARIABLES_FROM_VARIABLES_FILE = "robot.loadVariablesFromVariablesFile" OPTION_ROBOT_PYTHONPATH = "robot.pythonpath" OPTION_ROBOT_LIBRARIES_LIBDOC_NEEDS_ARGS = "robot.libraries.libdoc.needsArgs" OPTION_ROBOT_LIBRARIES_LIBDOC_PRE_GENERATE = "robot.libraries.libdoc.preGenerate" @@ -51,6 +52,7 @@ OPTION_ROBOT_TIMEOUT_CODE_FORMATTING = "robot.timeout.codeFormatting" OPTION_ROBOT_TIMEOUT_COLLECT_DOCS_TIMEOUT = "robot.timeout.collectDocsTimeout" OPTION_ROBOT_TIMEOUT_LIST_TESTS_TIMEOUT = "robot.timeout.listTestsTimeout" +OPTION_ROBOT_TEST_VIEW_ENABLED = "robot.testView.enabled" ALL_ROBOT_OPTIONS = frozenset( ( @@ -61,6 +63,7 @@ OPTION_ROBOT_PYTHON_ENV, OPTION_ROBOT_VARIABLES, OPTION_ROBOT_LOAD_VARIABLES_FROM_ARGUMENTS_FILE, + OPTION_ROBOT_LOAD_VARIABLES_FROM_VARIABLES_FILE, OPTION_ROBOT_PYTHONPATH, OPTION_ROBOT_LIBRARIES_LIBDOC_NEEDS_ARGS, OPTION_ROBOT_LIBRARIES_LIBDOC_PRE_GENERATE, @@ -104,6 +107,7 @@ OPTION_ROBOT_TIMEOUT_CODE_FORMATTING, OPTION_ROBOT_TIMEOUT_COLLECT_DOCS_TIMEOUT, OPTION_ROBOT_TIMEOUT_LIST_TESTS_TIMEOUT, + OPTION_ROBOT_TEST_VIEW_ENABLED, ) ) diff --git a/robotframework-ls/codegen/codegen_package.py b/robotframework-ls/codegen/codegen_package.py index ca8a7f8bc0..f2fbfd5f79 100644 --- a/robotframework-ls/codegen/codegen_package.py +++ b/robotframework-ls/codegen/codegen_package.py @@ -288,18 +288,18 @@ def get_json_contents(): "prettier-fix": "npx prettier -w vscode-client/**/*.ts", }, "dependencies": { - "path-exists": "^4.0.0", - "vscode-languageclient": "^8.0.1", "jsonc-parser": "^2.0.3", "marked": "^4.1.0", + "path-exists": "^4.0.0", + "vscode-languageclient": "^8.0.1", }, "devDependencies": { "@types/mocha": "^2.2.32", "@types/node": "^13.0.00", "@types/vscode": "1.65.0", "prettier": "2.4.1", - "vscode-test": "1.5.1", "typescript": "^4.5.4", + "vscode-test": "1.5.1", }, "engines": {"vscode": f"^1.65.0"}, } diff --git a/robotframework-ls/package.json b/robotframework-ls/package.json index 495d54256e..fa01e44e8c 100644 --- a/robotframework-ls/package.json +++ b/robotframework-ls/package.json @@ -441,7 +441,7 @@ "default": "", "description": "Load variables for code-completion and code-analysis based on an arguments file. Multiple files accepted by separating with a comma." }, - "robot.loadVariablesFromVariablesFile": { + "robot.loadVariablesFromVariablesFile": { "type": "string", "default": "", "description": "Load variables for code-completion and code-analysis based on an variables file. Multiple files accepted by separating with a comma." @@ -905,4 +905,4 @@ "engines": { "vscode": "^1.65.0" } -} +} \ No newline at end of file diff --git a/robotframework-ls/src/robotframework_ls/impl/robot_generated_lsp_constants.py b/robotframework-ls/src/robotframework_ls/impl/robot_generated_lsp_constants.py index f685b1ceb1..90a0544418 100644 --- a/robotframework-ls/src/robotframework_ls/impl/robot_generated_lsp_constants.py +++ b/robotframework-ls/src/robotframework_ls/impl/robot_generated_lsp_constants.py @@ -52,6 +52,7 @@ OPTION_ROBOT_TIMEOUT_CODE_FORMATTING = "robot.timeout.codeFormatting" OPTION_ROBOT_TIMEOUT_COLLECT_DOCS_TIMEOUT = "robot.timeout.collectDocsTimeout" OPTION_ROBOT_TIMEOUT_LIST_TESTS_TIMEOUT = "robot.timeout.listTestsTimeout" +OPTION_ROBOT_TEST_VIEW_ENABLED = "robot.testView.enabled" ALL_ROBOT_OPTIONS = frozenset( ( @@ -106,6 +107,7 @@ OPTION_ROBOT_TIMEOUT_CODE_FORMATTING, OPTION_ROBOT_TIMEOUT_COLLECT_DOCS_TIMEOUT, OPTION_ROBOT_TIMEOUT_LIST_TESTS_TIMEOUT, + OPTION_ROBOT_TEST_VIEW_ENABLED, ) )