Skip to content

Commit

Permalink
Make inferred param readonly in node template
Browse files Browse the repository at this point in the history
  • Loading branch information
nipunayf committed Mar 5, 2025
1 parent b1e5abb commit fe5d6b1
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void setConcreteTemplateData(TemplateContext context) {
setParameterProperties(functionData);

if (CommonUtils.hasReturn(functionData.returnType())) {
setReturnTypeProperties(functionData, context, functionData.inferredReturnType(), Property.VARIABLE_NAME);
setReturnTypeProperties(functionData, context, Property.VARIABLE_NAME);
}

if (functionData.returnError()) {
Expand Down Expand Up @@ -171,10 +171,9 @@ protected void setParameterProperties(FunctionData function) {
}
}

protected void setReturnTypeProperties(FunctionData functionData, TemplateContext context, boolean editable,
String label) {
protected void setReturnTypeProperties(FunctionData functionData, TemplateContext context, String label) {
properties()
.type(functionData.returnType(), editable, functionData.importStatements())
.type(functionData.returnType(), false, functionData.importStatements())
.data(functionData.returnType(), context.getAllVisibleSymbolNames(), label);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void setConcreteTemplateData(TemplateContext context) {
setParameterProperties(functionData);

if (CommonUtils.hasReturn(functionData.returnType())) {
setReturnTypeProperties(functionData, context, false, CONNECTION_NAME_LABEL);
setReturnTypeProperties(functionData, context, CONNECTION_NAME_LABEL);
}

properties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void setConcreteTemplateData(TemplateContext context) {

String returnTypeName = functionData.returnType();
if (CommonUtils.hasReturn(returnTypeName)) {
setReturnTypeProperties(functionData, context, functionData.inferredReturnType(), Property.VARIABLE_NAME);
setReturnTypeProperties(functionData, context, Property.VARIABLE_NAME);
}

if (functionData.returnError()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"value": "t",
"placeholder": "var",
"optional": false,
"editable": true,
"editable": false,
"advanced": false,
"codedata": {}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"value": "targetType",
"placeholder": "var",
"optional": false,
"editable": true,
"editable": false,
"advanced": false,
"codedata": {}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"value": "targetType",
"placeholder": "var",
"optional": false,
"editable": true,
"editable": false,
"advanced": false,
"codedata": {}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"value": "stream<rowType, sql:Error?>",
"placeholder": "var",
"optional": false,
"editable": true,
"editable": false,
"advanced": false,
"codedata": {
"importStatements": "ballerina/sql"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"value": "returnType",
"placeholder": "var",
"optional": false,
"editable": true,
"editable": false,
"advanced": false,
"codedata": {
"importStatements": "ballerina/sql"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"value": "stream<rowType, sql:Error?>",
"placeholder": "var",
"optional": false,
"editable": true,
"editable": false,
"advanced": false,
"codedata": {
"importStatements": "ballerina/sql"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"value": "targetType",
"placeholder": "var",
"optional": false,
"editable": true,
"editable": false,
"advanced": false,
"codedata": {}
},
Expand Down

0 comments on commit fe5d6b1

Please sign in to comment.