Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public FormBuilder<T> data(Node node, String label, String doc, String templateN
public FormBuilder<T> data(String typeSignature, Set<String> names, String label) {
String varName = typeSignature.contains(RemoteActionCallBuilder.TARGET_TYPE_KEY)
? NameUtil.generateTypeName("var", names)
: NameUtil.generateVariableName(typeSignature, names);
: NameUtil.generateTypeName(NameUtil.toCamelCase(typeSignature), names);
propertyBuilder
.metadata()
.label(label)
Expand All @@ -146,7 +146,7 @@ public FormBuilder<T> data(String typeSignature, Set<String> names, String label
public FormBuilder<T> data(String typeSignature, Set<String> names, String label, String doc) {
String varName = typeSignature.contains(RemoteActionCallBuilder.TARGET_TYPE_KEY)
? NameUtil.generateTypeName("var", names)
: NameUtil.generateVariableName(typeSignature, names);
: NameUtil.generateTypeName(NameUtil.toCamelCase(typeSignature), names);
propertyBuilder
.metadata()
.label(label)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,5 +319,19 @@ public Set<String> getAllVisibleSymbolNames() {
return new HashSet<>();
}
}

public Set<String> getAllModuleSymbolNames() {
try {
workspaceManager.loadProject(filePath);
SemanticModel semanticModel =
workspaceManager.semanticModel(filePath).orElseThrow();
return semanticModel.moduleSymbols().parallelStream()
.filter(s -> s.getName().isPresent())
.map(s -> s.getName().get())
.collect(Collectors.toSet());
} catch (Throwable e) {
return new HashSet<>();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,15 @@ public void setConcreteTemplateData(TemplateContext context) {
.checkError(true, CHECK_ERROR_DOC, false);
}

@Override
protected void setReturnTypeProperties(FunctionData functionData, TemplateContext context, String label, String doc,
boolean hidden) {
properties()
.type(functionData.returnType(), false, functionData.importStatements(), hidden,
Property.RESULT_TYPE_LABEL)
.data(functionData.returnType(), context.getAllModuleSymbolNames(), label, doc);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have two concerns regarding this:

  1. If we create a connection locally, then locally declared connections are not accounted for.
  2. Whatever you’re doing here should also be applied to other module-level artifacts, such as model providers.

}

protected void setParameterProperties(FunctionData function) {
boolean hasOnlyRestParams = function.parameters().size() == 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"selected": true
}
],
"value": "jsonResult",
"value": "json1",
"optional": false,
"editable": true,
"advanced": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
"selected": true
}
],
"value": "stringResult",
"value": "string1",
"optional": false,
"editable": true,
"advanced": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"selected": true
}
],
"value": "intResult",
"value": "int1",
"optional": false,
"editable": true,
"advanced": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
"selected": true
}
],
"value": "stringResult",
"value": "string1",
"optional": false,
"editable": true,
"advanced": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"selected": true
}
],
"value": "stringResult",
"value": "string1",
"optional": false,
"editable": true,
"advanced": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"selected": true
}
],
"value": "stringResult",
"value": "string1",
"optional": false,
"editable": true,
"advanced": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"selected": true
}
],
"value": "intResult",
"value": "int1",
"optional": false,
"editable": true,
"advanced": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"selected": true
}
],
"value": "stringResult",
"value": "string1",
"optional": false,
"editable": true,
"advanced": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@
"selected": true
}
],
"value": "httpClientOut",
"value": "httpClient1",
"optional": false,
"editable": true,
"advanced": false,
Expand Down
Loading
Loading