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
# typed: trueclassOuterclassInnerclassNestedclassNamespaceclassDivisionclassMine < T::EnumenumsdoFirst=newSecond=newThird=newFourth=newendendendendendendendclassToplevelextendT::Sigsig{params(e: Outer::Inner::Nested::Namespace::Division::Mine).void}deffunc(e)endendToplevel.new.func()# ^ completion should know that we take enums and autocomplete enum values# or at the very least the enum class itself
Observed output
Sorbet will only complete Outer, and then you have to laboriously complete all. the. nested. namespaces.
Expected behavior
Sorbet ought to be smart enough to know that we're completing a method parameter that is an enum, and therefore can only take enum values, and therefore should offer a better list of completions.
Bonus points if it modifies the completions to insert the shortest possible path for the enum value.
The text was updated successfully, but these errors were encountered:
As a prerequisite to this change, we should probably start by building completion for keyword argument names. See #5436.
No completions in Sorbet right now use the enclosing method call context to alter the list of completion suggestions. Adding that functionality is probably easiest to isolate in the context of keyword arguments (where the enclosing method's definition has the full list of keyword parameters in its method symbol definition).
Input
→ View on sorbet.run
Observed output
Sorbet will only complete
Outer
, and then you have to laboriously complete all. the. nested. namespaces.Expected behavior
Sorbet ought to be smart enough to know that we're completing a method parameter that is an enum, and therefore can only take enum values, and therefore should offer a better list of completions.
Bonus points if it modifies the completions to insert the shortest possible path for the enum value.
The text was updated successfully, but these errors were encountered: