From 333d0de0c975e5383e32484bca150ce7337cc721 Mon Sep 17 00:00:00 2001 From: Kohei Suzuki Date: Fri, 21 Feb 2014 21:59:26 +0900 Subject: [PATCH] Add NecoGhcDiagnostics command --- ISSUES.md | 22 ++++++++++++++++++++++ autoload/necoghc/diagnostics.vim | 20 ++++++++++++++++++++ plugin/necoghc.vim | 1 + 3 files changed, 43 insertions(+) create mode 100644 ISSUES.md create mode 100644 autoload/necoghc/diagnostics.vim create mode 100644 plugin/necoghc.vim diff --git a/ISSUES.md b/ISSUES.md new file mode 100644 index 0000000..bca50b1 --- /dev/null +++ b/ISSUES.md @@ -0,0 +1,22 @@ +# neco-ghc issues + +When submitting an issue, please include the output by `:NecoGhcDiagnosis`. + +```vim +NecoGhcDiagnosis +``` + +It shows your environment information possibly related to neco-ghc. + +- Current filetype + - neco-ghc only works in the buffer with filetype haskell. +- ghc-mod executable (required) + - neco-ghc requires [ghc-mod](https://github.com/kazu-yamamoto/ghc-mod) and it must be placed in your `$PATH`. +- 'omnifunc' + - To use Vim builtin completion, `'omnifunc'` must be set to `necoghc#omnifunc` by `setlocal omnifunc=necoghc#omnifunc`. +- Completion plugin installation (optional) + - [neocomplete.vim](https://github.com/Shougo/neocomplete.vim) + - [neocomplcache.vim](https://github.com/Shougo/neocomplcache.vim) + - [YouCompleteMe](https://github.com/Valloric/YouCompleteMe) +- Other plugin installation (optional) + - [vimproc.vim](https://github.com/Shougo/vimproc.vim) diff --git a/autoload/necoghc/diagnostics.vim b/autoload/necoghc/diagnostics.vim new file mode 100644 index 0000000..690635b --- /dev/null +++ b/autoload/necoghc/diagnostics.vim @@ -0,0 +1,20 @@ +function! necoghc#diagnostics#report() + echomsg 'Current filetype:' &l:filetype + + let l:executable = executable('ghc-mod') + echomsg 'ghc-mod is executable:' l:executable + if !l:executable + echomsg ' Your $PATH:' $PATH + endif + + echomsg 'omnifunc:' &l:omnifunc + echomsg 'neocomplete.vim:' exists(':NeoCompleteEnable') + echomsg 'neocomplcache.vim:' exists(':NeoComplCacheEnable') + echomsg 'YouCompleteMe:' exists(':YcmDebugInfo') + + try + echomsg 'vimproc.vim:' vimproc#version() + catch /^Vim\%((\a\+)\)\=:E117/ + echomsg 'vimproc.vim: not installed' + endtry +endfunction diff --git a/plugin/necoghc.vim b/plugin/necoghc.vim new file mode 100644 index 0000000..d1ea799 --- /dev/null +++ b/plugin/necoghc.vim @@ -0,0 +1 @@ +command! -nargs=0 NecoGhcDiagnostics call necoghc#diagnostics#report()