Skip to content

Commit 294a040

Browse files
authored
not escape unicode char for import path string. (#39463)
* not escape unicode char for import path string. * fix test.
1 parent 34adaaf commit 294a040

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
@@ -4139,7 +4139,8 @@ namespace ts {
41394139

41404140
function symbolToStringWorker(writer: EmitTextWriter) {
41414141
const entity = builder(symbol, meaning!, enclosingDeclaration, nodeFlags)!; // TODO: GH#18217
4142-
const printer = createPrinter({ removeComments: true });
4142+
// add neverAsciiEscape for GH#39027
4143+
const printer = enclosingDeclaration?.kind === SyntaxKind.SourceFile ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true });
41434144
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
41444145
printer.writeNode(EmitHint.Unspecified, entity, /*sourceFile*/ sourceFile, writer);
41454146
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)