GithubHelp home page GithubHelp logo

trevoke / alchemist.el Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tonini/alchemist.el

5.0 5.0 2.0 6.08 MB

Elixir Tooling Integration Into Emacs

Home Page: http://www.alchemist-elixir.org

Emacs Lisp 97.32% Makefile 0.69% Elixir 0.89% Batchfile 0.24% Shell 0.87%

alchemist.el's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

erikbye simmsb

alchemist.el's Issues

Constant heredoc warnings

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)

lsp-imenu unable to load

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:

  1. Start Emacs

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)

BUG - wront-type-argument sequencep 62

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:

  • Cloned alchemist.el from this repo on ~/.alchemist.el
  • Have this on my init.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

  • Emacs 26.1
  • Elixir 1.7.3
  • Erlang 21
  • Linux amd_64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.