From 53d4361520ed25a8d2252b41fade22fa6c5e3162 Mon Sep 17 00:00:00 2001 From: Roman Chernyatchik Date: Tue, 22 Oct 2024 17:30:15 +0200 Subject: [PATCH] feat: scattergather directive registered (part of #551) --- .../snakecharm/codeInsight/SnakemakeApi.kt | 4 +++- .../com/jetbrains/snakecharm/lang/SnakemakeNames.kt | 1 + .../features/completion/keywords_completion.feature | 1 + .../unexpected_keyword_args_inspection.feature | 13 +++++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/jetbrains/snakecharm/codeInsight/SnakemakeApi.kt b/src/main/kotlin/com/jetbrains/snakecharm/codeInsight/SnakemakeApi.kt index f8eb75ec..fcef0469 100644 --- a/src/main/kotlin/com/jetbrains/snakecharm/codeInsight/SnakemakeApi.kt +++ b/src/main/kotlin/com/jetbrains/snakecharm/codeInsight/SnakemakeApi.kt @@ -40,6 +40,7 @@ import com.jetbrains.snakecharm.lang.SnakemakeNames.WORKFLOW_PEPFILE_KEYWORD import com.jetbrains.snakecharm.lang.SnakemakeNames.WORKFLOW_PEPSCHEMA_KEYWORD import com.jetbrains.snakecharm.lang.SnakemakeNames.WORKFLOW_REPORT_KEYWORD import com.jetbrains.snakecharm.lang.SnakemakeNames.WORKFLOW_RESOURCE_SCOPES_KEYWORD +import com.jetbrains.snakecharm.lang.SnakemakeNames.WORKFLOW_SCATTERGATHER_KEYWORD import com.jetbrains.snakecharm.lang.SnakemakeNames.WORKFLOW_SINGULARITY_KEYWORD import com.jetbrains.snakecharm.lang.SnakemakeNames.WORKFLOW_WILDCARD_CONSTRAINTS_KEYWORD import com.jetbrains.snakecharm.lang.SnakemakeNames.WORKFLOW_WORKDIR_KEYWORD @@ -106,7 +107,8 @@ object SnakemakeApi { WORKFLOW_CONTAINERIZED_KEYWORD, WORKFLOW_PEPSCHEMA_KEYWORD, WORKFLOW_PEPFILE_KEYWORD, - WORKFLOW_RESOURCE_SCOPES_KEYWORD + WORKFLOW_RESOURCE_SCOPES_KEYWORD, + WORKFLOW_SCATTERGATHER_KEYWORD ) /** diff --git a/src/main/kotlin/com/jetbrains/snakecharm/lang/SnakemakeNames.kt b/src/main/kotlin/com/jetbrains/snakecharm/lang/SnakemakeNames.kt index a4c80a7c..5a1df926 100644 --- a/src/main/kotlin/com/jetbrains/snakecharm/lang/SnakemakeNames.kt +++ b/src/main/kotlin/com/jetbrains/snakecharm/lang/SnakemakeNames.kt @@ -27,6 +27,7 @@ object SnakemakeNames { const val WORKFLOW_CONTAINER_KEYWORD = "container" const val WORKFLOW_CONTAINERIZED_KEYWORD = "containerized" // => 6.0.0 const val WORKFLOW_RESOURCE_SCOPES_KEYWORD = "resource_scopes" // => 7.11 + const val WORKFLOW_SCATTERGATHER_KEYWORD = "scattergather" // => 7.11 const val SUBWORKFLOW_KEYWORD = "subworkflow" const val SUBWORKFLOW_WORKDIR_KEYWORD = WORKFLOW_WORKDIR_KEYWORD diff --git a/src/test/resources/features/completion/keywords_completion.feature b/src/test/resources/features/completion/keywords_completion.feature index d01218f9..b2aa39fd 100644 --- a/src/test/resources/features/completion/keywords_completion.feature +++ b/src/test/resources/features/completion/keywords_completion.feature @@ -18,6 +18,7 @@ Feature: Completion for snakemake keyword-like things | include | | workdir | | wildcard_constraints | + | scattergather | | onsuccess | | onstart | | onerror | diff --git a/src/test/resources/features/highlighting/inspections/unexpected_keyword_args_inspection.feature b/src/test/resources/features/highlighting/inspections/unexpected_keyword_args_inspection.feature index fcc9b46e..de552bca 100644 --- a/src/test/resources/features/highlighting/inspections/unexpected_keyword_args_inspection.feature +++ b/src/test/resources/features/highlighting/inspections/unexpected_keyword_args_inspection.feature @@ -73,6 +73,19 @@ Feature: Inspection for unexpected keyword arguments in section | section_name | | container | + Scenario Outline: Expected keyword arguments on top-level in latest language level + Given a snakemake project + Given I open a file "foo.smk" with text + """ + : a="foo.bar" + """ + And SmkSectionUnexpectedKeywordArgsInspection inspection is enabled + Then I expect no inspection errors + When I check highlighting errors + Examples: + | section_name | + | scattergather | + Scenario Outline: No warn on expected keyword arguments in subsections when API settings allow Given a snakemake project And snakemake framework api yaml descriptor is