[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode c0f11efdfd 143/222: Fixing typescript--for
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode c0f11efdfd 143/222: Fixing typescript--forward-expression for multiline indented string |
Date: |
Sun, 6 Feb 2022 16:59:27 -0500 (EST) |
branch: elpa/typescript-mode
commit c0f11efdfd693aa55a192c8e4a26fc6fcd2c9f90
Author: ramblehead <v.rybynok@gmail.com>
Commit: Louis-Dominique Dubeau <ldd@lddubeau.com>
Fixing typescript--forward-expression for multiline indented string
See https://github.com/emacs-typescript/typescript.el/issues/105 for
details.
This fix includes
typescript--forward-expression-on-multiline-indented-string
ert test case.
---
typescript-mode-general-tests.el | 37 +++++++++++++++++++++++++++++++++++++
typescript-mode.el | 14 +++++++-------
2 files changed, 44 insertions(+), 7 deletions(-)
diff --git a/typescript-mode-general-tests.el b/typescript-mode-general-tests.el
index 9a79108da1..6bbb5609bf 100644
--- a/typescript-mode-general-tests.el
+++ b/typescript-mode-general-tests.el
@@ -183,6 +183,43 @@ a severity set to WARNING, no rule name."
;; completing and not locking up is test-success!
))
+(ert-deftest typescript--forward-expression-on-multiline-indented-string ()
+ "Testcase for https://github.com/emacs-typescript/typescript.el/issues/105"
+
+ (with-temp-buffer
+ (typescript-mode)
+
+ (insert
+"fetch('http://localhost:8529/_db/_system/land', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ Accept: 'application/json',
+ },
+ body: JSON.stringify({
+ query: `{
+ query GetElement {
+ element(id: \"0000\") {
+ collection
+ id
+ name
+ description
+ }
+ }
+ }`,
+ }),
+})
+ .then(r => r.json())
+ .then(data => console.log('data returned:', data));")
+
+ (goto-char (point-min))
+ (typescript--forward-expression)
+ ;; completing and not locking up is test-success!
+ ;; Should there be a time-out? Or it is handled by external tool?
+
+ ;; Check that `typescript--forward-expression' jumped to the right
position.
+ (should (= 434 (point)))))
+
(defun test-re-search (searchee contents offset)
(with-temp-buffer
(typescript-mode)
diff --git a/typescript-mode.el b/typescript-mode.el
index ad8e595992..e9632d70dd 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -989,13 +989,13 @@ one at the end of the line with \"let a\"."
This function doesn't move over expressions continued across
lines."
(loop
- ;; non-continued case; simplistic, but good enough?
- do (loop until (or (eolp)
- (progn
- (forward-comment most-positive-fixnum)
- (memq (char-after) '(?\, ?\; ?\] ?\) ?\}))))
- do (forward-sexp))
-
+ do (progn
+ (forward-comment most-positive-fixnum)
+ (loop until (or (eolp)
+ (progn
+ (forward-comment most-positive-fixnum)
+ (memq (char-after) '(?\, ?\; ?\] ?\) ?\}))))
+ do (forward-sexp)))
while (and (eq (char-after) ?\n)
(save-excursion
(forward-char)
- [nongnu] elpa/typescript-mode 1e9fc35cb9 210/222: Make cask and emacs locations overridable., (continued)
- [nongnu] elpa/typescript-mode 1e9fc35cb9 210/222: Make cask and emacs locations overridable., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 96800ed070 208/222: Migrate build to use proper tasks and new source for Emacs, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e824162051 222/222: Merge pull request #159 from tancnle/fix-cl-deprecation-warnings, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 5b0487aae8 085/222: Fix the Emacs regex used for highlighting TS regexes., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 2cd997a8d5 102/222: Fix typescript--backward-to-parameter-list, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 2815dd1b4b 098/222: Add option to support indented case-statements. Fixes #23 (#66), ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 861d5983b6 090/222: Make the comment-start and comment-end variables local., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 4e3850dd2a 105/222: Remove logic handling preprocessor macros, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 32f5034e9d 127/222: Extract tests as general tests, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e15e2bfa1a 131/222: Add jsdoc tests, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c0f11efdfd 143/222: Fixing typescript--forward-expression for multiline indented string,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode a0f2c3ebd4 164/222: Reimplement template auto conversion as a post-self-insert-hook, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b44b75dbe1 172/222: Add test case for infinite loop, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 5bf30fe8d6 175/222: Add member expressions tests involving type parameters., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1c27fb09ed 220/222: Fix cl deprecation warning, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode dd832751ab 217/222: Merge pull request #156 from zkry/fix-dot-after-exclamation-indentation, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 4249a20d6d 187/222: Added file for indent test case, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c5e7788ce9 044/222: Merge pull request #28 from ananthakumaran/testing, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 99c2b74ac3 059/222: Make current-column function internal., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 89d22c4e18 051/222: Don't interpret forward slash in list as operator., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 393ac6db0f 081/222: add tests for regexp font locking, ELPA Syncer, 2022/02/06