Skip to content

Commit 5a41201

Browse files
committed
not escape unicode char for import path string.
1 parent 1aaa2ec commit 5a41201

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4132,7 +4132,8 @@ namespace ts {
41324132

41334133
function symbolToStringWorker(writer: EmitTextWriter) {
41344134
const entity = builder(symbol, meaning!, enclosingDeclaration, nodeFlags)!; // TODO: GH#18217
4135-
const printer = createPrinter({ removeComments: true });
4135+
// add neverAsciiEscape for GH#39027
4136+
const printer = enclosingDeclaration?.kind === SyntaxKind.SourceFile ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true });
41364137
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
41374138
printer.writeNode(EmitHint.Unspecified, entity, /*sourceFile*/ sourceFile, writer);
41384139
return writer;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @Filename: /江南今何在/tmp.ts
4+
//// export const foo = 1;
5+
6+
// @Filename: /test.ts
7+
//// import { foo } from "./江南/*1*/今何在/tmp";
8+
9+
verify.quickInfoAt("1", 'module "/江南今何在/tmp"', "");

0 commit comments

Comments
 (0)