branch: elpa/typescript-mode
commit 5e0b9ee095990b936b3e0e73a9db1608d971f448
Author: Louis-Dominique Dubeau <[email protected]>
Commit: Louis-Dominique Dubeau <[email protected]>
Add a test that fails without the following indentation fix.
---
test-files/indentation-reference-document.ts | 54 ++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/test-files/indentation-reference-document.ts
b/test-files/indentation-reference-document.ts
index dac6ab9430..60b3296497 100644
--- a/test-files/indentation-reference-document.ts
+++ b/test-files/indentation-reference-document.ts
@@ -663,3 +663,57 @@ let $img2: JQuery<HTMLImageElement> = null
if (variable != null) {
//
}
+
+// The following block deals with strings of member expressions on so-called
+// "fluent" APIs.
+interface Fnord {
+ log(...args: any[]): this;
+ blah(): this;
+}
+
+let fnord: Fnord = {} as any;
+
+{
+ fnord
+ .log("sdf")
+ .blah();
+
+ const m =
+ fnord
+ .log()
+ .blah();
+
+ const b = { q: 1, f: 2}
+
+ const x =
+ fnord
+ .log({ a: b.q, z: b.f })
+ .blah();
+
+ (async () => {
+ const x = (
+ await (fnord as any)
+ .log(1));
+ })();
+}
+
+fnord
+ .log("sdf")
+ .blah();
+
+const m =
+ fnord
+ .log()
+ .blah();
+
+fnord
+ .log("sdf")
+
+const q =
+ fnord
+ .log();
+
+// This is a continued expression in parentheses.
+const blip999 = (window.location.href === "fnord" ?
+ "a" :
+ "b");