Closed jpwilliams closed 3 weeks ago
Latest commit: c4e5ff2275261c6cbf9e0f11bf4ec32f6fd83915
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Summary
Calculating object paths for typing is computationally expensive. We use this technique for
step.waitForEvent()
'smatch
option and some parts of function configuration, such ascancelOn
.Depending on the sheer size of some events, these comparisons can generate tens of thousands of valid strings, resulting in a lot of recursion and processing by the language server. In unlucky cases, the compiler appears to hang indefinitely as it recurses, taking an unreasonable amount of time to hit the built-in depth of 1,000.
This change ensures we never try to go as deep, limiting our recursion to
8
. This means that, when validating thematch
property, we will find and allow......but not...
Use of the latter can still be specified using the
if
property:Note that these changes only address one facet of the complexity of calculating the object paths here; sheer volume of events can still overwhelm the compiler. In the future, we will remove this field and typing in favour of CEL expressions with better DX.
Checklist
Added a docs PR that references this PRN/A