-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add definitions and references for constructors #250
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Followup #251
export function useNoConstructor() { | ||
// ^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/useNoConstructor(). | ||
// documentation ```ts\nfunction useNoConstructor(): NoConstructor\n``` | ||
return new NoConstructor() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 🤩
const declaration = sym.declarations?.[0] | ||
if (!declaration) { | ||
return undefined | ||
} | ||
const signatureDeclaration: ts.SignatureDeclaration | undefined = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.