Skip to content

Try to instrumentalize tsserver to extract evaluated types #5

@phryneas

Description

@phryneas

So, essentially we need a new plugin that parses codeblocks like this:

```ts documentation
import { createSlice } from "@reduxjs/toolkit";
import { A } from "ts-toolbelt";

type Id<T> = { [K in keyof T]: T[K] } & {};

declare function withParams<T extends (...args: any[]) => unknown>(fn: T, cb?: (params: Parameters<T>) => void): void;
declare function getParams<T extends (...args: any[]) => unknown>(fn: T): Parameters<T>;
declare function compute<T>(t: T): A.Compute<T, "deep">;
declare function id<T>(t: T): Id<T>;
declare function quickinfo(target: any): void;

withParams(createSlice, ([sliceOptions]) => quickinfo(sliceOptions));

const sliceOptions = id(getParams(createSlice)[0]);
quickinfo(sliceOptions.extraReducers);

```

and displays everything wrapped in quickinfo as nice markdown instead of that codeblock

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions