Git Product home page Git Product logo

alchemist.vim's Introduction

Hi there, I'm Milad!


twitter    youtube

alchemist.vim's People

Contributors

adrianschneider avatar alepipe avatar arcseldon avatar bees avatar c-brenn avatar carloslima avatar glittershark avatar gmcabrita avatar joshrieken avatar jrowlingson avatar juanperi avatar latal avatar leocamelo avatar linduxed avatar minijackson avatar paulnice avatar serkan-devel avatar slashmili avatar sztheory avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alchemist.vim's Issues

NameError: name 'raw_input' is not defined

OS X, Python 2.7.11
got this when using K to get ExDoc on function

Traceback (most recent call last):
  File "/Users/alexander/.vim/plugged/alchemist.vim/after/../alchemist_client", line 79, in <module>
    main(sys.argv[1:])
  File "/Users/alexander/.vim/plugged/alchemist.vim/after/../alchemist_client", line 58, in main
    cmd = raw_input()
NameError: name 'raw_input' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/alexander/.vim/plugged/alchemist.vim/after/../alchemist_client", line 81, in <module>
    print("error: %s" % e.message)

support for umbrella project

When a vim session is opened under an app directory, alchemist-server should run the server for whole project.

a possible solution is to always look for two directory up and check if mix.exs exists.

Navigate to the definition of a macro imported function

Hi,

Alchemist's "go to definition" for my project's functions/modules work just fine.

But looking at the following piece of code:

def changeset(struct, params \\ %{}) do
    struct
    |> cast(params, [:name, :content, :post_id])
    |> validate_required([:name, :content, :post_id])
end

If I press ctrl+] on top of either "cast", "validate_required" or "struct" I get a E426: Tag not found.

Any idea how to fix this?

MacOS 10.12.1
ViM 8.0.52
Elixir 1.3.4

Which Elixir?
/usr/local/bin/elixir

Installed using homebrew

Add <buffer> to all mappings

Currently mappings such as and <C-]> are done without the modifier so they modify behavior even for non-elixir buffers. One place this is noticable is in vim's :help where <C-]> on a link no longer works.

full path

get full path of elixir project directory

ansi escape codes in docs

When I run :ExDoc Enum I get

screen shot 2017-02-06 at 4 01 15 am

Why are all those escape characters there? I don't have AnsiEsc installed but it's an optional plugin, I should be able to read the docs without it installed.

Remote Alchemist Server

I run my applications inside Docker containers, which means that deps and _build aren't available to vim.

Is there a way to run this plugin, but ask it to speak to another alchemist server over a socket / port combination?

Thanks

Python error when using plugin functions

When I try to use any of the functionality of the plugin, such as get_doc or jump to definition, I get this python traceback:

Traceback (most recent call last):                                                           
  File "/home/alex/.config/nvim/plugged/alchemist.vim/after/../alchemist_client", line 77, in
 <module>                                                                                    
    main(sys.argv[1:])                                                                       
  File "/home/alex/.config/nvim/plugged/alchemist.vim/after/../alchemist_client", line 68, in
 main                                                                                        
    a = AlchemistClient(debug=debug, cwd=cwd, ansi=ansi, alchemist_script=alchemist_script, s
ource=source)                                                                                
  File "/home/alex/.config/nvim/plugged/alchemist.vim/alchemist.py", line 16, in __init__    
    self._cwd = self.get_project_base_dir()                                                  
  File "/home/alex/.config/nvim/plugged/alchemist.vim/alchemist.py", line 372, in get_project
_base_dir                                                                                    
    running_servers_logs = os.listdir(self._get_tmp_dir())                                   
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/alex/alchemist_server' 

I am opening neovim from the root of a Phoenix project.

This occurs:

  • on both Arch Linux and Mac
  • even with a base neovim and system installation (on a VM) using only the vim-elixir and alchemist.vim plugins.
  • with both python 2 and 3.

ExDef tag not found

I'm trying to use the jump to tag definition in alchemist, but when I run :ExDef I get a tag not found error on every tag that I try. Here is my alchemist config and a gif of the error:

let g:alchemist#elixir_erlang_src = '/usr/local/share/src'
autocmd FileType elixir nmap <buffer> gd <c-]>

Credo support

mix credo --format flycheck <filename>

We can show the result in Quickfix window

Auto complete issue

These case don't work as I expect:

Sys^X^O

Returns only SystemLimitError.

System.get_

Returns get_env/0 and get_pid/0. And doesn't show get_env/1

Incompatible with YouCompleteMe ?

Not sure if this happened to other folks using both YouCompleteMe.vim and alchemist.vim, but YCM complained this to me when pressing List.:

Omnifunc returned bad value to YCM! Omnifunc did not return a list or a dict with a "words" list when expected.

screen shot 2016-04-14 at 4 37 20 pm

Plugin list:

Plug 'vim-ruby/vim-ruby'
Plug 'elixir-lang/vim-elixir'
Plug 'slashmili/alchemist.vim'
Plug 'vim-erlang/vim-erlang-runtime'
Plug 'vim-erlang/vim-erlang-compiler'
Plug 'vim-erlang/vim-erlang-omnicomplete'
Plug 'vim-erlang/vim-erlang-tags'
Plug 'ten0s/syntaxerl'
Plug 'pangloss/vim-javascript'
Plug 'elmcast/elm-vim'
Plug 'mustache/vim-mustache-handlebars'
Plug 'fatih/vim-go'
Plug 'guns/vim-clojure-static'
Plug 'kchmck/vim-coffee-script'
Plug 'mxw/vim-jsx'
Plug 'othree/html5.vim'
Plug 'hail2u/vim-css3-syntax'
Plug 'groenewege/vim-less'
Plug 'larrylv/ShowMarks'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'ivalkeen/vim-ctrlp-tjump'
Plug 'tpope/vim-ragtag'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-obsession'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-markdown'
Plug 'tpope/vim-speeddating'
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-haml'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-vinegar'
Plug 'tpope/vim-rbenv'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-projectionist'
Plug 'tpope/vim-rsi'
Plug 'Valloric/YouCompleteMe' ", { 'do': './install.py --clang-completer' }
Plug 'SirVer/ultisnips'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/syntastic'
Plug 'tomtom/tcomment_vim'
Plug 'skalnik/vim-vroom'
Plug 'honza/vim-snippets'
Plug 'janko-m/vim-test'
Plug 'terryma/vim-multiple-cursors'
Plug 'mileszs/ack.vim'
Plug 'itchyny/lightline.vim'
Plug 'godlygeek/tabular'
Plug 'tudorprodan/html_annoyance.vim'
Plug 'majutsushi/tagbar'
Plug 'airblade/vim-gitgutter'
Plug 'ervandew/supertab'
Plug 'kana/vim-textobj-user'
Plug 'nelstrom/vim-textobj-rubyblock'
Plug 'jwhitley/vim-colors-solarized'
Plug 'Raimondi/delimitMate'
Plug 'mattn/webapi-vim'
Plug 'mattn/gist-vim'
Plug 'benmills/vimux'
Plug 'eapache/rainbow_parentheses.vim'
Plug 'jlanzarotta/bufexplorer'
Plug 'vim-scripts/matchit.zip'
Plug 'vim-scripts/BufOnly.vim'
Plug 'thinca/vim-ref'
Plug 'mhinz/vim-startify'
Plug 'powerman/vim-plugin-AnsiEsc'

By the way, thanks for this plugin, it's super useful for Elixir development!

iex integration

Support :IEx command

If it’s running in neovim, it should run :terminal iex -S mix
if it’s running in vim, should check for ConqueTerm plugin if exists, run :ConqueTerm iex -S mix or show a message that you need that plugin

Allow to jump through navigation

It would be great if, like in the vim help, you could jump through documentation. For example, if viewing the documentation for Enum

* Enum

Provides a set of algorithms that enumerate over enumerables according
to the `Enumerable` protocol.

    iex> Enum.map([1, 2, 3], fn(x) -> x * 2 end)
    [2, 4, 6]

It would be great if can put your cursor on map and bring up the Enum.map documentation. Currently, using K, this does not work as vim attempts to find a man entry.

Check Alchemist required plugin

alchemist#check() function(not sure about the name)

It should check for various settings and report the result and give suggestion

  • PING alchemist server
  • Check for AnsiEsc/markdown plugin
  • Check for IEx integration and required plugin
  • Check for Credo
  • ...

Homebrew elixir path for Jump to definition

Is there anyway to set the path for the jump to definition as stated in the wiki for a Homebrew installed Elixir? I might just be missing something with Homebrew, but it seems that it just keeps the binaries not the source, so I can't figure out how to set the path for this.

Is there a simple solution for this, or is this something that's not currently implemented?

After sometime 6b763e9 alchemist began starting an app

After updating alchemist to the current master I've noticed a weird behavior: my app listens on a network port and after I type something in .ex file in vim mix test in a terminal fails with eaddrinuse. :Mix test right in vim works fine, though. It seems like alchemist (or maybe vim itself) starts mix and leaves it dangling.

On 6b763e9 everything works fine, every commit after triggers that issue. Unfortunately, I was not able to pinpoint the exact commit causing it. MacVim 8 (124), OS X Sierra.

Todo List

alchemist_client

  • get tmp dir
  • add unit test
  • set timeout for socket recv
  • find the base project dir(finding already running server/looking for mix.exs/...)
  • get full path of elixir project directory
  • rewrite in elixir (canceled)
  • write the autocomplete rules in the client

vim plugin

  • support auto complete for erlang modules(they start with :)
  • find a way to show document without creating tmp file
  • prevent toggling AnsiEsc
  • shift+k on module should show the module document
  • parse the current file and find all the alias and send it to alchemist
  • Detect the module that we are in
  • parse the current file and find the imported modules
  • Detect the modules that we are in and the alias and imported modules inside the module
  • be able to autocomplete current module functions
  • implement g] to jump to definition
  • Support alias for erlang module
  • support mix commands
  • support completion for :ExDoc
  • iex integration
  • Added omni search results to popupmenu-completion(canceled)
  • showing information about about data type
  • showing Function/Arity Types Information

Issue with ExDoc and no completion in Deoplete

Hi !
So, I suppose I did something wrong or missed something, but I just follow the doc to install everything, do a PluginInstall, PluginUpdate.. Then I wanted to try by editing an .ex file and I notice that nothing change in deoplete, so I try to use ExDoc by typing K, I'v got this message:

Traceback (most recent call last):
  File "/home/kiukisas/.config/nvim/plugins/alchemist.vim/after/../alchemist_client", line 77, in <module>
    main(sys.argv[1:])
  File "/home/kiukisas/.config/nvim/plugins/alchemist.vim/after/../alchemist_client", line 69, in main
    print(a.process_command(cmd), end="")
  File "/home/kiukisas/.config/nvim/plugins/alchemist.vim/alchemist.py", line 52, in process_command
    sock = self._connect(connection)
  File "/home/kiukisas/.config/nvim/plugins/alchemist.vim/alchemist.py", line 125, in _connect
    sock.connect(host_port)

So.. a alchemist connection problem maybe ?

Also, from the wiki:

auto complete and jump to definition only works if your project or newly added file has been compiled

I tried again after a mix compile in my project but nothing change.. Did I do something wrong ?
I'm on Arch Linux and I have python2.7 and python3.6 btw.

make :Mix task detect project root?

it is (extremely) inconvenient that :Mix something cannot itself find project root and execute it from top directory.

Question - I see functionality is present in python. Should I

  1. write it using python integration (this requires vim compiled with python)
  2. rewrite with vimscript ?
  3. create separate program like 'alchemist_client' which will expose that call to vimscript?

Does this work in Windows?

I've been trying to get it to work on Windows for a day now. Being new to Vim doesn't help, but I am noticing some problems such as "/" vs "" and the alchemist_client file having a shebang which isn't recognized by Windows.

Is this meant to support Windows?

Autocomplete issue in Mix projects.

I don't know if there a bug in alchemist.vim plugin or this is an expected behavior of vim, however I found this issue using this plugin. Shortly, when I launch vim and execute :cd into my project, then autocomplete for Elexir stdlib works fine, but it doesn't work for my project modules and it dependencies. When I launch vim from project directory then everything works fine.

implement xref

The idea is to use xref to find the places that a given module/function is used and helps users to refactor a code!

alchemist-server doesn't support xref yet, need to implement the base there first.

it should work like this:

:ExRef MyApp.Repo -> open a window that list of files that uses this module
:ExRef MyApp.User.changeset -> open a window that list of files that uses this function

Running `Mix test` does not run from project root

Steps to reproduce:

  • Generate a project with mix
  • Open a test file in test
  • Run :Mix test

Expected outcome is the test should run.


I may not be using alchemist.vim right 😄, opening this issue to clarify or see if it can be fixed.

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.