Skip to content

Commit e8f9fc8

Browse files
committed
Fix stageAs method signature in process converter
1 parent b3db41d commit e8f9fc8

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/main/java/nextflow/lsp/services/script/ProcessConverter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ private Parameter typedInput(MethodCallExpression call, List<Statement> stagers)
143143
var param = param(call, type);
144144
if( param == null )
145145
param = nextParam(type);
146-
var stageName = stageName(call);
147-
if( stageName != null ) {
148-
var stageValue = varX(param.getName());
149-
var stager = stmt(callThisX("stageAs", args(stageName, stageValue)));
146+
var stageTarget = stageName(call);
147+
if( stageTarget != null ) {
148+
var stageSource = varX(param.getName());
149+
var stager = stmt(callThisX("stageAs", args(stageSource, stageTarget)));
150150
stagers.add(stager);
151151
}
152152
return param;

src/test/groovy/nextflow/lsp/services/script/ConvertScriptStaticTypesTest.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ class ConvertScriptStaticTypesTest extends Specification {
120120
where:
121121
INPUT | TYPED_INPUT | STAGE
122122
'path fastq' | 'fastq: Path' | null
123-
"path 'file.txt'" | '$in1: Path' | "stageAs 'file.txt', \$in1"
124-
"path fastq, stageAs: 'file.txt'" | 'fastq: Path' | "stageAs 'file.txt', fastq"
123+
"path 'file.txt'" | '$in1: Path' | "stageAs \$in1, 'file.txt'"
124+
"path fastq, stageAs: 'file.txt'" | 'fastq: Path' | "stageAs fastq, 'file.txt'"
125125
"path fastq, arity: '1'" | 'fastq: Path' | null
126126
"path fastq, arity: '0..*'" | 'fastq: Set<Path>' | null
127127
"path fastq, arity: '2'" | 'fastq: Set<Path>' | null
@@ -153,7 +153,7 @@ class ConvertScriptStaticTypesTest extends Specification {
153153
where:
154154
INPUT | TYPED_INPUT | STAGE
155155
'tuple val(id), path(fastq)' | '(id, fastq): Tuple<?, Path>' | null
156-
"tuple val(id), path('file.txt')" | '(id, $in1): Tuple<?, Path>' | "stageAs 'file.txt', \$in1"
156+
"tuple val(id), path('file.txt')" | '(id, $in1): Tuple<?, Path>' | "stageAs \$in1, 'file.txt'"
157157
}
158158

159159
def 'should convert each inputs as val or path' () {
@@ -163,7 +163,7 @@ class ConvertScriptStaticTypesTest extends Specification {
163163
expect:
164164
checkInputs(service, 'each method', 'method')
165165
checkInputs(service, 'each path(index)', 'index: Path')
166-
checkInputs(service, "each path('file.txt')", '$in1: Path', "stageAs 'file.txt', \$in1")
166+
checkInputs(service, "each path('file.txt')", '$in1: Path', "stageAs \$in1, 'file.txt'")
167167
}
168168

169169
def 'should convert val outputs' () {

0 commit comments

Comments
 (0)