Skip to content

[Feature]: Optional type declarations #54

Description

@steinhh

Description

Optional type declarations/assertions could greatly improve code completion features

Why it Matters

Declaring variable types can improve code completion for properties/methods, which could have a big positive impact on user (programmer) experience and producetivity.

Suggested Behavior

I have not "concluded" on the syntax I would like to have, feel free to augment this suggestion

pro test, a, b, c, d
  ; idl-declare b : { my_struct }
  ; idl-declare c : string
  ; idl-declare d : { my_class }
  d = my_func() ; idl-declare {my_struct}  [ an implicit "idl-declare d : { my_struct }" ]

This should then cause code completion features to behave accordingly.

This could also be extended with shorthand for function signatures, e.g.,:

pro test, a, $ ; idl-declare { my_struct }
          b, $ : idl-declare { int }
          c : idl-declare { string }

(Here using my suggested hanging indent formatting, see issue #52)

Alternate Behavior

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions