[Feature Request]: show defaulted parts of types in CLS type hints #25048
Labels
area: Python bindings
For things related to chapel-py, chpl-language-server, chplcheck, etc.
area: Tools
type: Feature Request
Summary of Feature
Description:
CLS currently provides type hints when a user has not fully specified the type for a variable (using Chapel's type inference)
This feature also works well with generics.
One improvement to this would be to support generics with defaults, by showing the default.
Take the following code, where we assume the definition of
R
is far away fromvar a
. The user has been explicit about the type, but perhaps they don't know the other type defaults forR
.We could have inlays to show what the defaults are, for example (the comments represent inlays)
In this case, the types constructors don't even need to exist, but this provides users more information to reason about their code and generics, without needing to invoke
chpl
or leave the editor.This feature should probably be controlled by a flag, separate from the existing
--type-inlays
.The text was updated successfully, but these errors were encountered: