Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with calculated property values and calculated static class fields #764

Closed
mcjazzyfunky opened this issue Apr 27, 2018 · 1 comment

Comments

@mcjazzyfunky
Copy link

mcjazzyfunky commented Apr 27, 2018

Bug description (at least I would consider it as a bug):

If you feed TypeDoc with the following TypeScript code then those "someLocalFunction('...')" expressions will be shown in the TypeDoc output. That's surely not intended, is it?
Wouldn't it be better to show the corresponding values only in case they are literals (string literals, number literals, boolean literals) and hide them in case of expressions?

TypeScript source code:

export const SomeObject = {
    a: someLocalFunction('a'),
    b: someLocalFunction('b')
};

export class SomeClass {
    static readonly a: string = someLocalFunction('a')
    static readonly b: string = someLocalFunction('b')
}

function someLocalFunction(arg: string): string {
    return 'CONST_VALUE_' + arg.toUpperCase(); // just for demo purposes
}

TypeDoc output:

[...]
a: string = someLocalFunction('a')
[...]
b: string = someLocalFunction('b')
[...]

Thanks a lot in advance.

(Tested with TypeDoc 0.11.1, TypeScript 2.7.2 on Windows 10)

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 29, 2020

This was intended behavior, but I agree - it wasn't good. 0.20.1 will now render values only if they are determined to be "simple", and otherwise render ... to indicate that there was something there, but was too complex for rendering.

Thanks for the solution for this! It didn't click until I saw this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants