Skip to content

JSON docs should export more information #753

@NyakoFox

Description

@NyakoFox

For documentation exporting, it'd be best if more information got exported.

For example, function params are exported well, being an array with the name, the type, and the description.

However, sometimes the type can be complex, like instead of Sprite, you have Sprite?. If it ended there, it'd be easy enough to parse, but a real format for that would be better. (ex. maybe an "optional" boolean field?) And then when generics come in, it gets a lot more difficult to parse yourself. The language server has all of this information, it just needs to export it in a format that is represented in JSON, rather than a string that'd require more parsing than necessary.

The main problem I'm running into right now is that, despite function params & returns being exported well, overloads have none of this.

"overloads": [
  "fun(x: number, y: number) -> self",
  "fun(x: number, y: number, sprites: Sprite) -> self",
  "fun(x: number, y: number, w: number, h: number) -> self"
],

With overloads, you're missing the format entirely, and you have to somehow parse all of this yourself, which is far more work than what should be required.

(For context, I'm trying to use JSON exports to create automatic online documentation for a project. My specific use-case shouldn't matter though, as anyone using JSON will most likely run into the same problem...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions