not escape unicode char for import path string. (#39463)

* not escape unicode char for import path string.

* fix test.
This commit is contained in:
Song 2020-07-22 23:28:29 +08:00 committed by GitHub
parent 34adaaf6aa
commit 294a0406e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -4139,7 +4139,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;

View File

@ -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"');