You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For objects, indexes are expressions that must evaluate to a string. For arrays, indexes are expressions that must evaluate to an integer. I think it is safe to assume that a developer would only issue "jump to definition" on a simple index expression. For example, the identifier in target.identifier, the 'string' in target['string'], or the integer in target[integer]. However, the target itself could be an expression as the contrived example (if true then x else y).index.
Those expressions would need to be evaluated and so would all fields and elements of all objects and arrays that may be the definition of the index at point.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
For objects, indexes are expressions that must evaluate to a string. For arrays, indexes are expressions that must evaluate to an integer. I think it is safe to assume that a developer would only issue "jump to definition" on a simple index expression. For example, the
identifier
intarget.identifier
, the'string'
intarget['string']
, or theinteger
intarget[integer]
. However, the target itself could be an expression as the contrived example(if true then x else y).index
.Those expressions would need to be evaluated and so would all fields and elements of all objects and arrays that may be the definition of the index at point.
Maybe the solution would involve jumping based upon the concrete values in https://github.com/google/go-jsonnet/blob/master/value.go?
Beta Was this translation helpful? Give feedback.
All reactions