You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/vscode.md
+57-33Lines changed: 57 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -230,38 +230,6 @@ if (aligner == 'bowtie2') {
230
230
}
231
231
```
232
232
233
-
**Slashy dollar strings**
234
-
235
-
Groovy supports a wide variety of strings, including multi-line strings, dynamic strings, slashy strings, multi-line dynamic slashy strings, and more.
236
-
237
-
The Nextflow language specification supports single- and double-quoted strings, multi-line strings, and slashy strings. Dynamic slashy strings are not supported:
238
-
239
-
```groovy
240
-
def logo = /--cl-config 'custom_logo: "${multiqc_logo}"'/
241
-
```
242
-
243
-
Use a double-quoted string instead:
244
-
245
-
```nextflow
246
-
def logo = "--cl-config 'custom_logo: \"${multiqc_logo}\"'"
247
-
```
248
-
249
-
Slashy dollar strings are not supported:
250
-
251
-
```groovy
252
-
$/
253
-
echo "Hello world!"
254
-
/$
255
-
```
256
-
257
-
Use a multi-line string instead:
258
-
259
-
```nextflow
260
-
"""
261
-
echo "Hello world!"
262
-
"""
263
-
```
264
-
265
233
**Implicit environment variables**
266
234
267
235
In Nextflow DSL1 and DSL2, you can reference environment variables directly in strings:
@@ -334,6 +302,62 @@ To ease the migration of existing scripts, the language server only reports warn
334
302
Type annotations and static type checking will be addressed in a future version of the Nextflow language specification.
335
303
:::
336
304
305
+
**Strings**
306
+
307
+
Groovy supports a wide variety of strings, including multi-line strings, dynamic strings, slashy strings, multi-line dynamic slashy strings, and more.
308
+
309
+
The Nextflow language specification supports single- and double-quoted strings, multi-line strings, and slashy strings.
310
+
311
+
Slashy strings cannot be interpolated:
312
+
313
+
```nextflow
314
+
def id = 'SRA001'
315
+
assert 'SRA001.fastq' ~= /${id}\.f(?:ast)?q/
316
+
```
317
+
318
+
Use a double-quoted string instead:
319
+
320
+
```nextflow
321
+
def id = 'SRA001'
322
+
assert 'SRA001.fastq' ~= "${id}\\.f(?:ast)?q"
323
+
```
324
+
325
+
Slashy strings cannot span multiple lines:
326
+
327
+
```groovy
328
+
/
329
+
Patterns in the code,
330
+
Symbols dance to match and find,
331
+
Logic unconfined.
332
+
/
333
+
```
334
+
335
+
Use a multi-line string instead:
336
+
337
+
```nextflow
338
+
"""
339
+
Patterns in the code,
340
+
Symbols dance to match and find,
341
+
Logic unconfined.
342
+
"""
343
+
```
344
+
345
+
Dollar slashy strings are not supported:
346
+
347
+
```groovy
348
+
$/
349
+
echo "Hello world!"
350
+
/$
351
+
```
352
+
353
+
Use a multi-line string instead:
354
+
355
+
```nextflow
356
+
"""
357
+
echo "Hello world!"
358
+
"""
359
+
```
360
+
337
361
**Process env inputs/outputs**
338
362
339
363
In Nextflow DSL1 and DSL2, the name of a process `env` input/output can be specified with or without quotes:
@@ -481,7 +505,7 @@ includeConfig ({
481
505
return 'large.config'
482
506
else
483
507
return '/dev/null'
484
-
})()
508
+
}())
485
509
```
486
510
487
511
The include source is a closure that is immediately invoked. It includes a different config file based on the return value of the closure. Including `/dev/null` is equivalent to including nothing.
0 commit comments