microsoft / tsdoc

A doc comment standard for TypeScript
https://tsdoc.org/
MIT License
4.74k stars 131 forks source link

Properties with a `protected` modifier are omitted #230

Closed arnog closed 4 years ago

arnog commented 4 years ago

The JSON output of tsdoc on this code fragment:

declare  class C {
 protected p: string;
}

does not include a flag indicating that the property p is protected, in fact, the property p is omitted altogether:

{
    "id": 0,
    "name": "toplevel",
    "kind": 0,
    "flags": {},
    "originalName": "",
    "children": [
        {
            "id": 1,
            "name": "\"module.d\"",
            "kind": 1,
            "kindString": "Module",
            "flags": {
                "isExported": true
            },
            "children": [
                {
                    "id": 2,
                    "name": "C",
                    "kind": 128,
                    "kindString": "Class",
                    "flags": {
                        "isExported": true
                    }
                }
            ],
            "groups": [
                {
                    "title": "Classes",
                    "kind": 128,
                    "children": [
                        2
                    ]
                }
            ]
        }
    ],
    "groups": [
        {
            "title": "Modules",
            "kind": 1,
            "children": [
                1
            ]
        }
    ]
}
Gerrit0 commented 4 years ago

This looks like TypeDoc output - You'll probably want to file an issue in https://github.com/TypeStrong/typedoc instead.

You are probably running with --excludeProtected, which will omit these properties when converting.

arnog commented 4 years ago

Yes, you're right. My bad, I did have --excludeProtected on. And sorry for filing it in the wrong place, I am indeed using typedoc.