elsa-core
elsa-core copied to clipboard
Input properties should not be visible in Javascript Monaco code complete
Currently all input and output properties of an activity are visible in Javascript Monaco code complete (since DefaultActivityTypeDefinitionRenderer::RenderTypeDeclarationAsync adds them to the TS definition).
For example for SendHTTPRequest activity:
Here only Response and ResponseContent are output activities, all the rest are input.
Since only output properties are registered in Jint engine (ConfigureJavaScriptEngine::AddActivityOutputAsync) having input properties in code complete doesn't make any sense.
So either input properties need to be registered against Jint engine or they need to be removed from code complete. I would personally remove them (since in expressions I seem to use output properties only) but maybe there is a scenario where they would be beneficial. @sfmskywalker what is your view on this, what is the preferred solution?
Originally I wanted to support the ability to read input properties, but that would require evaluating input expressions before evaluating the JS expression. We would have to do this for all properties, even if they aren't accessed, which seems wasteful.
Since no one really needed to access input properties from other activities, I suggest we go with your second suggestion and remove input properties from intellisense.
Fixed in #3249.