Dear all
I apologize if this has already been discussed elsewhere but I did not come up with a solution.
I installed the melpa version of eglot eglot-jl 20221128.1655
but it has some issues:
Each time I open a .jl
file (either in a project or in an βisolatedβ file), to start the eglot server I need to always do a M-x eglot-jl-init
and a M-x eglot
. Then thinks works (almost see point 2). Is it possible to automatize the process such that each time I open a .jl
file I automatically start the process without typing each time M-x eglot-jl-init
, M-x eglot
?
The autocomplete feature does not work. I understand that the first time should take some minutes, but even after half an hour, there are no positive signs.
Possibly relevant info about my installation. I am on Mac OS X and using Emacs for Mac last version (28.2).
https://emacsformacosx.com/
This is the portion of my .emacs
setup (I do not entirely understand what it is doing: just blindly copied from snippets on this thread)
(require 'yasnippet)
(use-package julia-mode
:mode "\\.jl\\'"
:interpreter ("julia" . julia-mode)
:init (setenv "JULIA_NUM_THREADS" "6")
:config
(add-hook 'julia-mode-hook 'julia-repl-mode)
(add-hook 'julia-mode-hook 'eglot-jl-init)
(add-hook 'julia-mode-hook 'eglot-ensure)
(add-hook 'julia-mode-hook 'company-mode)
(add-hook 'julia-mode-hook (lambda () (setq julia-repl-set-terminal-backend 'vterm)))
(add-hook 'julia-mode-hook (lambda () (setq julia-repl-set-terminal-backend 'vterm)))
(add-hook 'julia-mode-hook (lambda () (setq julia-repl-set-terminal-backend 'vterm))))
(use-package julia-repl)
(setq eglot-jl-julia-command "/Applications/Julia-1.8.app/Contents/Resources/julia/bin/julia")
(setq julia-repl-executable-records
'((default "/Applications/Julia-1.8.app/Contents/Resources/julia/bin/julia")
(master "/Applications/Julia-1.8.app/Contents/Resources/julia/bin/julia")))
Andrea_Pagnani:
Each time I open a .jl
file (either in a project or in an βisolatedβ file), to start the eglot server I need to always do a M-x eglot-jl-init
and a M-x eglot
. Then thinks works (almost see point 2). Is it possible to automatize the process such that each time I open a .jl
file I automatically start the process without typing each time M-x eglot-jl-init
, M-x eglot
?
I donβt immediately see any gross mistake in your init.el
stanza; it should already start eglot
automatically. Could please start a fresh Emacs, open a .jl
file in it and look for a buffer called something like *EGLOT (xxx/julia-mode) events*
?
If that buffer exists, it means that eglot
did start. In that case, it will be interesting to see the beginning of the contents of that buffer, between the first line (it should start with [internal]
) and the first server reply (it should be marked by a line starting with [server-reply] (id:1)
).
Hopefully the same *EGLOT events*
buffer will have some info regarding this issue. Look for lines starting with [stderr]
, especially if they look like julia error messages or stack traces.
Judging by the paths set in your init file, Iβm assuming you use Julia 1.8?
Thanks, @ffevotte for your reply. Yes I am using julia 1.8.2. WRT to you questions:
If I start a .jl
nothing happens although the file is correctly recognized as a julia file (highlighting colors etc β¦ see image below)
snapshot of my emacs window
But there is no eglot buffer.
Below you can find the first part of the *EGLOT buffer obtained after the usual M-x eglot-jl-init
and M-x eglot
. To wrap up I am not able to start automatically the process.
Output in *EGLOT buffer
[internal] Tue Dec 6 09:06:49 2022:
(:message "Running language server: (/Applications/Julia-1.8.app/Contents/Resources/julia/bin/julia --startup-file=no --project=/Users/pagnani/.emacs.d/elpa/eglot-jl-20221128.1655/ /Users/pagnani/.emacs.d/elpa/eglot-jl-20221128.1655/eglot-jl.jl /Users/pagnani/CODE/ArDCA/src/ )")
[client-request] (id:1) Tue Dec 6 09:06:49 2022:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
(:processId 1072 :rootPath "/Users/pagnani/CODE/ArDCA/" :rootUri "file:///Users/pagnani/CODE/ArDCA" :initializationOptions #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
())
:capabilities
(:workspace
(:applyEdit t :executeCommand
(:dynamicRegistration :json-false)
:workspaceEdit
(:documentChanges t)
:didChangeWatchedFiles
(:dynamicRegistration t)
:symbol
(:dynamicRegistration :json-false)
:configuration t :workspaceFolders t)
:textDocument
(:synchronization
(:dynamicRegistration :json-false :willSave t :willSaveWaitUntil t :didSave t)
:completion
(:dynamicRegistration :json-false :completionItem
(:snippetSupport :json-false :deprecatedSupport t :tagSupport
(:valueSet
[1]))
:contextSupport t)
:hover
(:dynamicRegistration :json-false :contentFormat
["plaintext"])
:signatureHelp
(:dynamicRegistration :json-false :signatureInformation
(:parameterInformation
(:labelOffsetSupport t)
:activeParameterSupport t))
:references
(:dynamicRegistration :json-false)
:definition
(:dynamicRegistration :json-false :linkSupport t)
:declaration
(:dynamicRegistration :json-false :linkSupport t)
:implementation
(:dynamicRegistration :json-false :linkSupport t)
:typeDefinition
(:dynamicRegistration :json-false :linkSupport t)
:documentSymbol
(:dynamicRegistration :json-false :hierarchicalDocumentSymbolSupport t :symbolKind
(:valueSet
[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26]))
:documentHighlight
(:dynamicRegistration :json-false)
:codeAction
(:dynamicRegistration :json-false :codeActionLiteralSupport
(:codeActionKind
(:valueSet
["quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"]))
:isPreferredSupport t)
:formatting
(:dynamicRegistration :json-false)
:rangeFormatting
(:dynamicRegistration :json-false)
:rename
(:dynamicRegistration :json-false)
:publishDiagnostics
(:relatedInformation :json-false :codeDescriptionSupport :json-false :tagSupport
(:valueSet
[1 2])))
:experimental #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
()))
:workspaceFolders
[(:uri "file:///Users/pagnani/CODE/ArDCA" :name "~/CODE/ArDCA/")]))
[stderr] No Changes to `~/.emacs.d/elpa/eglot-jl-20221128.1655/Project.toml`
[stderr] No Changes to `~/.emacs.d/elpa/eglot-jl-20221128.1655/Manifest.toml`
[stderr] [ Info: Environment successfully resolved
[stderr] β Info: Running language server
[stderr] β env = "/Users/pagnani/.emacs.d/elpa/eglot-jl-20221128.1655/Project.toml"
[stderr] β src_path = "/Users/pagnani/CODE/ArDCA/src/"
[stderr] β project_path = "/Users/pagnani/CODE/ArDCA"
[stderr] β depot_path = ""
This is the output in the *EGLOT buffer when I start typing (and hopefully autocompleting) some code
stderr line in *EGLOT buffer
[stderr] [ Info: Successfully downloaded, scrubbed and saved ChainRules
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved LogExpFunctions
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved NLSolvers
[stderr] [ Info: Downloading caches...
[stderr] β Info: Couldn't retrieve cache file for MuladdMacro.
[stderr] β exception = HTTP/1.1 404 Not Found while requesting https://www.julia-vscode.org/symbolcache/store/v1/packages/M/MuladdMacro_46d2c3a1-f734-5fdb-9937-b9b9aeba4221/v0.2.4_cac9cc5499c25554cba55cd3c30543cff5ca4fab.tar.gz
[stderr] [ Info: Downloading caches...
[stderr] β Info: Couldn't retrieve cache file for JuliaInterpreter.
[stderr] β exception = HTTP/1.1 404 Not Found while requesting https://www.julia-vscode.org/symbolcache/store/v1/packages/J/JuliaInterpreter_aa1ae85d-cabe-5617-a682-6adf51b2e16a/v0.9.16_a79c4cf60cc7ddcdcc70acbb7216a5f9b4f8d188.tar.gz
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved Distributions
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved PositiveFactorizations
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved SpecialFunctions
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved SpecializeVarargs
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved ExprTools
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved DiffRules
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved ChainRulesCore
[stderr] [ Info: Downloading caches...
[stderr] β Info: Couldn't retrieve cache file for Compat.
[stderr] β exception = HTTP/1.1 404 Not Found while requesting https://www.julia-vscode.org/symbolcache/store/v1/packages/C/Compat_34da2185-b29b-5c13-b0c7-acf172513d20/v4.5.0_00a2cccc7f098ff3b66806862d275ca3db9e6e5a.tar.gz
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved StaticArrays
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved ForwardDiff2
[stderr] [ Info: Downloading caches...
[stderr] β Info: Couldn't retrieve cache file for RecipesBase.
[stderr] β exception = HTTP/1.1 404 Not Found while requesting https://www.julia-vscode.org/symbolcache/store/v1/packages/R/RecipesBase_3cdcf5f2-1ef4-517c-9805-6587b60abb01/v1.3.2_18c35ed630d7229c5584b945641a73ca83fb5213.tar.gz
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved FillArrays
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved StatsFuns
[stderr] [ Info: Downloading caches...
[stderr] β Info: Couldn't retrieve cache file for Cassette.
[stderr] β exception = HTTP/1.1 404 Not Found while requesting https://www.julia-vscode.org/symbolcache/store/v1/packages/C/Cassette_7057c7e9-c182-5462-911a-8362d720325c/v0.3.11_a70f220ea09ec61401745ff338f8fb340420165c.tar.gz
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved IterativeSolvers
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved Reexport
[stderr] [ Info: Downloading caches...
[stderr] β Info: Couldn't retrieve cache file for CodeTracking.
[stderr] β exception = HTTP/1.1 404 Not Found while requesting https://www.julia-vscode.org/symbolcache/store/v1/packages/C/CodeTracking_da1fd8a2-8d9e-5ec2-8556-3022fb5608a2/v1.1.1_cc4bd91eba9cdbbb4df4746124c22c0832a460d6.tar.gz
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved StaticArraysCore
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved NaNMath
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved DocStringExtensions
[stderr] [ Info: Downloading caches...
[stderr] [ Info: Successfully downloaded, scrubbed and saved DiffResults
[stderr] [ Info: All cache files downloaded.
[stderr] [ Info: Loading QuadGK from cache...
[stderr] [ Info: Loading DataStructures from cache...
[stderr] β Warning: Compat not stored on disc
[stderr] β @ SymbolServer ~/.julia/packages/SymbolServer/LMSFX/src/SymbolServer.jl:247
[stderr] [ Info: Loading InteractiveUtils from cache...
[stderr] [ Info: Loading Markdown from cache...
[stderr] [ Info: Loading Base64 from cache...
[stderr] [ Info: Loading OrderedCollections from cache...
[stderr] [ Info: Loading LinearAlgebra from cache...
[stderr] β Warning: libblastrampoline_jll not stored on disc
[stderr] β @ SymbolServer ~/.julia/packages/SymbolServer/LMSFX/src/SymbolServer.jl:247
[stderr] [ Info: Loading Libdl from cache...
[stderr] [ Info: Loading ForwardDiff2 from cache...
[stderr] [ Info: Loading StaticArrays from cache...
[stderr] [ Info: Loading Statistics from cache...
[stderr] [ Info: Loading SparseArrays from cache...
[stderr] [ Info: Loading Random from cache...
[stderr] [ Info: Loading Serialization from cache...
[stderr] [ Info: Loading SHA from cache...
[stderr] [ Info: Loading SpecializeVarargs from cache...
[stderr] [ Info: Loading ExprTools from cache...
[stderr] [ Info: Loading ChainRulesCore from cache...
[stderr] β Warning: MuladdMacro not stored on disc
[stderr] β @ SymbolServer ~/.julia/packages/SymbolServer/LMSFX/src/SymbolServer.jl:247
[stderr] β Warning: Cassette not stored on disc
[stderr] β @ SymbolServer ~/.julia/packages/SymbolServer/LMSFX/src/SymbolServer.jl:247
[stderr] [ Info: Loading ChainRules from cache...
[stderr] [ Info: Loading Requires from cache...
[stderr] [ Info: Loading UUIDs from cache...
[stderr] [ Info: Loading Reexport from cache...
[stderr] [ Info: Loading Pkg from cache...
[stderr] [ Info: Loading Downloads from cache...
[stderr] [ Info: Loading LibCURL from cache...
[stderr] [ Info: Loading MozillaCACerts_jll from cache...
[stderr] [ Info: Loading LibCURL_jll from cache...
[stderr] β Warning: LibSSH2_jll not stored on disc
[stderr] β @ SymbolServer ~/.julia/packages/SymbolServer/LMSFX/src/SymbolServer.jl:247
[stderr] β Warning: MbedTLS_jll not stored on disc
[stderr] β @ SymbolServer ~/.julia/packages/SymbolServer/LMSFX/src/SymbolServer.jl:247
[stderr] [ Info: Loading nghttp2_jll from cache...
[stderr] [ Info: Loading Artifacts from cache...
[stderr] β Warning: Zlib_jll not stored on disc
[stderr] β @ SymbolServer ~/.julia/packages/SymbolServer/LMSFX/src/SymbolServer.jl:247
[stderr] [ Info: Loading NetworkOptions from cache...
[stderr] [ Info: Loading FileWatching from cache...
[stderr] [ Info: Loading ArgTools from cache...
[stderr] [ Info: Loading Tar from cache...
[stderr] [ Info: Loading REPL from cache...
[stderr] [ Info: Loading Sockets from cache...
[stderr] [ Info: Loading Unicode from cache...
[stderr] [ Info: Loading LibGit2 from cache...
[stderr] [ Info: Loading Printf from cache...
[stderr] [ Info: Loading Dates from cache...
[stderr] [ Info: Loading p7zip_jll from cache...
[stderr] [ Info: Loading Logging from cache...
[stderr] [ Info: Loading TOML from cache...
[stderr] [ Info: Loading ForwardDiff from cache...
[stderr] [ Info: Loading LogExpFunctions from cache...
[stderr] [ Info: Loading IrrationalConstants from cache...
[stderr] [ Info: Loading DocStringExtensions from cache...
[stderr] [ Info: Loading DiffResults from cache...
[stderr] [ Info: Loading StaticArraysCore from cache...
[stderr] [ Info: Loading CommonSubexpressions from cache...
[stderr] [ Info: Loading Test from cache...
[stderr] [ Info: Loading MacroTools from cache...
[stderr] [ Info: Loading DiffRules from cache...
[stderr] [ Info: Loading SpecialFunctions from cache...
[stderr] [ Info: Loading OpenSpecFun_jll from cache...
[stderr] [ Info: Loading JLLWrappers from cache...
[stderr] [ Info: Loading Preferences from cache...
[stderr] [ Info: Loading CompilerSupportLibraries_jll from cache...
[stderr] [ Info: Loading NaNMath from cache...
[stderr] [ Info: Loading Distributions from cache...
[stderr] [ Info: Loading PDMats from cache...
[stderr] [ Info: Loading SuiteSparse from cache...
[stderr] [ Info: Loading StatsBase from cache...
[stderr] [ Info: Loading SortingAlgorithms from cache...
[stderr] [ Info: Loading Missings from cache...
[stderr] [ Info: Loading DataAPI from cache...
[stderr] [ Info: Loading StatsAPI from cache...
[stderr] [ Info: Loading StatsFuns from cache...
[stderr] [ Info: Loading Rmath from cache...
[stderr] [ Info: Loading Rmath_jll from cache...
[stderr] [ Info: Loading FillArrays from cache...
[stderr] [ Info: Loading NLSolvers from cache...
[stderr] [ Info: Loading IterativeSolvers from cache...
[stderr] β Warning: RecipesBase not stored on disc
[stderr] β @ SymbolServer ~/.julia/packages/SymbolServer/LMSFX/src/SymbolServer.jl:247
[stderr] [ Info: Loading PositiveFactorizations from cache...
[stderr] [ Info: Loading PyPlot from cache...
[stderr] [ Info: Loading VersionParsing from cache...
[stderr] [ Info: Loading Colors from cache...
[stderr] [ Info: Loading ColorTypes from cache...
[stderr] [ Info: Loading FixedPointNumbers from cache...
[stderr] [ Info: Loading PyCall from cache...
[stderr] [ Info: Loading Conda from cache...
[stderr] [ Info: Loading JSON from cache...
[stderr] [ Info: Loading Parsers from cache...
[stderr] [ Info: Loading SnoopPrecompile from cache...
[stderr] [ Info: Loading Mmap from cache...
[stderr] [ Info: Loading LaTeXStrings from cache...
[stderr] [ Info: Loading Revise from cache...
[stderr] [ Info: Loading LoweredCodeUtils from cache...
[stderr] β Warning: JuliaInterpreter not stored on disc
[stderr] β @ SymbolServer ~/.julia/packages/SymbolServer/LMSFX/src/SymbolServer.jl:247
[stderr] [ Info: Loading Distributed from cache...
[stderr] β Warning: CodeTracking not stored on disc
[stderr] β @ SymbolServer ~/.julia/packages/SymbolServer/LMSFX/src/SymbolServer.jl:247
[stderr] [ Info: Loading BenchmarkTools from cache...
[stderr] [ Info: Loading Profile from cache...
[stderr] [ Info: Received new data from Julia Symbol Server.
[server-notification] Tue Dec 6 09:18:07 2022:
(:method "textDocument/publishDiagnostics" :params
Thanks a lot for your help
A
Try running manually in your newly opened julia-mode buffer:
M-x eglot-jl-init
M-x eglot
M-x company-mode
If that fixes autocompletion, then it means the problem entirely comes from things not starting automatically like they should.
Now to investigate why things are not automatic, take a look at the value of the julia mode hook:
C-h v julia-mode-hook
RET
Thanks @ffevotte β¦ now everything works
I am ashamed to tell you that I realized I did not install company
. That somehow screwed up the whole auto-loading thing. Now everything works smoothly.
Sorry for the noise.
A
1 Like