Don't escape unicode characters in import/export paths in reported errors#57550
Don't escape unicode characters in import/export paths in reported errors#57550Andarist wants to merge 3 commits intomicrosoft:mainfrom
Conversation
| symbolFromModule || symbolFromVariable; | ||
| if (!symbol) { | ||
| errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name); | ||
| errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, getSourceFileOfNode(node), name); |
There was a problem hiding this comment.
This relies on the printer selection in symbolToStringWorker. While the containing function also accepts node.kind === SyntaxKind.VariableDeclaration, such a node doesn't reach this line in any test case so I'm currently not 100% sure if I can just call getSourceFileOfNode unconditionally here. I think it's OK for imports and exports.
There was a problem hiding this comment.
Misrepresenting the location that we’re going to scope a symbol reference from sounds like a bad idea—the original fix in #39463 that you’re building on here feels a little too magically indirect to begin with to me. Is there any way you see to make the printer escaping behavior more directly dependent on whether a module specifier is being printed?
|
|
||
| function symbolToStringWorker(writer: EmitTextWriter) { | ||
| const entity = builder(symbol, meaning!, enclosingDeclaration, nodeFlags)!; // TODO: GH#18217 | ||
| // add neverAsciiEscape for GH#39027 |
There was a problem hiding this comment.
It's now not only about this issue - I'm not sure if this comment has a lot of value here. If you think otherwise, I can bring it back.
| symbolFromModule || symbolFromVariable; | ||
| if (!symbol) { | ||
| errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name); | ||
| errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, getSourceFileOfNode(node), name); |
There was a problem hiding this comment.
Misrepresenting the location that we’re going to scope a symbol reference from sounds like a bad idea—the original fix in #39463 that you’re building on here feels a little too magically indirect to begin with to me. Is there any way you see to make the printer escaping behavior more directly dependent on whether a module specifier is being printed?
fixes #57539