[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode b1d1948c15 123/222: Merge pull request #88
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode b1d1948c15 123/222: Merge pull request #88 from Ptival/fix-indentation-method-calls-keywords |
Date: |
Sun, 6 Feb 2022 16:59:25 -0500 (EST) |
branch: elpa/typescript-mode
commit b1d1948c150f78a7c133d9b4c10a648e58ad3b33
Merge: 30f8b8feb4 5b6d60a2b2
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: GitHub <noreply@github.com>
Merge pull request #88 from Ptival/fix-indentation-method-calls-keywords
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 9d2ef766bc..341e15d4ed 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -2250,7 +2250,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 70acbf9c3d 078/222: Change font-lock-test to also accept a list of locations, (continued)
- [nongnu] elpa/typescript-mode 70acbf9c3d 078/222: Change font-lock-test to also accept a list of locations, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a2167a133d 056/222: Fix errors with indentation when line has wide unicode chars., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 09bdb97c32 065/222: Fix an indentation bug., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 8b2815514d 088/222: Simplify typescript--backward-to-parameter-list, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f9cd0dd539 112/222: Try parse new error-format introduced in tsc 2.7+, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a1cdb7a1ec 121/222: Remove redundant regexp groups for jsdoc tags, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode fd1c9daa4d 094/222: Add failing cases., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode bd046e0fae 120/222: Add tags in usejsdoc.org, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 3c79132066 136/222: fix warnings from package-lint, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 000131df29 150/222: Update CI-settings, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b1d1948c15 123/222: Merge pull request #88 from Ptival/fix-indentation-method-calls-keywords,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 039d122384 156/222: add a test for simple tsx, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c766ec8009 159/222: Include symbol constituents in typescript--function-call-re, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 5e0b9ee095 168/222: Add a test that fails without the following indentation fix., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 42a60e5c88 190/222: Merge pull request #137 from sirikid/feature/comma-first-lists, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1c2a8b2391 211/222: Move build to use proper tasks, support OSX and Windows., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 7f1cde0a90 221/222: Make c-comment-line-break-function work as expected., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 438fc968bf 016/222: Highlight set and get keyword, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b6e993513c 015/222: Merge pull request #10 from nahuel/patch-1, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 09123ba690 002/222: prepare for melpa, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode abc0751c0e 025/222: Merge pull request #22 from josteink/master, ELPA Syncer, 2022/02/06