diff options
| author | Yuan Fu | 2024-12-24 13:17:51 -0800 |
|---|---|---|
| committer | Yuan Fu | 2024-12-24 13:56:44 -0800 |
| commit | e2a9af431191d5c71e2ca7a4347ce9e435e8cca0 (patch) | |
| tree | 67a6f8c6dfa92f4905f584eb887508e8b92b99ef /test/src | |
| parent | 833494d4b00a837be8ceaa09b37f54ce17d0a062 (diff) | |
| download | emacs-e2a9af431191d5c71e2ca7a4347ce9e435e8cca0.tar.gz emacs-e2a9af431191d5c71e2ca7a4347ce9e435e8cca0.zip | |
Add treesit-aggregated-simple-imenu-settings
Now we support setting up Imenu for multiple languages
* doc/lispref/modes.texi: Update manual.
* lisp/treesit.el:
(treesit-aggregated-simple-imenu-settings): New variable.
(treesit--imenu-merge-entries): New function.
(treesit--generate-simple-imenu): This was previously
treesit-simple-imenu.
(treesit-simple-imenu): Support
treesit-aggregated-simple-imenu-settings.
(treesit-major-mode-setup): Recognize
treesit-aggregated-simple-imenu-settings.
* test/src/treesit-tests.el (treesit-imenu): New test.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/treesit-tests.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 50f205421d7..43102fc97e0 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el | |||
| @@ -1270,6 +1270,20 @@ This tests bug#60355." | |||
| 1270 | (should node) | 1270 | (should node) |
| 1271 | (should (equal (treesit-node-text node) "2")))) | 1271 | (should (equal (treesit-node-text node) "2")))) |
| 1272 | 1272 | ||
| 1273 | ;;; Imenu | ||
| 1274 | |||
| 1275 | (ert-deftest treesit-imenu () | ||
| 1276 | "Test imenu functions." | ||
| 1277 | (should (equal (treesit--imenu-merge-entries | ||
| 1278 | '(("Function" . (f1 f2)) | ||
| 1279 | ("Function" . (f3 f4 f5)) | ||
| 1280 | ("Class" . (c1 c2 c3)) | ||
| 1281 | ("Variables" . (v1 v2)) | ||
| 1282 | ("Class" . (c4)))) | ||
| 1283 | '(("Function" . (f1 f2 f3 f4 f5)) | ||
| 1284 | ("Class" . (c1 c2 c3 c4)) | ||
| 1285 | ("Variables" . (v1 v2)))))) | ||
| 1286 | |||
| 1273 | 1287 | ||
| 1274 | ;; TODO | 1288 | ;; TODO |
| 1275 | ;; - Functions in treesit.el | 1289 | ;; - Functions in treesit.el |