Skip to content

[Feature]: Optional type declarations #54

@steinhh

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

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