Uh oh!
There was an error while loading. Please reload this page.
[Master] Fix resolve entity name to not dive inside property access expression when the expression is not entity name - #14692
Conversation
Nathan Shively-Sanders (sandersn)
left a comment
There was a problem hiding this comment.
Looks good, although the new fallback behaviour in getSymbolOfEntityNameOrPropertyAccess is somewhat confusing.
| //// } | ||
| //// var x: { | ||
| //// B : CTor | ||
| //// }; |
There was a problem hiding this comment.
lines 1-9 don't seem necessary for this test
| //// } | ||
| //// var x: { | ||
| //// B : CTor | ||
| //// }; |
There was a problem hiding this comment.
lines 1-9 don't seem necessary for this test
| //// } | ||
| //// var x: { | ||
| //// B : CTor | ||
| //// }; |
There was a problem hiding this comment.
lines 1-9 don't seem necessary for this test
| //// class C extends (foo()).[|B|] {} | ||
| //// class C1 extends foo().[|B|] {} | ||
| const [def, ref1, ref2] = test.ranges(); |
There was a problem hiding this comment.
Try this instead:
constrs=test.ranges();for(constrofrs){verify.referencesOf(r,rs));}| } | ||
| } | ||
| else if (name.kind === SyntaxKind.ParenthesizedExpression) { | ||
| // If the expression in parenthsizedExpression is not an entity-name (e.g. it is a call expression), it won't be able to successfully resolve the name. |
There was a problem hiding this comment.
typo:parenthesized
| // i.e class C extends foo()./*do language service operation here*/B {} | ||
| return isEntityNameExpression(name.expression) ? | ||
| resolveEntityName(name.expression as EntityNameOrEntityNameExpression, meaning, ignoreErrors, dontResolveAlias, location) : | ||
| undefined; |
There was a problem hiding this comment.
should we also give an error in the undefined case?
There was a problem hiding this comment.
We shouldn't because the caller will already handle this case.
| } | ||
| var x: { | ||
| B : CTor | ||
| }; |
There was a problem hiding this comment.
turns out lines 1-7 aren't used here either!
While writing tests for dynamic import, I ran into
Debug.fail("Unknown entity name kind.");insideresolveEntityNamefunction, turned out that it not only causes failure when writing out ".types" files but also disable some language services features (see test files)