Skip to content

not escape unicode char for import path string. #39463

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

Merged
merged 2 commits into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4132,7 +4132,8 @@ namespace ts {

function symbolToStringWorker(writer: EmitTextWriter) {
const entity = builder(symbol, meaning!, enclosingDeclaration, nodeFlags)!; // TODO: GH#18217
const printer = createPrinter({ removeComments: true });
// add neverAsciiEscape for GH#39027
const printer = enclosingDeclaration?.kind === SyntaxKind.SourceFile ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true });
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
printer.writeNode(EmitHint.Unspecified, entity, /*sourceFile*/ sourceFile, writer);
return writer;
Expand Down
9 changes: 9 additions & 0 deletions tests/cases/fourslash/quickInfoImportNonunicodePath.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference path="fourslash.ts" />

// @Filename: /江南今何在/tmp.ts
//// export const foo = 1;

// @Filename: /test.ts
//// import { foo } from "./江南/*1*/今何在/tmp";

verify.quickInfoAt("1", 'module "/江南今何在/tmp"');