[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Custom imenu-generic-expression has no effect

From: joseph
Subject: Custom imenu-generic-expression has no effect
Date: Sat, 26 Mar 2022 03:22:14 -0700


I'd like some help making imenu index test assertions in js-jsx-mode.

The lines which should match a regexp look like

test('Name of test', (arg) => {

Here's what I've tried so far:

(setq js-imenu-generic-expression
      '(("Tests" "test('\\(.*\\)',.*$" 1)))

(add-hook 'js-jsx-mode-hook (lambda () (setq imenu-generic-expression js-imenu-generic-expression)))

In js-jsx-mode, (describe-variable imenu-generic-expression)
reveals that the variable is set correctly.

Nevertheless, after M-x imenu, the modeline reads

imenu-unavailable-error: imenu unavailable: "No items suitable for an index found in this buffer"

Any advice would be greatly appreciated!

Joseph Turner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]