Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imenu fails with error #171

Open
wedens opened this issue May 27, 2021 · 3 comments
Open

imenu fails with error #171

wedens opened this issue May 27, 2021 · 3 comments

Comments

@wedens
Copy link

wedens commented May 27, 2021

Can be reproduced on this file, or basically any other scala file in clean emacs with just scala-mode loaded.

Debugger entered--Lisp error: (void-variable definition-type)
  scala-imenu:destructure-for-build-imenu-candidate(("ContextShift" "trait" #<marker at 1502 in ContextShift.scala>) nil)
  scala-imenu:build-imenu-candidates((("ContextShift" "trait" #<marker at 1502 in ContextShift.scala>) ("shift" "def" #<marker at 1852 in ContextShift.scala>) ("blockOn" "def" #<marker at 2315 in ContextShift.scala>) ("evalOn" "def" #<marker at 2935 in ContextShift.scala>)))
  cl-mapcar(scala-imenu:build-imenu-candidates ((("ContextShift" "trait" #<marker at 1502 in ContextShift.scala>) ("shift" "def" #<marker at 1852 in ContextShift.scala>) ("blockOn" "def" #<marker at 2315 in ContextShift.scala>) ("evalOn" "def" #<marker at 2935 in ContextShift.scala>)) (("ContextShift" "object" #<marker at 2990 in ContextShift.scala>) ("apply" "def" #<marker at 3014 in ContextShift.scala>) ("evalOnK" "def" #<marker at 3140 in ContextShift.scala>) ("deriveEitherT" "def" #<marker at 3364 in ContextShift.scala>) ("deriveOptionT" "def" #<marker at 3839 in ContextShift.scala>) ("deriveWriterT" "def" #<marker at 4296 in ContextShift.scala>) ("deriveStateT" "def" #<marker at 4862 in ContextShift.scala>) ("deriveKleisli" "def" #<marker at 5333 in ContextShift.scala>) ("deriveIorT" "def" #<marker at 5796 in ContextShift.scala>))))
  scala-imenu:create-imenu-index()
  imenu--make-index-alist(t)
  counsel--imenu-candidates()
  counsel-imenu()
  funcall-interactively(counsel-imenu)
  command-execute(counsel-imenu)

(counsel in backtrace is irrelevant, the error is the same with vanilla imenu)

scala-mode: 598cb68 (latest at the moment)
emacs: GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.16.0) (recent pgtk branch)

@wedens
Copy link
Author

wedens commented Oct 14, 2021

Still an issue.

@dcunited001
Copy link

Also getting this. Haven't quite looked into it yet. I'm just looking through scala-mode and sbt-mode to see what I can customize.

  scala-imenu:destructure-for-build-imenu-candidate(("MOOCSettings" "object" #<marker at 129 in MOOCSettings.scala>) nil)
  scala-imenu:build-imenu-candidates((("MOOCSettings" "object" #<marker at 129 in MOOCSettings.scala>) (("autoImport" "object" #<marker at 173 in MOOCSettings.scala>) ("course" "val" #<marker at 197 in MOOCSettings.scala>) ("assignment" "val" #<marker at 243 in MOOCSettings.scala>) ("datasetUrl" "val" #<marker at 297 in MOOCSettings.scala>) ("downloadDataset" "val" #<marker at 376 in MOOCSettings.scala>) ("assignmentVersion" "val" #<marker at 468 in MOOCSettings.scala>)) ("downloadDatasetDef" "val" #<marker at 597 in MOOCSettings.scala>) ("projectSettings" "val" #<marker at 1301 in MOOCSettings.scala>)))
  cl-mapcar(scala-imenu:build-imenu-candidates ((("MOOCSettings" "object" #<marker at 129 in MOOCSettings.scala>) (("autoImport" "object" #<marker at 173 in MOOCSettings.scala>) ("course" "val" #<marker at 197 in MOOCSettings.scala>) ("assignment" "val" #<marker at 243 in MOOCSettings.scala>) ("datasetUrl" "val" #<marker at 297 in MOOCSettings.scala>) ("downloadDataset" "val" #<marker at 376 in MOOCSettings.scala>) ("assignmentVersion" "val" #<marker at 468 in MOOCSettings.scala>)) ("downloadDatasetDef" "val" #<marker at 597 in MOOCSettings.scala>) ("projectSettings" "val" #<marker at 1301 in MOOCSettings.scala>))))
  scala-imenu:create-imenu-index()
  consult-imenu--compute()
  consult-imenu--items()
  #f(compiled-function () #<bytecode -0x1069c2a3c7f90e4e>)()
  funcall-with-delayed-message(1 "Building Imenu..." #f(compiled-function () #<bytecode -0x1069c2a3c7f90e4e>))
  consult-imenu()
  funcall-interactively(consult-imenu)
  command-execute(consult-imenu)

@dcunited001
Copy link

OK, it looks like it's a problem involving initialization of values. So running this on a file using DSL or various features may cause an error, which prevents the rest of some procedures from running and then fails on similar files.

Once i've run it on a simple file, the other problematic files seem to instantiate their imenu just fine. I'm not 100% sure what the details are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants