-
Notifications
You must be signed in to change notification settings - Fork 28
Add definitions and references for constructors #250
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b64af4a
WIP - hacking on adding constructor symbols
olafurpg fbc2707
Handle constructors properly
SuperAuguste c60d510
Address reviews, consolidate code
SuperAuguste caa792d
Format code
SuperAuguste b238c58
Fix constructorless classes
SuperAuguste c597163
Fix yarn issues, mention yarn version
SuperAuguste File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| namespace Yay { | ||
| export class SuperConstructor { | ||
| constructor(public readonly property: number) {} | ||
| } | ||
|
|
||
| export namespace Woo { | ||
| export class MyClass { | ||
| constructor() {} | ||
| } | ||
| } | ||
| } | ||
|
|
||
| export class SuperConstructor2 { | ||
| constructor(public readonly property: number) {} | ||
| } | ||
|
|
||
| export function useConstructor(): Yay.SuperConstructor { | ||
| return new Yay.SuperConstructor(10) | ||
| } | ||
|
|
||
| export function useConstructor2(): SuperConstructor2 { | ||
| return new SuperConstructor2(10) | ||
| } | ||
|
|
||
| export function useConstructor3(): Yay.Woo.MyClass { | ||
| return new Yay.Woo.MyClass() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,12 @@ | ||
| import { a } from '@example/a' | ||
| // definition @example/b 1.0.0 src/`b.ts`/ | ||
| //documentation ```ts\nmodule "b.ts"\n``` | ||
| // ^ reference @example/a 1.0.0 src/`a.ts`/a(). | ||
| // ^^^^^^^^^^^^ reference @example/a 1.0.0 src/`a.ts`/ | ||
| // ^ reference local 0 | ||
|
|
||
| export function b() { | ||
| // ^ definition @example/b 1.0.0 src/`b.ts`/b(). | ||
| // documentation ```ts\nfunction b(): string\n``` | ||
| // documentation ```ts\nfunction b(): any\n``` | ||
| return a() | ||
| // ^ reference @example/a 1.0.0 src/`a.ts`/a(). | ||
| // ^ reference local 0 | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| namespace Yay { | ||
| // definition syntax 1.0.0 src/`constructor.ts`/ | ||
| //documentation ```ts\nmodule "constructor.ts"\n``` | ||
| // ^^^ definition syntax 1.0.0 src/`constructor.ts`/Yay/ | ||
| // documentation ```ts\nYay: typeof Yay\n``` | ||
| export class SuperConstructor { | ||
| // ^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/Yay/SuperConstructor# | ||
| // documentation ```ts\nclass SuperConstructor\n``` | ||
| constructor(public readonly property: number) {} | ||
| // ^^^^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/Yay/SuperConstructor#`<constructor>`(). | ||
| // documentation ```ts\nconstructor(property: number): SuperConstructor\n``` | ||
| // ^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/Yay/SuperConstructor#`<constructor>`().(property) | ||
| // documentation ```ts\n(property) property: number\n``` | ||
| } | ||
|
|
||
| export namespace Woo { | ||
| // ^^^ definition syntax 1.0.0 src/`constructor.ts`/Yay/Woo/ | ||
| // documentation ```ts\nWoo: typeof Woo\n``` | ||
| export class MyClass { | ||
| // ^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/Yay/Woo/MyClass# | ||
| // documentation ```ts\nclass MyClass\n``` | ||
| constructor() {} | ||
| // ^^^^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/Yay/Woo/MyClass#`<constructor>`(). | ||
| // documentation ```ts\nconstructor(): MyClass\n``` | ||
| } | ||
| } | ||
| } | ||
|
|
||
| export class SuperConstructor2 { | ||
| // ^^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/SuperConstructor2# | ||
| // documentation ```ts\nclass SuperConstructor2\n``` | ||
| constructor(public readonly property: number) {} | ||
| // ^^^^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/SuperConstructor2#`<constructor>`(). | ||
| // documentation ```ts\nconstructor(property: number): SuperConstructor2\n``` | ||
| // ^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/SuperConstructor2#`<constructor>`().(property) | ||
| // documentation ```ts\n(property) property: number\n``` | ||
| } | ||
|
|
||
| export function useConstructor(): Yay.SuperConstructor { | ||
| // ^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/useConstructor(). | ||
| // documentation ```ts\nfunction useConstructor(): SuperConstructor\n``` | ||
| // ^^^ reference syntax 1.0.0 src/`constructor.ts`/Yay/ | ||
| // ^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`constructor.ts`/Yay/SuperConstructor# | ||
| return new Yay.SuperConstructor(10) | ||
| // ^^^ reference syntax 1.0.0 src/`constructor.ts`/Yay/ | ||
| // ^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`constructor.ts`/Yay/SuperConstructor#`<constructor>`(). | ||
| } | ||
|
|
||
| export function useConstructor2(): SuperConstructor2 { | ||
| // ^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/useConstructor2(). | ||
| // documentation ```ts\nfunction useConstructor2(): SuperConstructor2\n``` | ||
| // ^^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`constructor.ts`/SuperConstructor2# | ||
| return new SuperConstructor2(10) | ||
| // ^^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`constructor.ts`/SuperConstructor2#`<constructor>`(). | ||
| } | ||
|
|
||
| export function useConstructor3(): Yay.Woo.MyClass { | ||
| // ^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/useConstructor3(). | ||
| // documentation ```ts\nfunction useConstructor3(): MyClass\n``` | ||
| // ^^^ reference syntax 1.0.0 src/`constructor.ts`/Yay/ | ||
| // ^^^ reference syntax 1.0.0 src/`constructor.ts`/Yay/Woo/ | ||
| // ^^^^^^^ reference syntax 1.0.0 src/`constructor.ts`/Yay/Woo/MyClass# | ||
| return new Yay.Woo.MyClass() | ||
| // ^^^ reference syntax 1.0.0 src/`constructor.ts`/Yay/ | ||
| // ^^^ reference syntax 1.0.0 src/`constructor.ts`/Yay/Woo/ | ||
| // ^^^^^^^ reference syntax 1.0.0 src/`constructor.ts`/Yay/Woo/MyClass#`<constructor>`(). | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,130 @@ | ||
| # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
| # yarn lockfile v1 | ||
| # This file is generated by running "yarn install" inside your project. | ||
| # Manual changes might be lost - proceed with caution! | ||
|
|
||
| __metadata: | ||
| version: 6 | ||
| cacheKey: 8 | ||
|
|
||
| "@sourcegraph/[email protected]": | ||
| version "4.0.1" | ||
| resolved "https://registry.yarnpkg.com/@sourcegraph/tsconfig/-/tsconfig-4.0.1.tgz#5965ec41771d2ac5b23b6e0d919cee3e70485840" | ||
| integrity sha512-G/xsejsR84G5dj3kHJ7svKBo9E5tWl96rUHKP94Y2UDtA7BzUhAYbieM+b9ZUpIRt66h3+MlYbG5HK4UI2zDzw== | ||
| "@example/a@workspace:input/multi-project/packages/a": | ||
| version: 0.0.0-use.local | ||
| resolution: "@example/a@workspace:input/multi-project/packages/a" | ||
| languageName: unknown | ||
| linkType: soft | ||
|
|
||
| "@types/prop-types@*": | ||
| version "15.7.4" | ||
| resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11" | ||
| integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== | ||
| "@example/b@workspace:input/multi-project/packages/b": | ||
| version: 0.0.0-use.local | ||
| resolution: "@example/b@workspace:input/multi-project/packages/b" | ||
| languageName: unknown | ||
| linkType: soft | ||
|
|
||
| "@types/[email protected]": | ||
| version "17.0.52" | ||
| resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.52.tgz#10d8b907b5c563ac014a541f289ae8eaa9bf2e9b" | ||
| integrity sha512-vwk8QqVODi0VaZZpDXQCmEmiOuyjEFPY7Ttaw5vjM112LOq37yz1CDJGrRJwA1fYEq4Iitd5rnjd1yWAc/bT+A== | ||
| "@sourcegraph/tsconfig@npm:4.0.1": | ||
| version: 4.0.1 | ||
| resolution: "@sourcegraph/tsconfig@npm:4.0.1" | ||
| checksum: cd552b47dcf27b59e944dee20ff29e8f96b77c956bc96c7db44910217fb1c978ff410add86c92ff242274f91484b59b27be4980aea25c77fd922b3c5e31f5d05 | ||
| languageName: node | ||
| linkType: hard | ||
|
|
||
| "@types/prop-types@npm:*": | ||
| version: 15.7.4 | ||
| resolution: "@types/prop-types@npm:15.7.4" | ||
| checksum: ef6e1899e59b876c273811b1bd845022fc66d5a3d11cb38a25b6c566b30514ae38fe20a40f67622f362a4f4f7f9224e22d8da101cff3d6e97e11d7b4c307cfc1 | ||
| languageName: node | ||
| linkType: hard | ||
|
|
||
| "@types/react@npm:17.0.52": | ||
| version: 17.0.52 | ||
| resolution: "@types/react@npm:17.0.52" | ||
| dependencies: | ||
| "@types/prop-types": "*" | ||
| "@types/scheduler": "*" | ||
| csstype: ^3.0.2 | ||
| checksum: a51b98dd87838d161278fdf9dd78e6a4ff8c018f406d6647f77963e144fb52a8beee40c89fd0e7e840eaeaa8bd9fe2f34519410540b1a52d43a6f8b4d2fbce33 | ||
| languageName: node | ||
| linkType: hard | ||
|
|
||
| "@types/scheduler@npm:*": | ||
| version: 0.16.2 | ||
| resolution: "@types/scheduler@npm:0.16.2" | ||
| checksum: b6b4dcfeae6deba2e06a70941860fb1435730576d3689225a421280b7742318d1548b3d22c1f66ab68e414f346a9542f29240bc955b6332c5b11e561077583bc | ||
| languageName: node | ||
| linkType: hard | ||
|
|
||
| "csstype@npm:^3.0.2": | ||
| version: 3.0.11 | ||
| resolution: "csstype@npm:3.0.11" | ||
| checksum: 95e56abfe9ca219ae065acb4e43f61771a03170eed919127f558dfa168240867aba7629c8d98a201a0dd06d9a5ce82686f0570031c928516c61816adbc7c877f | ||
| languageName: node | ||
| linkType: hard | ||
|
|
||
| "invalid-package-json@workspace:input/invalid-package-json": | ||
| version: 0.0.0-use.local | ||
| resolution: "invalid-package-json@workspace:input/invalid-package-json" | ||
| languageName: unknown | ||
| linkType: soft | ||
|
|
||
| "js-tokens@npm:^3.0.0 || ^4.0.0": | ||
| version: 4.0.0 | ||
| resolution: "js-tokens@npm:4.0.0" | ||
| checksum: 8a95213a5a77deb6cbe94d86340e8d9ace2b93bc367790b260101d2f36a2eaf4e4e22d9fa9cf459b38af3a32fb4190e638024cf82ec95ef708680e405ea7cc78 | ||
| languageName: node | ||
| linkType: hard | ||
|
|
||
| "loose-envify@npm:^1.1.0": | ||
| version: 1.4.0 | ||
| resolution: "loose-envify@npm:1.4.0" | ||
| dependencies: | ||
| "@types/prop-types" "*" | ||
| "@types/scheduler" "*" | ||
| csstype "^3.0.2" | ||
|
|
||
| "@types/scheduler@*": | ||
| version "0.16.2" | ||
| resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" | ||
| integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== | ||
|
|
||
| csstype@^3.0.2: | ||
| version "3.0.11" | ||
| resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.11.tgz#d66700c5eacfac1940deb4e3ee5642792d85cd33" | ||
| integrity sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw== | ||
|
|
||
| "js-tokens@^3.0.0 || ^4.0.0": | ||
| version "4.0.0" | ||
| resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" | ||
| integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== | ||
|
|
||
| loose-envify@^1.1.0: | ||
| version "1.4.0" | ||
| resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" | ||
| integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== | ||
| js-tokens: ^3.0.0 || ^4.0.0 | ||
| bin: | ||
| loose-envify: cli.js | ||
| checksum: 6517e24e0cad87ec9888f500c5b5947032cdfe6ef65e1c1936a0c48a524b81e65542c9c3edc91c97d5bddc806ee2a985dbc79be89215d613b1de5db6d1cfe6f4 | ||
| languageName: node | ||
| linkType: hard | ||
|
|
||
| "multi-project@workspace:input/multi-project": | ||
| version: 0.0.0-use.local | ||
| resolution: "multi-project@workspace:input/multi-project" | ||
| languageName: unknown | ||
| linkType: soft | ||
|
|
||
| "pnpm-workspaces@workspace:input/pnpm-workspaces": | ||
| version: 0.0.0-use.local | ||
| resolution: "pnpm-workspaces@workspace:input/pnpm-workspaces" | ||
| languageName: unknown | ||
| linkType: soft | ||
|
|
||
| "pure-js@workspace:input/pure-js": | ||
| version: 0.0.0-use.local | ||
| resolution: "pure-js@workspace:input/pure-js" | ||
| languageName: unknown | ||
| linkType: soft | ||
|
|
||
| "react-example@workspace:input/react": | ||
| version: 0.0.0-use.local | ||
| resolution: "react-example@workspace:input/react" | ||
| languageName: unknown | ||
| linkType: soft | ||
|
|
||
| "react@npm:18.0.0": | ||
| version: 18.0.0 | ||
| resolution: "react@npm:18.0.0" | ||
| dependencies: | ||
| js-tokens "^3.0.0 || ^4.0.0" | ||
| loose-envify: ^1.1.0 | ||
| checksum: 293020b96536b3c7113ee57ca5c990a3f25649d1751b1c7a3aabd16dff0691fe9f1eed1206616d0906d05933536052037340a0c8d0941ff870b0eb469a2f975b | ||
| languageName: node | ||
| linkType: hard | ||
|
|
||
| [email protected]: | ||
| version "18.0.0" | ||
| resolved "https://registry.yarnpkg.com/react/-/react-18.0.0.tgz#b468736d1f4a5891f38585ba8e8fb29f91c3cb96" | ||
| integrity sha512-x+VL6wbT4JRVPm7EGxXhZ8w8LTROaxPXOqhlGyVSrv0sB1jkyFGgXxJ8LVoPRLvPR6/CIZGFmfzqUa2NYeMr2A== | ||
| "snapshots@workspace:.": | ||
| version: 0.0.0-use.local | ||
| resolution: "snapshots@workspace:." | ||
| dependencies: | ||
| loose-envify "^1.1.0" | ||
| "@sourcegraph/tsconfig": 4.0.1 | ||
| "@types/react": 17.0.52 | ||
| react: 18.0.0 | ||
| languageName: unknown | ||
| linkType: soft | ||
|
|
||
| "syntax@workspace:input/syntax": | ||
| version: 0.0.0-use.local | ||
| resolution: "syntax@workspace:input/syntax" | ||
| languageName: unknown | ||
| linkType: soft |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.