Code Monkey home page Code Monkey logo

neco-ghc's Introduction

neco-ghc: ghc-mod/hhpc completion for neocomplcache/neocomplete/deoplete

A completion plugin for Haskell, using ghc-mod or hhpc

What is neco-ghc

This plugin supports the following completion.

  • pragma
  • language
  • importing a module
  • importing a function of a module
  • function based on importing modules

neco-ghc was originally implemented by @eagletmt on July 25, 2010, and then ujihisa added some new features.

Install

  • Install the ghc-mod package by stack install ghc-mod or cabal install ghc-mod OR install the hhp package by stack install hhp or cabal install hhp
  • Unarchive neco-ghc and put it into a dir of your &rtp.

Note: If you use ghc-mod 5.4, you should use ghc-mod 5.5+. Because, ghc-mod 5.5 fixes the rootdir problem.

DanielG/ghc-mod#665

Usage

neco-ghc provides necoghc#omnifunc for omni-completion. I recommend adding the following in your ~/.vim/ftplugin/haskell.vim.

" Disable haskell-vim omnifunc
let g:haskellmode_completion_ghc = 0
autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc

See :help compl-omni for details on omni-completion.

Completion engines

This plugin can be used as a source of neocomplete.vim or neocomplcache.vim or deoplete.nvim. You can enjoy auto-completions without any specific configuration.

This plugin also should work with YouCompleteMe. To enable auto-completions, you have to add the following setting.

let g:ycm_semantic_triggers = {'haskell' : ['.']}

Options

g:necoghc_enable_detailed_browse

Default: 0

Show detailed information (type) of symbols. You can enable it by adding let g:necoghc_enable_detailed_browse = 1 in your vimrc. While it is quite useful, it will take longer boot time.

This feature was introduced in ghc-mod 1.11.5.

g:necoghc_debug

Default: 0

Show error message if ghc-mod/hhpc command fails. Usually it will be noisy if ghc-mod browse Your.Project.Module always fails. Use this flag only if you have some trouble.

g:necoghc_use_stack

Default: 0

Allow using stack's own ghc-mod/hhpc. If you are using ghc-mod, it will change direct ghc-mod mod calls to stack exec --no-stack-exe ghc-mod -- instead. The same goes for hhpc. Use this flag if your globally installed ghc-mod/hhpc doesn't work properly with your stack projects.

Troubleshoot

Q: neco-ghc does not work

Check the $PATH variable in vim contains the path to your ghc-mod/hhpc command. Or you can execute :NecoGhcDiagnostics command for debug.

Q: Completion isn't working for local functions or modules

eagletmt#44

It's a limitation of ghc-mod. ghc-mod can show symbols of installed modules only. ghc-mod cannot show symbols of developing modules or current source file.

License

BSD3 License, the same license as ghc-mod.

neco-ghc's People

Contributors

ajnsit avatar andy-morris avatar dbeecham avatar eagletmt avatar ianbollinger avatar ichizok avatar itchyny avatar jakubfijalkowski avatar jdagilliland avatar khorser avatar macthecadillac avatar roman avatar seanparsons avatar shougo avatar skahack avatar themayarose avatar ujihisa avatar wilywampa avatar woehr avatar

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.