-
Notifications
You must be signed in to change notification settings - Fork 583
More type checking #398
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
More type checking #398
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.
🎉
|
||
func (c *Checker) checkJSDocComment(node *ast.Node, location *ast.Node) { | ||
switch node.Kind { | ||
case ast.KindJSDocLink, ast.KindJSDocLinkCode, ast.KindJSDocLinkPlain: |
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.
Agh, missed that this doesn't check @see
, so won't catch everything.
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.
@see
is a tag, so it is indeed checked (to link to a symbol in a @see
tag you actually have to write @see {@link Foo}
).
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.
@see variable
is valid without any @link
: microsoft/TypeScript#35524
https://www.typescriptlang.org/play/?ts=4.1.0-beta#example/see-in-jsdoc
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.
Right, but the old compiler doesn't actually mark Foo
as referenced because of an @see Foo
tag. Maybe it should, but neither the old nor the new compiler has logic for that right now.
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.
Wow, weird.
I went to retest vscode and got a couple of errors still; maybe just that my version is newer? (Or older?) |
In this PR:
@link
directives for unused identifier checks).With this PR, the VS Code project now compiles with no errors or warnings (and the fact that no unused identifiers are reported is indication that everything is being checked). Beyond JSDoc and JSX, very little remains to be ported in the type checker and performance should now be representative of what we'll see in the completed port.