Add definitions and references for constructors#250
Conversation
olafurpg
left a comment
There was a problem hiding this comment.
Impressive first PR @SuperAuguste! This is definitely a tricky issue to fix and I see you've already become familiar with the tsc APIs 😄
It's mostly just me who has worked in this codebase so far and there are many undocumented conventions and assumptions. Don't hesitate to push back if some of these comments are too nitpicky, I prefer to have more relaxed conventions if it makes it easier for more people to contribute (rather than strictly enforcing some undocumented style making it a drudge to contribute).
6003a45 to
f9212ac
Compare
f9212ac to
c60d510
Compare
808dfd5 to
caa792d
Compare
|
CI failing due to different TypeScript versions :/ I'm kind of lost here, not sure why they're different to be frank. |
olafurpg
left a comment
There was a problem hiding this comment.
This PR is really shaping up! Only blocking comments are
- Add back your constructor detection logic, but with a cache
- Undo changes in yarn.lock, I suspect this might fix the failing CI
The current package.json seems to be invalid due to a peer resolution issue (I ran |
3c681b8 to
035d2f6
Compare
|
Figured out the issue - the yarn version used here is a few years behind it seems, so I installed v1.22.19 and everything worked out! |
595c90b to
e5c0992
Compare
e5c0992 to
c597163
Compare
olafurpg
left a comment
There was a problem hiding this comment.
Glorious 😍 Thank you @SuperAuguste!
| @@ -1,5 +1,7 @@ | |||
| # Developing scip-typescript | |||
|
|
|||
| Please note that the yarn version used by CI is `v1.22.19` - you should use this version as well to prevent lockfile conflicts. | |||
| export function useNoConstructor() { | ||
| // ^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/useNoConstructor(). | ||
| // documentation ```ts\nfunction useNoConstructor(): NoConstructor\n``` | ||
| return new NoConstructor() |
| if (!declaration) { | ||
| return undefined | ||
| } | ||
| const signatureDeclaration: ts.SignatureDeclaration | undefined = |
There was a problem hiding this comment.
I hadn't realized this was already inside a function 🤦🏻 The new code looks good though 👍🏻
I normally run |
Closes #249
This replicates VSCode's gotodef.
Test plan
Tested locally with a snapshot, still need to test edge cases + implement and test inherited constructors.