Closed jmb1026 closed 3 years ago
Any updates on this? What I have found out:
* #f(compiled-function () #<bytecode 0x166b8e1>)()
ng2-ts--inside-lambda-args-p(119)
ng2-ts--highlight-lambda-args-fn(131)
font-lock-fontify-keywords-region(1 131 nil)
font-lock-default-fontify-region(1 131 nil)
(): Promise<void> => {}
, use (): (Promise<void>) => {}
(-> temporary fix)For anyone else running into this issue: I fixed it using
--- a/ng2-ts.el
+++ b/ng2-ts.el
@@ -198,6 +198,7 @@
(min bound (ng2-ts--end-of-lambda-args (point))) 1))
(and (ignore-errors
;; Skip forward if we wind up in the space between the args and the =>
+ (save-match-data (while (looking-at ">") (forward-char)))
(ng2-ts--skip-whitespace)
(forward-char 2)
(prog1 (save-match-data (search-forward "=>" bound 1))
However that is relatively hacky and I really don't know elisp, so I'm not submitting a PR :p
Oh, hey!
Honestly syntax highlighting in emacs is a massive hack anyway. If this fixes it, shoot me an PR and I'll put it in. Rather some edge case not get highlighted than have your editor hang.
Problem
While following along with this tutorial ng2-ts mode seems to cause emacs to block and use 100% of the CPU. The code in question is from the "Error handling" section, specifically:
Environment
Emacs configuration
Steps to reproduce
ng new repro
Accept defaults.cd repro
Misc.