trevoke / alchemist.el Goto Github PK
View Code? Open in Web Editor NEWThis project forked from tonini/alchemist.el
Elixir Tooling Integration Into Emacs
Home Page: http://www.alchemist-elixir.org
This project forked from tonini/alchemist.el
Elixir Tooling Integration Into Emacs
Home Page: http://www.alchemist-elixir.org
Company: backend company-lsp error "Wrong type argument: lsp--workspace, nil" with args (prefix)
@dsdshcym reported this:
Describe the bug
Whenever I move my cursor inside of a heredoc (even when it is correctly aligned) I get the following message a whole bunch of times (more than the 2 occurrences shown here).
warning: outdented heredoc line. The contents inside the heredoc should be indented at the same level as the closing """. The following is forbidden:
def text do
"""
contents
"""
end
Instead make sure the contents are indented as much as the heredoc closing:
def text do
"""
contents
"""
end
The current heredoc line is indented too little
nofile:18
[2 times]
To Reproduce
Create a heredoc and place your cursor in it and move it around. Hard to say if this will be reproducible elsewhere :(
Setup
I'm using spacemacs. OTP version 20. I have excluded alchemist
from the packages brought in by layers, and then I've added:
(push "~/spacemacs_plugins/alchemist.el" load-path)
(require 'alchemist-elixir-ls)
(require 'alchemist-goto)
(require 'alchemist)
Describe the bug
When starting emacs (using Spacemacs) I get the following error:
(Spacemacs) Error in dotspacemacs/user-config: Cannot open load file: No such file or directory, lsp-imenu
To Reproduce
Steps to reproduce the behavior:
Setup
Emacs 26.1
Additional context
I think maybe we just need to lock the version of lsp-imenu? Would it make sense to add lsp-imenu to this list
;; Package-Requires: ((lsp-mode "4.2") (lsp-ui "20181001.1747") (elixir-mode "2.2.5") (dash "2.11.0") (emacs "24.4") (company "0.8.0") (pkg-info "0.4") (s "1.11.0"))
This is my configuration:
(add-to-list 'load-path "~/config/repos/alchemist.el")
(require 'alchemist-elixir-ls)
(require 'alchemist-goto)
(require 'alchemist)
Describe the bug
When navigating through source code sometimes an error occur saying: wrong-type-argument sequencep 62
on lsp--render-on-hover-content. This freezes emacs for a little while (but it recovers after some seconds).
I think this started after some lsp-mode/lsp-ui updates... not sure and not sure how to try a downgrade =/
If this is an lsp-mode error (most likely lsp-ui) then I'll open an issue there. But to me, this seems like a alchemist.el specific issue.
I've enabled debug errors (M-x toggle-debug-on-errors
) and this is the stack trace:
Debugger entered--Lisp error: (wrong-type-argument sequencep 62)
mapconcat(identity (62) "\n")
lsp--render-on-hover-content("> Jason\n\nA blazing fast JSON parser and generator in pure Elixir.\n" #s(lsp--client :language-id #f(compiled-function (_) #<bytecode 0x1928629>) :send-sync nil :send-async nil :type nil :new-connection #f(compiled-function (filter sentinel) #<bytecode 0x19299c9>) :stderr "*lsp-elixir-mode stderr*" :get-root (closure (t) nil (alchemist-project-root-or-default-dir)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x1994601> :request-handlers #<hash-table equal 0/65 0x1ea8485> :response-handlers #<hash-table eql 31/65 0x1ea84a5> :string-renderers nil :last-id 1125 :enable-function lsp-elixir-mode-enable :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x1ea84c5> :action-handlers #<hash-table equal 0/65 0x18a54d1> :default-renderer nil) nil)
#f(compiled-function (hover) #<bytecode 0x1c683e5>)(#<hash-table equal 2/65 0x20db0e1>)
lsp--parser-on-message(#s(lsp--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "" :queued-notifications nil :queued-requests nil :workspace #s(lsp--workspace :parser #1 :file-versions #<hash-table equal 9/65 0x18a551d> :server-capabilities #<hash-table equal 11/65 0x145c095> :registered-server-capabilities nil :root "<</some/path/to/my/project>>" :client #s(lsp--client :language-id #f(compiled-function (_) #<bytecode 0x1928629>) :send-sync nil :send-async nil :type nil :new-connection #f(compiled-function (filter sentinel) #<bytecode 0x19299c9>) :stderr "*lsp-elixir-mode stderr*" :get-root (closure (t) nil (alchemist-project-root-or-default-dir)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x1994601> :request-handlers #<hash-table equal 0/65 0x1ea8485> :response-handlers #<hash-table eql 31/65 0x1ea84a5> :string-renderers nil :last-id 1125 :enable-function lsp-elixir-mode-enable :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x1ea84c5> :action-handlers #<hash-table equal 0/65 0x18a54d1> :default-renderer nil) :change-timer-disabled nil :proc #<process lsp-elixir-mode> :cmd-proc #<process lsp-elixir-mode> :buffers (#<buffer conn.ex> <<LIST OF BUFFERS OPENED>>) :highlight-overlays #<hash-table eq 0/65 0x12e71e1> :extra-client-capabilities ((company-lsp . company-lsp--client-capabilities)) :status nil :metadata #<hash-table equal 0/65 0x12e7309> :watches #<hash-table equal 0/65 0x12e7329>)) "{\"id\":1125,\"jsonrpc\":\"2.0\",\"result\":{\"contents\":\"> Jason\\n\\nA blazing fast JSON parser and generator in pure Elixir.\\n\",\"range\":{\"end\":{\"character\":29,\"line\":22},\"start\":{\"character\":24,\"line\":22}}}}\n\n")
#f(compiled-function (proc output) #<bytecode 0x1929849>)(#<process lsp-elixir-mode> "Content-Length: 203\015\n\015\n{\"id\":1125,\"jsonrpc\":\"2.0\",\"result\":{\"contents\":\"> Jason\\n\\nA blazing fast JSON parser and generator in pure Elixir.\\n\",\"range\":{\"end\":{\"character\":29,\"line\":22},\"start\":{\"character\":24,\"line\":22}}}}\015\n\015\n")
To Reproduce
It is hard to say what is triggering this behaviour but here is my setup anyway:
~/.alchemist.el
(use-package alchemist
:after (elixir-mode)
:load-path "../.alchemist" ; Must first clone https://github.com/Trevoke/alchemist.el ont ~/.alchemist
:config
(require 'alchemist-elixir-ls)
(require 'alchemist-goto)
(require 'alchemist)
:init
; I have some custom functions to search for elixir/erlang source on the current version set by asdf
(setq alchemist-goto-erlang-source-dir
(expand-file-name "otp_src" (grab-asdf-plugin-version-path "erlang"))
alchemist-goto-elixir-source-dir (grab-asdf-plugin-version-path "elixir")))
(use-package elixir-mode
:load-path "~/dev/projects/emacs-elixir"
:init
(add-hook 'elixir-mode-hook
(lambda () (add-hook 'before-save-hook 'elixir-format 'local)))
(add-hook 'elixir-format-hook
(lambda ()
(if (projectile-project-p)
(setq elixir-format-arguments
(list "--dot-formatter"
(concat (locate-dominating-file buffer-file-name ".formatter.exs") ".formatter.exs")))
(setq elixir-format-arguments nil))
)))
(use-package company-quickhelp
:after (company)
:ensure t
:init
(setq company-quickhelp-delay 1)
:config
(company-quickhelp-mode))
(use-package lsp-mode
:init (setq lsp-inhibit-message t
lsp-eldoc-render-all nil)
:ensure t)
(use-package lsp-ui
:ensure t
:after (lsp-mode)
:init
(setq lsp-ui-doc-enable nil))
(use-package company-lsp
:ensure t
:after (company)
:config
(add-hook 'java-mode-hook (lambda () (push 'company-lsp company-backends)))
(setq company-lsp-enable-snippet t
company-lsp-cache-candidates t)
(push 'company-lsp company-backends))
Expected behavior
I'd expect for emacs not to freeze
Setup
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.