slashmili/alchemist.vim

Error when work with YouCompleteMe

r2099c2 opened this issue · 1 comments

When I tap . to trigger YCM (YCM use . to trigger elixir by default). I got this error:
Omnifunc returned bad value to YCM! 'str' object does not support item assignment

I use vim-plug.

Plug 'elixir-editors/vim-elixir', { 'for': ['elixir', 'eelixir'] } " elixir
Plug 'slashmili/alchemist.vim', { 'for': ['elixir', 'eelixir'] } " elixir
Plug 'Valloric/YouCompleteMe'


let g:ycm_filetype_whitelist = {
\ "c":1,
\ "cpp":1,
\ "python":1,
\ "sh":1,
\ "jsx": 1,
\ "javascript.jsx": 1,
\ "js": 1,
\ "css": 1,
\ "scss": 1,
\ "less": 1,
\ "elixir": 1
  1. Elixir/OTP/Python version

Elixir: 1.8.1

OTP: 21

Python: 3.7.3

  1. Are you using VIM or Neovim? Please provide the version.
    VIM in iterm2 mac
    version: 8.1.1350

  2. Which pluging are you using:

YouCompleteMe

  1. Which steps of Debugging passed?

[x] Elixir Module definition
[x] Elixir Function definition
[x] Elixir Module/Function docs
[x] Your Project Module definition
[x] Your Project Function definition

  1. Do you have a specific setup? Like Docker and etc
    I use Docker run local PostgreSql. But The project is compiled in my mac.
mix_dir: ['/Users/xunlu/workspace/magic']
column: 6
line: 1
source: Enum.
Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
elixir /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/run.exs unix 0 dev
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



elixir /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/run.exs unix 0 dev
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



elixir /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/run.exs unix 0 dev
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Couldn't find the connection settings from server_log: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
response:
error:Socket is not available.
project_dir(matched): /Users/xunlu/workspace/magic
column: 9
line: 1
source: Enum.map
Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Initializing ElixirSense server for environment "dev" (Elixir version 1.8.1)

Working directory is "/Users/xunlu/workspace/magic"

ok:localhost:/tmp/elixir-sense-xunlu/1560999577883068000.sock

ElixirSense: {u'request_id': 1, u'payload': [{u'type': u'hint', u'value': u'Enum.map'}, {u'origin': u'Enum', u'arity': 2, u'name': u'map', u'args': u'enumerable,fun', u'type': u'function', u'spec': u'@spec map(t, (element -> any)) :: list', u'summary': u'Returns a list where each item is the result of invoking\n`fun` on each corresponding item of `enumerable`.'}, {u'origin': u'Enum', u'arity': 3, u'name': u'map_every', u'args': u'enumerable,nth,fun', u'type': u'function', u'spec': u'@spec map_every(t, non_neg_integer, (element -> any)) :: list', u'summary': u'Returns a list of results of invoking `fun` on every `nth`\nitem of `enumerable`, starting with the first element.'}, {u'origin': u'Enum', u'arity': 3, u'name': u'map_join', u'args': u'enumerable,joiner \\\\ "",mapper', u'type': u'function', u'spec': u'@spec map_join(t, String.t, (element -> String.Chars.t)) :: String.t', u'summary': u'Maps and joins the given `enumerable` in one pass.'}, {u'origin': u'Enum', u'arity': 3, u'name': u'map_reduce', u'args': u'enumerable,acc,fun', u'type': u'function', u'spec': u'@spec map_reduce(t, any, (element, any -> {any, any})) :: {any, any}', u'summary': u'Invokes the given function to each item in the `enumerable` to reduce\nit to a single element, while keeping an accumulator.'}], u'error': None}
response:
kind:f, word:Enum.map, abbr:map(enumerable, fun), menu: Enum, info: @spec map(t, (element -> any)) :: list<n>Returns a list where each item is the result of invoking<n>`fun` on each corresponding item of `enumerable`.
kind:f, word:Enum.map_every, abbr:map_every(enumerable, nth, fun), menu: Enum, info: @spec map_every(t, non_neg_integer, (element -> any)) :: list<n>Returns a list of results of invoking `fun` on every `nth`<n>item of `enumerable`, starting with the first element.
kind:f, word:Enum.map_join, abbr:map_join(enumerable, joiner \\ "", mapper), menu: Enum, info: @spec map_join(t, String.t, (element -> String.Chars.t)) :: String.t<n>Maps and joins the given `enumerable` in one pass.
kind:f, word:Enum.map_reduce, abbr:map_reduce(enumerable, acc, fun), menu: Enum, info: @spec map_reduce(t, any, (element, any -> {any, any})) :: {any, any}<n>Invokes the given function to each item in the `enumerable` to reduce<n>it to a single element, while keeping an accumulator.

project_dir(matched): /Users/xunlu/workspace/magic
column: 14
line: 3
source: Enum.map
CustomModule
CustomModule.
Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Initializing ElixirSense server for environment "dev" (Elixir version 1.8.1)

Working directory is "/Users/xunlu/workspace/magic"

ok:localhost:/tmp/elixir-sense-xunlu/1560999578760817000.sock

ElixirSense: {u'request_id': 1, u'payload': [{u'type': u'hint', u'value': u'CustomModule.'}], u'error': None}
response:

project_dir(matched): /Users/xunlu/workspace/magic
column: 15
line: 3
source: Enum.map
CustomModule
CustomModule.f
Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Initializing ElixirSense server for environment "dev" (Elixir version 1.8.1)

Working directory is "/Users/xunlu/workspace/magic"

ok:localhost:/tmp/elixir-sense-xunlu/1560999578760817000.sock

ElixirSense: {u'request_id': 1, u'payload': [{u'type': u'hint', u'value': u'CustomModule.f'}], u'error': None}
response:

project_dir(matched): /Users/xunlu/workspace/magic
column: 16
line: 3
source: Enum.map
CustomModule
CustomModule.fo
Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Initializing ElixirSense server for environment "dev" (Elixir version 1.8.1)

Working directory is "/Users/xunlu/workspace/magic"

ok:localhost:/tmp/elixir-sense-xunlu/1560999578760817000.sock

ElixirSense: {u'request_id': 1, u'payload': [{u'type': u'hint', u'value': u'CustomModule.fo'}], u'error': None}
response:

project_dir(matched): /Users/xunlu/workspace/magic
column: 17
line: 3
source: Enum.map
CustomModule
CustomModule.foo
Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Initializing ElixirSense server for environment "dev" (Elixir version 1.8.1)

Working directory is "/Users/xunlu/workspace/magic"

ok:localhost:/tmp/elixir-sense-xunlu/1560999578760817000.sock

ElixirSense: {u'request_id': 1, u'payload': [{u'type': u'hint', u'value': u'CustomModule.foo'}], u'error': None}
response:

project_dir(matched): /Users/xunlu/workspace/magic
column: 1
line: 1
source: Enum.map
CustomModule
CustomModule.foo

Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Initializing ElixirSense server for environment "dev" (Elixir version 1.8.1)

Working directory is "/Users/xunlu/workspace/magic"

ok:localhost:/tmp/elixir-sense-xunlu/1560999578760817000.sock

ElixirSense: {u'request_id': 1, u'payload': {u'column': 1, u'found': True, u'line': 1, u'type': u'module', u'file': u'/private/tmp/elixir-20190202-21222-1ilp2g0/elixir-1.8.1/lib/elixir/lib/enum.ex'}, u'error': None}
response:
/private/tmp/elixir-20190202-21222-1ilp2g0/elixir-1.8.1/lib/elixir/lib/enum.ex:0
project_dir(matched): /Users/xunlu/workspace/magic
column: 6
line: 1
source: Enum.map
CustomModule
CustomModule.foo

Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Initializing ElixirSense server for environment "dev" (Elixir version 1.8.1)

Working directory is "/Users/xunlu/workspace/magic"

ok:localhost:/tmp/elixir-sense-xunlu/1560999578760817000.sock

ElixirSense: {u'request_id': 1, u'payload': {u'column': 1, u'found': True, u'line': 1, u'type': u'function', u'file': u'/private/tmp/elixir-20190202-21222-1ilp2g0/elixir-1.8.1/lib/elixir/lib/enum.ex'}, u'error': None}
response:
/private/tmp/elixir-20190202-21222-1ilp2g0/elixir-1.8.1/lib/elixir/lib/enum.ex:0
project_dir(matched): /Users/xunlu/workspace/magic
column: 6
line: 1
source: Enum.map
CustomModule
CustomModule.foo

Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Initializing ElixirSense server for environment "dev" (Elixir version 1.8.1)

Working directory is "/Users/xunlu/workspace/magic"

ok:localhost:/tmp/elixir-sense-xunlu/1560999578760817000.sock

ElixirSense: {u'request_id': 1, u'payload': u'ok', u'error': None}
response:
None
project_dir(matched): /Users/xunlu/workspace/magic
column: 6
line: 1
source: Enum.map
CustomModule
CustomModule.foo

Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Initializing ElixirSense server for environment "dev" (Elixir version 1.8.1)

Working directory is "/Users/xunlu/workspace/magic"

ok:localhost:/tmp/elixir-sense-xunlu/1560999578760817000.sock

ElixirSense: {u'request_id': 1, u'payload': {u'docs': {u'docs': u'> Enum.map(enumerable, fun)\n\n### Specs\n\n`@spec map(t, (element -> any)) :: list`\n\nReturns a list where each item is the result of invoking\n`fun` on each corresponding item of `enumerable`.\n\nFor maps, the function expects a key-value tuple.\n\n## Examples\n\n    iex> Enum.map([1, 2, 3], fn x -> x * 2 end)\n    [2, 4, 6]\n\n    iex> Enum.map([a: 1, b: 2], fn {k, v} -> {k, -v} end)\n    [a: -1, b: -2]\n\n', u'types': u'  `@type default :: any\n`\n\n  \n\n\n____\n\n  `@type index :: integer\n`\n\n  Zero-based index. It can also be a negative integer.\n\n\n____\n\n  `@type element :: any\n`\n\n  \n\n\n____\n\n  `@type acc :: any\n`\n\n  \n\n\n____\n\n  `@type t :: Enumerable.t\n`\n\n  \n'}, u'actual_subject': u'Enum.map', u'subject': u'Enum.map'}, u'error': None}
response:
> Enum.map(enumerable, fun)

### Specs

`@spec map(t, (element -> any)) :: list`

Returns a list where each item is the result of invoking
`fun` on each corresponding item of `enumerable`.

For maps, the function expects a key-value tuple.

## Examples

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

    iex> Enum.map([a: 1, b: 2], fn {k, v} -> {k, -v} end)
    [a: -1, b: -2]


project_dir(matched): /Users/xunlu/workspace/magic
column: 1
line: 2
source: Enum.map
CustomModule
CustomModule.foo

Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Initializing ElixirSense server for environment "dev" (Elixir version 1.8.1)

Working directory is "/Users/xunlu/workspace/magic"

ok:localhost:/tmp/elixir-sense-xunlu/1560999578760817000.sock

ElixirSense: {u'request_id': 1, u'payload': {u'column': None, u'found': False, u'line': None, u'type': None, u'file': None}, u'error': None}
response:
definition_not_found
project_dir(matched): /Users/xunlu/workspace/magic
column: 1
line: 2
source: Enum.map
CustomModule
CustomModule.foo

Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Initializing ElixirSense server for environment "dev" (Elixir version 1.8.1)

Working directory is "/Users/xunlu/workspace/magic"

ok:localhost:/tmp/elixir-sense-xunlu/1560999578760817000.sock

ElixirSense: {u'request_id': 1, u'payload': {u'column': 11, u'found': True, u'line': 1, u'type': u'module', u'file': u'/Users/xunlu/workspace/magic/lib/custom_module.ex'}, u'error': None}
response:
/Users/xunlu/workspace/magic/lib/custom_module.ex:1
project_dir(matched): /Users/xunlu/workspace/magic
column: 14
line: 3
source: Enum.map
CustomModule
CustomModule.foo

Load server settings from: /var/folders/z8/vckl1mv56fq66k6l2tqxbs5r0000gn/T/alchemist_server/zS2UserszS2xunluzS2workspacezS2magic
warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead

  /Users/xunlu/.vim/plugged/alchemist.vim/elixir_sense/lib/elixir_sense/core/introspection.ex:68



Initializing ElixirSense server for environment "dev" (Elixir version 1.8.1)

Working directory is "/Users/xunlu/workspace/magic"

ok:localhost:/tmp/elixir-sense-xunlu/1560999578760817000.sock

ElixirSense: {u'request_id': 1, u'payload': {u'column': 7, u'found': True, u'line': 2, u'type': u'function', u'file': u'/Users/xunlu/workspace/magic/lib/custom_module.ex'}, u'error': None}
response:
/Users/xunlu/workspace/magic/lib/custom_module.ex:2

Looks like the warning messages are causing the problem 😞

It's fixed in elixir sense! I'll try to update elixir sense and let you know to try it out