File: jsDocInheritDoc.ts

package info (click to toggle)
node-typescript 4.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 396,552 kB
  • sloc: javascript: 1,444,377; makefile: 7; sh: 3
file content (57 lines) | stat: -rw-r--r-- 1,876 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
///<reference path="fourslash.ts" />
// @Filename: inheritDoc.ts
////class Foo {
////    /**
////     * Foo constructor documentation
////     */
////    constructor(value: number) {}
////    /**
////     * Foo#method1 documentation
////     */
////    static method1() {}
////    /**
////     * Foo#method2 documentation
////     */
////    method2() {}
////    /**
////     * Foo#property1 documentation
////     */
////    property1: string;
////}
////interface Baz {
////    /** Baz#property1 documentation */
////    property1: string;
////    /**
////     * Baz#property2 documentation
////     */
////    property2: object;
////}
////class Bar extends Foo implements Baz {
////    ctorValue: number;
////    /** @inheritDoc */
////    constructor(value: number) {
////        super(value);
////        this.ctorValue = value;
////    }
////    /** @inheritDoc */
////    static method1() {}
////    method2() {}
////    /** @inheritDoc */
////    property1: string;
////    /**
////     * Bar#property2
////     * @inheritDoc
////     */
////    property2: object;
////}
////const b = new Bar/*1*/(5);
////b.method2/*2*/();
////Bar.method1/*3*/();
////const p1 = b.property1/*4*/;
////const p2 = b.property2/*5*/;

verify.quickInfoAt("1", "constructor Bar(value: number): Bar", undefined); // constructors aren't actually inherited
verify.quickInfoAt("2", "(method) Bar.method2(): void", "Foo#method2 documentation"); // use inherited docs only
verify.quickInfoAt("3", "(method) Bar.method1(): void", undefined); // statics aren't actually inherited
verify.quickInfoAt("4", "(property) Bar.property1: string", "Foo#property1 documentation"); // use inherited docs only
verify.quickInfoAt("5", "(property) Bar.property2: object", "Baz#property2 documentation\nBar#property2"); // include local and inherited docs