tremor-rs / tremor-runtime

Main Tremor Project Rust Codebase
https://www.tremor.rs
Apache License 2.0
858 stars 125 forks source link

Doc standard for tremor function params and return types #378

Open anupdhml opened 4 years ago

anupdhml commented 4 years ago

Describe the problem you are trying to solve

The stdlib function docs roughly include information on the function params as well as the return type but that is not amenable to structured processing needed for tasks like generating params/type info as part of function doc completions in tremor-language-server.

Adding a structured way to encode these info would also improve the consistency of the auto-generated function docs.

Describe the solution you'd like

Should entail enhancement of the tremor-script’s existing FnDoc struct.

Also see if we can get rid of the older doc structs in the codebase (meant to house the parse result of earlier markdown based docs and currently needed for showing trickle’s aggregate function docs via tremor-language-server).

And any doc standard that we come up with, we should also document so that tremor’s end users can also utilize it in their own functions/modules. Tooling like tremor-language-server can then take advantage of it.

Licenser commented 4 years ago

We should be careful with this, adding types to functions means making tremor-script somewhat type aware. That is going to need a good plan to make sure we do not block off future possibilities for type checking, asymmetric types, custom types and so on.