[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9e7ee77 155/271: Add catch test. Don't uncolorize.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 9e7ee77 155/271: Add catch test. Don't uncolorize. |
Date: |
Thu, 05 Feb 2015 18:30:43 +0000 |
branch: master
commit 9e7ee7708fff3ec004497a7e41c26b695bfcfad6
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Add catch test. Don't uncolorize.
---
context-coloring.el | 9 +++++++--
test/context-coloring-test.el | 8 ++++++++
test/fixtures/catch.js | 1 +
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index 09bee0c..5d58ff2 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -254,13 +254,18 @@ For example: \"context-coloring-level-1-face\"."
(defun context-coloring-js2-colorize ()
(with-silent-modifications
- (context-coloring-uncolorize-buffer)
+ ;; (context-coloring-uncolorize-buffer)
(js2-visit-ast
js2-mode-ast
(lambda (node end-p)
(when (null end-p)
(cond
((js2-scope-p node)
+ ;; TODO: Work on catch blocks.
+ ;; (message "SCOPE: %s, SPOS: %s, EPOS: %s"
+ ;; (js2-scope-type node)
+ ;; (js2-node-abs-pos node)
+ ;; (+ (js2-node-abs-pos node) (js2-scope-len node)))
(let ((start (js2-node-abs-pos node)))
(context-coloring-colorize-region
start
@@ -288,7 +293,7 @@ to the current buffer. Tokens are 3 integers: start, end,
level. The vector is flat, with a new token occurring after every
3rd element."
(with-silent-modifications
- (context-coloring-uncolorize-buffer)
+ ;; (context-coloring-uncolorize-buffer)
(let ((i 0)
(len (length tokens)))
(while (< i len)
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index e1ae2e3..1218f22 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -97,6 +97,14 @@ FIXTURE."
(context-coloring-mode)
(context-coloring-test-region-level-p 1 10 0)))
+(ert-deftest context-coloring-test-js2-mode-catch ()
+ (context-coloring-test-js2-with-fixture
+ "./fixtures/catch.js"
+ (js2-mode)
+ (context-coloring-mode)
+ (context-coloring-test-region-level-p 1 8 0)
+ (context-coloring-test-region-level-p 8 20 1)))
+
(ert-deftest context-coloring-test-js2-mode-complexity ()
(context-coloring-test-js2-with-fixture
"../benchmark/fixtures/mkdirp-0.5.0.js"
diff --git a/test/fixtures/catch.js b/test/fixtures/catch.js
new file mode 100644
index 0000000..0ead890
--- /dev/null
+++ b/test/fixtures/catch.js
@@ -0,0 +1 @@
+try {} catch (e) {}
- [elpa] master 2bb4d12 124/271: More cleanup., (continued)
- [elpa] master 2bb4d12 124/271: More cleanup., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d301048 154/271: Update compilation again., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 1d9cf42 164/271: Refactor tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master a0ccc5c 162/271: Improve and pass catch test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c8fa33f 170/271: Improve async benchmarking., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7954efc 110/271: Rename instances of depth to level., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 338716d 161/271: Refactor., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fc81cf9 157/271: Don't use timers for js2-mode., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b4c220a 159/271: Always remove hooks., Jackson Ray Hamilton, 2015/02/05
- [elpa] master e040ca0 181/271: Just use stable emacs., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9e7ee77 155/271: Add catch test. Don't uncolorize.,
Jackson Ray Hamilton <=
- [elpa] master 665a54a 167/271: Add more js-mode tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 43f2e3b 168/271: Increase reliability of async tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 28183e4 188/271: Readme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master bdfdbe4 151/271: Improve benchmarks., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d27f2fe 182/271: Fix callback removal., Jackson Ray Hamilton, 2015/02/05
- [elpa] master cb0644a 136/271: Cleanup JavaScript tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c1e9226 171/271: Reorganize lib., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9e14226 135/271: Merge branch 'feature/language-generalization' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7473cc9 169/271: Improve documentation and error handling for async tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b468d1c 166/271: Improve block scope test. Rename and document block scope variable., Jackson Ray Hamilton, 2015/02/05