jak-project/common/type_system
Tyler Wilding abf61a94fb
docs: add support for :override-doc in method declarations as well as documenting state handlers (#2139)
Adding support for better child-type method docstrings. This is a
problem unique to methods.

Usually, a child-type will have the same signature and a common name
will apply, but the implementation is different. This means, you
probably want a different docstring to describe what is happening.

Currently this is possible to do via `:replace`. The problem with
replace is two fold:
- a replaced method ends up in the generated `deftype`...because you
usually change the signature!
- we don't put docstrings in the `deftype` in normal GOAL, this is just
something we do for the `all-types` file (they go in the `defmethod`
instead)
- more importantly, this means anytime you now want to change the
parent's name/args/return type -- you have to apply that change
everywhere.

So this is a better design you can now just declare the method like so:
```clj
(:override-doc "my new docstring" <method_id>)
```

And internally a pseudo-replaced method will be added, but it will
inherit everything from the parent (except the docstring of course)

Unrelated - I also made all the keyword args for declaring methods not
depend on ordering

This also adds support for documenting virtual and non-virtual state
handlers. For example:

```clj
  (:states
    (part-tester-idle (:event "test") symbol))
```

or

```clj
(idle () _type_ :state (:event "test") 20)
```

I will probably add the ability to give some sort of over-view docstring
at a later date.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
..
defenum.cpp docs - first chunk of work documenting the files I glossed over (#2130) 2023-01-15 11:33:39 -05:00
defenum.h decomp: add docstring support to relevant places in all-types (#1753) 2022-08-23 00:32:07 -04:00
deftype.cpp docs: add support for :override-doc in method declarations as well as documenting state handlers (#2139) 2023-01-21 20:45:45 -05:00
deftype.h lint: add include sorting config to clang-format (#1517) 2022-06-22 23:37:46 -04:00
state.cpp docs: add support for :override-doc in method declarations as well as documenting state handlers (#2139) 2023-01-21 20:45:45 -05:00
state.h docs: add support for :override-doc in method declarations as well as documenting state handlers (#2139) 2023-01-21 20:45:45 -05:00
Type.cpp docs: add support for :override-doc in method declarations as well as documenting state handlers (#2139) 2023-01-21 20:45:45 -05:00
Type.h docs: add support for :override-doc in method declarations as well as documenting state handlers (#2139) 2023-01-21 20:45:45 -05:00
TypeFieldLookup.cpp logs: replace every fmt::print with a lg call instead (#1368) 2022-10-01 11:58:36 -04:00
TypeSpec.cpp LSP: initial LSP implementation for IR files to assist with decompilation (#1647) 2022-07-18 18:26:57 -04:00
TypeSpec.h [jak 2] texture (#1866) 2022-09-11 14:17:55 -04:00
TypeSystem.cpp docs: add support for :override-doc in method declarations as well as documenting state handlers (#2139) 2023-01-21 20:45:45 -05:00
TypeSystem.h docs: add support for :override-doc in method declarations as well as documenting state handlers (#2139) 2023-01-21 20:45:45 -05:00