Ensime not typechecking correctly, nor is its autocomplete working - scala

I wanted to try and see how good Ensime's type checking capabilities were, and while they seemed to work fine at first, it appears it keeps referencing bits of code that no longer exist: (larger version here)
It says it couldn't find the value asdfadsfasdf which was correct, back when I wrote it as random garbage to test the type checker; however it's not there anymore and Ensime keeps complaining about it, rather than spotting the missing : and wrong type name in the when function.
Add to that the fact that despite it having access to the Ensime server, it still won't run autocomplete..
Specs:
Emacs version: 24.3.1
Sbt version: 0.13.5
System: Mac OS X version 10.9.5 "Mavericks"
Excerpt from .emacs that relates to Ensime and Scala:
(require 'ensime)
(add-hook 'scala-mode-hook 'ensime-scala-mode-hook)
What do I do to get it working correctly?

Related

QuickChick "Error: Could not compile mli file"

I successfully installed coq 8.9.1 and coq-quickchick 1.1.0 with opam 2.0.4 and I'm programming on emacs 26.1.
However, when running a QuickChick command I received the following error:
Error: Could not compile mli file
Any ideas of what I can do?
Also, I have tried to include the following command before the QuickChick command:
"QuickChickDebug Debug On."
Still, no success and no instructive message was provided.
You can try to manually extract and compile.
A first idea is to replace QuickChick my_prop. with Extraction TestCompile my_prop., which will also try to compile.
There is also Separate Extraction my_prop. (assuming my_prop is an identifier), which just outputs .ml files so you can compile them by hand and see what is wrong.
There are other variants of extraction worth knowing about:
https://coq.inria.fr/distrib/current/refman/addendum/extraction.html#generating-ml-code
Can you compile the file from command line? If you can, you can open emacs from the command line and re-run and see.
BTW, what's your OS? I have the same problem on OS X Catalina and the problem comes from the privacy policy of Catalina I guess.

How to distribute the asdf/quicklisp dependencies along with an app compiled with Embeddable Common Lisp?

I have tried this example ECL repository asdf example , it works fine but it doesn't have any asdf dependencies. If i add
:depends-on (#:inferior-shell)
to example.asd then running the compiled standalone executable gives this error:
Condition of type: SIMPLE-PACKAGE-ERROR
There exists no package with name "ASDF/DRIVER"
No restarts available.
What causes this error, and what is the idiomatic way of dealing with asdf dependencies on ECL ?
EDIT: this problem is fixed for ECL newer than 16.1.3 (fixed in develop branch), so no `require' trick should be needed in the upcoming release.
In general path you have taken is correct.
Make sure, that you have required the ASDF:
(require 'asdf)
(find-package "ASDF/DRIVER")
Then "ASDF/DRIVER" package is defined. On the other hand inferior-shell requires a few other libraries (alexandria for instance), so you have to put the path to them in the ASDF central registry or use the Quicklisp bundles.
More detailed info about building with ECL is available in its Documentation.
// EDIT
After investigation it appears that ASDF has to be manually required at the program start. It is probably a bug. As a workaround add
:prologue-code '(require 'asdf)
to the (asdf:make-build …) for standalone executable. Everything works fine then.

Ensime inferior scala mode

I've setup Emacs + Ensime for scala.
I'm able to start sbt console inside emacs using C-c C-v s
If i start scala console inside emacs using C-c C-v z, I get the following error
Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_33).
scala>
Failed to initialize compiler: class scala.reflect.BeanInfo not found
What is the fix for this error? How do i get scala console running inside Emacs?
I've ran into a similar error recently, but here's how I worked around it (but I don't know how to fix it, so this is only half the answer). What I did was to customize the ensime-inf-default-cmd-line variable to have the value: '("sbt" "console"). Which will indeed start the interactive Scala environment.
EDIT:
Here's relevant parts from .emacs, but I'm not sure it will matter / will be the same in every install:
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
;;
;; more stuff ...
;; I'm not sure this line is correct / makes any difference
'(ensime-inf-cmd-template (quote ("sbt" "console" "-classpath" :classpath)))
;; This variable is used to launch the interpreter
'(ensime-inf-default-cmd-line (quote ("sbt" "console"))))
(require 'scala-mode2)
(add-to-list 'auto-mode-alist '("\\.scala$" . scala-mode))
(add-to-list 'load-path "~/.emacs.d/ensime/elisp/")
(require 'ensime)
(add-hook 'scala-mode-hook 'ensime-scala-mode-hook)
I've installed scala-mode2 from MELPA. Installed sbt version 0.12.0 by downloading an RPM from their site. I had previously JRE and JDK installed, the active version is OpenJDK 1.7. Scala installed is 2.9.2. I don't know how to identify Ensime's version :|

Error running ensime-source-buffer-loaded-hook - OSX with ENSIME and Emacs

I get the following error when trying to start ENSIME on OSX through Emacs
Error running ensime-source-buffer-loaded-hook
I am following the instructions from the github source page
Scala Mode is Working
ENSIME Server appears to be installed, is there any way to verify this?
The sbt plugin is installed and I have a .ensime config file generated
Starting Emacs gives me the above error. When I manually try M-x ensime I get the following:
Failed to connect to Swank: server process exited.
Okay, here's how I solved it:
Locate the ensime folder and run bin/server /tmp/ensime.port.
I got the error:
java -classpath ... org.ensime.server.Server ./port
Unrecognized VM option '+DoEscapeAnalysis'
Could not create the Java virtual machine.
I have no idea what DoEscapeAnalysis is for, but I tried deleting it from bin/server and now everything seems to work.
See here: https://gist.github.com/2300737
For my case on Windows 7, with the same error message, but the root cause was the original setting for the maximum heap size -Xmx1512M was too large, I had to change to -Xmx768M to get over the error message.
I had also removed the byte compiled elisp code, and restart to avoid another error of
"call time out".
I also had this error on linux with emacs 24.3.1 and resolved it by specifying the full path to java in bin/server.

How to compile CEDET 1.0pre7 compilation for Emacs 23.1.50 on Windows?

I'm trying to compile CEDET from CVS for Emacs 23.1.50 on Windows and I've got error on "Step 6: Turning on EDE...": "defvar: Symbol's value as variable is void: cedet-menu-map". Compilation of CEDET 1.0pre6 raises the same error.
CEDET has been integrated into Emacs after 23 was released. As such, you don't need to compile CEDET for your Emacs, you just need to turn it on. In such a version of Emacs, the only difference from the install instructions from CEDET is that you don't need to load cedet.el, and you do need to turn on (semantic-mode 1) to do what cedet.el used to do.