From bc77c63a23074068caa1a6fa68666b0b9055a91b Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Tue, 23 Jan 2024 23:13:25 +0100 Subject: [PATCH] WIP: Non-functional messing around --- package.json | 13 +++++++++++-- syntaxes/bash-injection.json | 24 ++++++++++++++++++++++++ syntaxes/nextflow.tmLanguage.json | 4 ++-- 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 syntaxes/bash-injection.json diff --git a/package.json b/package.json index 0e9b7dc9..6d33a6d1 100644 --- a/package.json +++ b/package.json @@ -48,10 +48,19 @@ "language": "nextflow-config", "scopeName": "source.nextflow-config", "path": "./syntaxes/nextflow-config.tmLanguage.json" - }, + }, { "scopeName": "source.nextflow-groovy", "path": "./syntaxes/groovy.tmLanguage.json" + }, + { + "path": "./syntaxes/bash-injection.json", + "scopeName": "nextflow-bash.injection", + "injectTo": ["source.nextflow"], + "embeddedLanguages": { + "source.bash": "bash", + "meta.embedded.block.bash": "bash" + } }], "snippets": [ { @@ -60,4 +69,4 @@ } ] } -} \ No newline at end of file +} diff --git a/syntaxes/bash-injection.json b/syntaxes/bash-injection.json new file mode 100644 index 00000000..40b42e5b --- /dev/null +++ b/syntaxes/bash-injection.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "Nextflow Injection", + "scopeName": "nextflow-bash.injection", + "injectionSelector": "L:source.nextflow", + "patterns": [ + { + "begin": "(\"\"\")", + "end": "(\"\"\")", + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "end": "^\\s*}}}\\s*$", + "contentName": "meta.embedded.block.bash", + "patterns": [ + { + "include": "source.bash" + } + ] + } + ] + } + ] +} diff --git a/syntaxes/nextflow.tmLanguage.json b/syntaxes/nextflow.tmLanguage.json index 2e671a25..dc0905aa 100644 --- a/syntaxes/nextflow.tmLanguage.json +++ b/syntaxes/nextflow.tmLanguage.json @@ -141,7 +141,7 @@ "end": "}", "patterns": [{ "include": "#workflow-body" - }] + }] }, "workflow-body": { "patterns": [ @@ -244,4 +244,4 @@ ] } } -} \ No newline at end of file +}