File: indentationInBlockCommentAfterFormatting.ts

package info (click to toggle)
node-typescript 4.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 396,552 kB
  • sloc: javascript: 1,444,377; makefile: 7; sh: 3
file content (43 lines) | stat: -rw-r--r-- 1,278 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/// <reference path='fourslash.ts' />

////// This is a test case of formatting.
////class TestClass {
////private foo: string;
////public bar: string;
////constructor(foo: string, bar: string) {
////this.foo = foo;
////this.bar = bar;
////}
/////** /*1*/
////* This document is to be formatted./*2*/
////*   /*3*/
////* After formatting, each line of this comment block should have indent consistent with the method./*4*/
////*
////  */
/////*5*/public testMethod() {
////}
////}
////var cookieMonster: TestClass;
////cookieMonster = new TestClass("FOO", "BAR");


format.document();
goTo.marker("1");
verify.indentationIs(4);
goTo.marker("2");
verify.indentationIs(4);
goTo.marker("3");
verify.indentationIs(3);
goTo.marker("4");
verify.indentationIs(3);
// Putting a marker in line "*" would bring some error when parsing code in automation.
// So move right by 1 offset from marker 4 to locate the caret in this line.
edit.moveRight(1);
verify.indentationIs(3);
// Putting a marker in line "  */" would bring some error when parsing code in automation.
// So move left by 1 offset from marker 5 to locate the caret in this line.
goTo.marker("5");
edit.moveLeft(1);
verify.indentationIs(4);
goTo.marker("5");
verify.indentationIs(4);