mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Update tests
This commit is contained in:
parent
fbb73b76c7
commit
16762a4ff0
@ -19,13 +19,7 @@ namespace ts.formatting {
|
||||
}
|
||||
|
||||
// no indentation in string \regex\template literals
|
||||
let precedingTokenIsLiteral =
|
||||
precedingToken.kind === SyntaxKind.StringLiteral ||
|
||||
precedingToken.kind === SyntaxKind.RegularExpressionLiteral ||
|
||||
precedingToken.kind === SyntaxKind.NoSubstitutionTemplateLiteral ||
|
||||
precedingToken.kind === SyntaxKind.TemplateHead ||
|
||||
precedingToken.kind === SyntaxKind.TemplateMiddle ||
|
||||
precedingToken.kind === SyntaxKind.TemplateTail;
|
||||
let precedingTokenIsLiteral = isStringOrRegularExpressionOrTemplateLiteral(precedingToken.kind);
|
||||
if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,11 +1,21 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////if (true) {
|
||||
//// let foo = `
|
||||
/////*
|
||||
////`/*1*/}
|
||||
////let noSubTemplate = `/* /*1*/`;
|
||||
////let templateHead = `/* /*2*/${1 + 2}`;
|
||||
////let templateMiddle = `/* ${1 + 2 /*3*/}`;
|
||||
////let templateTail = `/* ${1 + 2} /*4*/`;
|
||||
|
||||
goTo.marker('1');
|
||||
edit.insert(";");
|
||||
edit.insert("\n");
|
||||
|
||||
verify.currentFileContentIs("if (true) {\n let foo = `\n/* \n`;}");
|
||||
goTo.marker('2');
|
||||
edit.insert("\n");
|
||||
|
||||
goTo.marker('3');
|
||||
edit.insert("\n");
|
||||
|
||||
goTo.marker('4');
|
||||
edit.insert("\n");
|
||||
|
||||
|
||||
verify.currentFileContentIs("let noSubTemplate = `/* \n`;\nlet templateHead = `/* \n${1 + 2}`;\nlet templateMiddle = `/* ${1 + 2\n }`;\nlet templateTail = `/* ${1 + 2} \n`;");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user