Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InteroGenericType not working #136

Closed
elongeau opened this issue Feb 10, 2018 · 15 comments
Closed

InteroGenericType not working #136

elongeau opened this issue Feb 10, 2018 · 15 comments

Comments

@elongeau
Copy link

Hello,

I've installed intero for neovim recently, but when I try to use InteroGenericType I have this error:

Error detected while processing function intero#repl#type_at[18]..<SNR>73_ghci_supports_type_at_and_uses:
line    1:
E121: Undefined variable: g:intero_backend_info
E116: Invalid arguments for function intero#process#backend_info#version_gte
E15: Invalid expression: intero#process#backend_info#version_gte( g:intero_backend_info.version, [8, 0, 1])

I'm using

❯ nvim --version
NVIM v0.2.2
Build type: Release
LuaJIT 2.0.5
Features: +acl +iconv +jemalloc +tui

GHCi, version 8.0.2: http://www.haskell.org/ghc/

❯ stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0
@owickstrom
Copy link
Collaborator

@elongeau Not sure this is your issue, but I get that exact error when Intero is not started and I do InteroGenericType or similar. Sure your Intero session is running? Check with:

:echo g:intero_started
1 # it's started

Otherwise g:intero_started should not be defined, or be 0.

@owickstrom
Copy link
Collaborator

You can configure intero-neovim to start the Intero REPL automatically:

let g:intero_start_immediately = 1

Or you need to call :InteroOpen in some way. See :help intero for more info.

@elongeau
Copy link
Author

even with let g:intero_start_immediately = 1 or :InteroOpen, :echo g:intero_started always return 0. I'll to reinstall all from scratch to see what happened

@owickstrom
Copy link
Collaborator

OK. Does the Intero buffer open, and does GHCi start in there? I'm thinking it might be a problem with the plugin not recognizing that intero/GHCi is started.

@elongeau
Copy link
Author

yes, and it loads my file
I can :t function of the loaded file

@elongeau
Copy link
Author

my neovim's :checkhealth for information


health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $XTERM_VERSION=''
  - INFO: $VTE_VERSION=''
  - INFO: $SSH_TTY=''

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: pbcopy

## Python 2 provider (optional)
  - INFO: Using: g:python_host_prog = "/usr/local/bin/python"
  - INFO: Executable: /usr/bin/python
  - ERROR: Command error (job=4): '/usr/bin/python' '-c' 'import neovim; print(neovim.__file__)'
    Output: Traceback (most recent call last):  File "<string>", line 1, in <module>ImportError: No module named neovim
  - INFO: Python2 version: 2.7.10
  - INFO: python-neovim version: unable to load neovim Python module
  - ERROR: Neovim Python client is not installed.
    Error: unable to load neovim Python module
    - ADVICE:
      - Run in shell: pip2 install neovim

## Python 3 provider (optional)
  - INFO: Using: g:python3_host_prog = "/usr/local/bin/python3"
  - INFO: Executable: /usr/local/bin/python3
  - INFO: Python3 version: 3.6.4
  - INFO: python3-neovim version: 0.2.1
  - OK: Latest python3-neovim is installed: 0.2.1

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
  - WARNING: Missing "neovim" gem.
    - ADVICE:
      - Run in shell: gem install neovim
      - Is the gem bin directory in $PATH? Check `gem environment`.
      - If you are using rvm/rbenv/chruby, try "rehashing".

## Node provider (optional)
  - INFO: Node: v9.5.0
  - WARNING: Missing "neovim" npm package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Is the npm bin directory in $PATH?

@esato
Copy link

esato commented Feb 14, 2018

I have the exact same problem. I'm on Windows 10, Neovim v0.2.3-625-g4aa67151f.

@berntan
Copy link

berntan commented Feb 20, 2018

I have the same problem on mac. I have the same versions of nvim and stack as OP.

even with let g:intero_start_immediately = 1 or :InteroOpen, :echo g:intero_started always return 0.

same for me.

@berntan
Copy link

berntan commented Feb 21, 2018

I managed to find out why it didn't start up on my machine. It was my custom ghci-prompt λ: , and so the startup never got past this line: https://github.com/parsonsmatt/intero-neovim/blob/master/autoload/intero/process.vim#L219

Thank you @parsonsmatt and the other contributors for a great plugin!

@elongeau
Copy link
Author

I've made the same, I'll try it asap

@elongeau
Copy link
Author

I confirm @berntan suggestion, customizing the ghci prompt breaks Intero

@parsonsmatt
Copy link
Owner

We should be failing with a better error message.

@elongeau @berntan can you check that setting g:intero_prompt_regex fixes this?

*g:intero_prompt_regex*

  Default: `'[^-]>'`

  If you use a custom GHCi prompt, you may need to modify the prompt regex so
  that it matches your custom prompt.

@elongeau
Copy link
Author

yes, with g:intero_prompt_regex my custom ghci prompt works with intero

@elongeau elongeau closed this as completed Apr 5, 2018
@hasufell
Copy link

hasufell commented Jul 7, 2018

I have no custom ghci prompt, but the same error message. It seems there really is no proper error handling.

@jankner
Copy link

jankner commented Aug 16, 2018

I had this problem, and I did not use a custom ghci prompt. The prompt simply didn't match what intero expected. It listed the modules that were in scope or something like that.

It looked like: *Main Example>

I don't know exactly how the ghci prompt usually works, but I don't think I have any special settings for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants