elsa-core icon indicating copy to clipboard operation
elsa-core copied to clipboard

Input properties should not be visible in Javascript Monaco code complete

Open tomy2105 opened this issue 3 years ago • 1 comments

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: AutoComplete 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?

tomy2105 avatar Aug 10 '22 09:08 tomy2105

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.

sfmskywalker avatar Aug 10 '22 10:08 sfmskywalker

Fixed in #3249.

tomy2105 avatar Aug 29 '22 12:08 tomy2105