[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode 5b6d60a2b2 118/222: Fix indentation after
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode 5b6d60a2b2 118/222: Fix indentation after keyword-lookalike methods. |
Date: |
Sun, 6 Feb 2022 16:59:24 -0500 (EST) |
branch: elpa/typescript-mode
commit 5b6d60a2b2c9d8a9eba11ce9e453c7791bdf0770
Author: Valentin Robert <valentin.robert.42@gmail.com>
Commit: Valentin Robert <valentin.robert.42@gmail.com>
Fix indentation after keyword-lookalike methods.
---
test-files/indentation-reference-document.ts | 25 +++++++++++++++++++++++++
typescript-mode.el | 5 ++++-
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/test-files/indentation-reference-document.ts
b/test-files/indentation-reference-document.ts
index 9d490ac6ae..4418152bc4 100644
--- a/test-files/indentation-reference-document.ts
+++ b/test-files/indentation-reference-document.ts
@@ -627,3 +627,28 @@ function blipblop(): void {
container.each(x => x)
something() // No reason for this to be indented! (cf. issue #83)
+
+// Method calls that look like braceless keywords should not indent!
+function test() {
+ return (
+ f.catch()
+ )
+ return (
+ f.do()
+ )
+ return (
+ f.each()
+ )
+ return (
+ f.else()
+ )
+ return (
+ f.if()
+ )
+ return (
+ f.finally()
+ )
+ return (
+ f.then()
+ )
+}
diff --git a/typescript-mode.el b/typescript-mode.el
index 1718419df5..5e01ae820b 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -2210,7 +2210,10 @@ nil."
(when (= (char-before) ?\)) (backward-list))
(skip-syntax-backward " ")
(skip-syntax-backward "w_")
- (looking-at typescript--possibly-braceless-keyword-re))
+ (and
+ (looking-at typescript--possibly-braceless-keyword-re)
+ ;; If preceded by period, it's a method call.
+ (not (= (char-before) ?.))))
(not (typescript--end-of-do-while-loop-p))))
(save-excursion
(goto-char (match-beginning 0))
- [nongnu] elpa/typescript-mode 3766e37f24 026/222: Add README, (continued)
- [nongnu] elpa/typescript-mode 3766e37f24 026/222: Add README, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f6907e8ae3 031/222: Fix error in compilation-mode alist registration., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 316b018d27 040/222: Add CI-config and test-runner., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode ab6d105807 076/222: Add regression tests for function name highlighting., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 2c43dd034c 068/222: Merge pull request #46 from ananthakumaran/fix/union-type-in-return-annotation, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 3361adad67 093/222: Prevent messing up comment fontification when filling paragraphs., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 5350c45aec 104/222: Add function to convert plain strings to template strings., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 7a5c74d88e 109/222: Merge pull request #72 from Wilfred/remove_cpp, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c2d72b7d81 116/222: Fix unwanted indentation after non-keyword "each", ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 0d32c85bfb 110/222: Drop typescript-parent-mode., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 5b6d60a2b2 118/222: Fix indentation after keyword-lookalike methods.,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 6a6c63ad5e 126/222: Extract test utilities, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 72ec0f93aa 125/222: Merge pull request #90 from jack-williams/add-never, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 69607202bc 139/222: Make GPL license discoverable by Github., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f20103a448 154/222: Add `delete-selection` hints, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode fe63c579b5 158/222: Merge pull request #120 from emacs-typescript/tsx-tests, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode bd15f212a7 165/222: Implement support type-highlighting in some basic declarations, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 444aa36ec2 169/222: Fix the indentation of member expressions and continued expressions., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a8b7e76e85 171/222: Fix infinite loop in indentation., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 62e0366b46 181/222: Remove debugging code, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a504b6f571 182/222: Merge pull request #1 from jkdufair/jkdufair-remove-debugging-code, ELPA Syncer, 2022/02/06