Skip to content
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

Jsdoc property description #49818

Closed
wants to merge 0 commits into from

Conversation

danay1999
Copy link
Contributor

Fixes #47933

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jul 6, 2022
@danay1999 danay1999 marked this pull request as ready for review July 12, 2022 18:45
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

const expressionType = checkExpressionCached(name.expression);
let infos = getApplicableIndexInfos(expressionType, getLiteralTypeFromPropertyName(name.name));
if(infos.length === 0 && getIndexInfosOfType(expressionType).filter(type => type.keyType.flags & TypeFlags.TemplateLiteral || type.keyType.flags & TypeFlags.ESSymbol).length > 0){
infos = getApplicableIndexInfos(expressionType, checkExpressionCached(name.name));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you comment on what examples/tests you needed this case for? AFAIK, checkExpressionCached on the name of a property access doesn't usually return the literal type of the name itself, but instead returns the type of the member the name refers to, which makes this line feel kinda nonsensical, since it's indexing the left-hand side type by the type of the whole expression, which is weird.

const copy = createSymbol(SymbolFlags.Signature, InternalSymbolName.Index);
copy.declarations = mapDefined(infos, i => i.declaration);
copy.parent = expressionType.symbol ? expressionType.symbol : getSymbolAtLocation(copy.declarations[0].parent);
return copy;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to assign to link.resolvedSymbol before returning

@sandersn sandersn added this to Not started in PR Backlog Jul 18, 2022
@sandersn sandersn moved this from Not started to Waiting on author in PR Backlog Jul 18, 2022
@danay1999 danay1999 marked this pull request as draft July 20, 2022 21:18
@danay1999 danay1999 closed this Aug 11, 2022
PR Backlog automation moved this from Waiting on author to Done Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
PR Backlog
  
Done
Development

Successfully merging this pull request may close these issues.

jsdoc property description does not work on index signatures
4 participants