Giter Site home page Giter Site logo

company-ghc's Introduction

iquiw's GitHub stats Top Langs Streak trophy

company-ghc's People

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

company-ghc's Issues

company-ghc backend found: company-ghc but ghc-boot process has not been done

* company-ghc backend found: company-ghc
* automatic scan module is enabled
* ghc-boot process has not been done

Module                                  Alias               Candidates
-------------------------------------------------------------------------------
Prelude                                 -                        nil

As the diag above, though company-ghc is added to backend, ghc-boot process cannot been done. What should I do?

My config:

(add-to-list 'company-backends 'company-ghc)
(set-company-backend! 'haskell-mode
  'company-ghc)
  (add-hook 'haskell-mode-hook 'eglot-ensure)

Integrate company-ghc into ghc-mod

Hey,

this looks really awesome, adding a company backend for ghc-mod has been on my TODO list for ages now, looks like you did it better than I could have if i tried ;) I'm one of the maintainers of ghc-mod and I was wondering if you might want this to be merged into ghc-mod itself? We're about to do some major elisp code cleanup so this might be just the right time to do it if you want to.

Company gives “Wrong type argument” error message

If I’m typing a word, and the Company-Mode completions pop-up appears,
and the active completion back-end is company-ghc, the completions
pop-up appears to be properly populated, but it disappears soon after
appearing, and the following error message is logged:

Company: An error occurred in post-command
Company: Front-end company-echo-metadata-frontend error "Company: Back-end company-ghc error "Wrong type argument: stringp, nil" with args (meta putChar)" on command post-command

company-ghc-diagnose’s output seems fine:

* company-ghc backend found: company-ghc
* automatic scan module is enabled
* ghc-boot process has been done

Module                                  Alias               Candidates
-------------------------------------------------------------------------------
Prelude                                 -                        212

No autocompletion candidates for symbols in current file

Hi,

company-ghc works great for autocompleting candidates in Prelude and other modules I import, but for some reason doesn't autocomplete candidates in the file I'm working in. To make a contrived example, when I have the code:

lastDigit :: Integer -> Integer
lastDigit n = n `mod` 10

When I write "las", there's no completion for lastDigit:

getLastDigit :: Integer -> Integer
getLastDigit n = las...

Is this by design or am I doing something wrong? Thanks in advance for the help, other than with this problem I'm loving company-ghc :)

Symbol's value as variable is void: company-backends

Hi there, I am trying to set up company-ghc in Aquamacs and I get this error/warning when starting up aquamacs. Does anyone know what am I missing? Thanks.

Warning (initialization): An error occurred while loading `/Users/yoelusa/.emacs':

Symbol's value as variable is void: company-backends

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

I have this configuration on ``~/.emacs`

;; Melpa
(require 'package)
(add-to-list 'package-archives 
         '("melpa" . "http://melpa-stable.milkbox.net/packages/"))
(package-initialize)

(autoload 'ghc-init "ghc" nil t)
(autoload 'ghc-debug "ghc" nil t)
(autoload 'company-mode "company" nil t)

(add-hook 'haskell-mode-hook (lambda () (ghc-init)))

(add-hook 'after-init-hook 'global-company-mode)
(add-to-list 'company-backends 'company-ghc)

The company-ghc-diagnostic-info cmd shows this

* company-ghc backend not found
* automatic scan module is disabled.
  You need to run either 'M-x company-ghc-turn-on-autoscan' once
  or 'M-x company-ghc-scan-modules' when it is necessary.
* ghc-boot process has been done

Module                  Alias           Candidates
-------------------------------------------------------------------------------

The ghc-debug cmd shows this

...
Version: all versions must be the same.
      ghc.el version 0
     ghc-mod version 4.1.6 compiled by GHC 7.8.3
    ghc-modi version 4.1.6 compiled by GHC 7.8.3
    The Glorious Glasgow Haskell Compilation System, version 7.8.3
...

Integrate with company-flx

Citing from the the tool's site [1]:

Company-flex only works with the company-capf backend. Most sources use this backend, with the exception of the more advanced sources. Most backends should be re-written in terms of completion-at-point-functions eventually, although it's going to take a while.

Is it possible that company-ghc use capf?

[1] https://github.com/PythonNut/company-flx

haskell-interacative-mode conflicts with company-mode

I am not sure if I should raise this issue somewhere else, but company-mode seems to conflict with haskell-interactive-mode.

To reproduce:

  1. (setq debug-on-error t)
  2. First enter haskell-mode, type something, company is working fine
  3. Then run command haskell-process-load-or-reload, and enter haskell-interactive-mode
  4. Back to haskell-mode, in the beginning of line ,type something, debugger window pops out.

The abridged error message in my case is below:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
haskell-interactive-at-prompt()
haskell-interactive-mode-completion-at-point-function()
completion--capf-wrapper(haskell-interactive-mode-completion-at-point-function optimist)
run-hook-wrapped(completion--capf-wrapper haskell-interactive-mode-completion-at-point-function optimist)
company--capf-data()
company-capf(prefix)
#[0 "\n\203 ...
company--begin-new()
company--perform()
#0 "\300 \207" [company--perform] 1 "\n\n(fn)"
funcall(#[0 "\300 \207" [company--perform] 1 "\n\n(fn)"])
company-auto-begin()
company-idle-begin(# #<window 3 on Main.hs> 2490 3405)
apply(company-idle-begin (# #<window 3 on Main.hs> 2490 3405))
byte-code("r\301�\302H�\303H"\210)\301\207" [timer apply 5 6] 4)
timer-event-handler([t 21441 4252 273797 nil company-idle-begin (# #<window 3 on Main.hs> 2490 3405) nil 0])
read-event(nil t 3)
sit-for(3)
flyspell-check-word-p()
byte-code("\306� ...
flyspell-post-command-hook()

Fuzzy match for module names

I'd like to be able to type something like C.M.Re and get Control.Monad.Reader. Or rather, C.M and have Control.Monad show up in the completion list.

If I understood the code correctly, this requires us not to use all-completions.

completion of symbols in current module when not compiling?

This might be an edge case, and might also be doable by other means, but I was hoping you'd be able to help - when my current module isn't compilable, I lose the ability to complete identifiers from the current module. This is a bit jarring. Might it be possible to have a fallback mode where the tokenised words are used as completion sources when ghc-mod fails to parse the file? Can I achieve this goal by some other company-mode plugin?

ghc-boot process seems to have failed

Hi,

I'm trying to get company-ghc to work, but without success. The diagnostic reports:

* company-ghc backend found: company-ghc
* automatic scan module is enabled
* ghc-boot process seems to have failed

Module                                  Alias               Candidates
-------------------------------------------------------------------------------
Prelude                                 -                        0

So I applied the recommendations:

  • ghc-mod is properly installed apparently (eg. I can do completion on inst and it goes to instance)
  • ghc-mod boot on the command line does work and gives a huge list of identifiers
  • running with ghc-debug mode does not seem to reveal any issue. Here is the GHC Debug buffer:
% ghc-mod root
/Users/etanter/Develop/Haskell
% boot
% check /Users/etanter/Develop/Haskell/Arboles.hs
% check /Users/etanter/Develop/Haskell/Arboles.hs

I find it strange that it says boot above and not ghc-mode boot. Could it be the problem? if so, where to fix that?
If not, any idea? Something I can do to dig into the matter?

thanks!

[Question] Constantly "Loading symbols for XX ..."

Hi,
company-ghc is constantly Loading symbols for XX ... while I type. Always the same modules (below).

company-ghc-diagnose:

* company-ghc backend found: (company-ghc :with company-dabbrev-code)
* automatic scan module is enabled
* ghc-boot process has been done

Module                  Alias           Candidates
-------------------------------------------------------------------------------
Types.Plan              -            nil
Types.MobNet                -            nil
Types.Invoice               -            nil
Types.Event             -            nil
StdImports              -            1250
MobNets.Extract             -            nil
Prelude                 -            212

diagnose shows several modules with nil for candidates. Is it my config?

br,
vlatko

Direct communication with ghc-modi

Currently, company-ghc borrows ghc-mod variables and modifies them by adding text properties.
It is not polite.
I would like to change it by communicating with ghc-modi directly via ghc-sync-process.

Once after ghc-modi supports "-d" and "-o" options like ghc-mod, we can remove call of ghc-get-info and add operators into candidates.

One down side is we may have duplicate set of keywords in ghc-mod and company-ghc.

company-ghc backend not found

I am a new emacs user trying to get along with spacemacs. I have ghc-mod installed. When I run company-ghc-diagnose, I see this output:

* company-ghc backend not found
* automatic scan module is disabled.
  You need to run either 'M-x company-ghc-turn-on-autoscan' once
  or 'M-x company-ghc-scan-modules' when it is necessary.
* ghc-boot process has not been done

I am hoping some documentation can be added to the Diagnostic section of the README for a next step to resolve this issue.

emacs sluggishness due to slow completion with ghc-mod

In spacemacs with stack (I don't know if this is related to how ghc-mod integrates stack), the completion will be unbearably slow as soon as the import list is too big (~ 25 items).

Is there any known trick to avoid the problem (apart from disabling company-ghc) at that point ?

Thanks for your help.

company-ghc-turn-on-autoscan not detected

Hi,
company-ghc-diagnose shows no items when invoked first and suggests:

* company-ghc backend found: company-ghc
* automatic scan module is disabled.
  You need to run either 'M-x company-ghc-turn-on-autoscan' once
  or 'M-x company-ghc-scan-modules' when it is necessary.
* ghc-boot process has been done

However, :f1 v company-ghc-autoscan gives:

company-ghc-autoscan is a variable defined in `company-ghc.el'.
Its value is t

After manually invoking company-ghc-scan-modules, company-ghc-diagnose shows found modules and candidates.

Emacs 24.5.1 on Arch, current company-ghc from gitHub

br,
vlatko

Show type info in annotation

Is there any reason to not showing type info in completion annotation? Similar to company-ghc-show-module but company-ghc-show-type-info
It could be very useful.

company-ghc shadows other back-ends

As I was playing with company-ghc, it seems to block other back-ends, e.g. company-dabbrev-code because now company-mode won't complete symbol names as shown in the below screenshot.
screen shot 2014-06-24 at 5 31 10 pm

Interactive-Haskell hangs

Hi there,
I'm not sure if this is exactly company-ghc's fault but I don't know where else to go, so feel free to point me somewhere else if needed :)
I'm working on the scheme48hours and interactive haskell hangs on me when I start a scheme repl from within the cabal repl. I have to kill ghc and then I either see this in Messages

Company: An error occurred in auto-begin
Wrong type argument: stringp, nil

or I get 1k lines of completions shown in the haskell process log. Either way I have to kill ghc and emacs starts responding only afterwards.

Steps to reproduce (on my machine at least):

  • open Main.hs in Emacs
  • C-c C-l to load the file in the REPL
  • runRepl to start the scheme repl
  • type a letter or two and wait for the completion to kick in (and that's when it hangs)

In case you really go down testing this and want the code I have then here it is, the current master [0fc2d53] is the one you should clone.

To make the listing full, here are my versions:

  • ghc - 7.8.3
  • emacs - 24.4.1
  • emacs packages - updated as of yesterday
  • ghc-mod - 5.2.1.1

nil candidates without any other errors

Upon running company-ghc-diagnose all modules get loaded, but no candidates appear, and ghc-mod reports no errors either:

no candidates on company-ghc

Further investigation shows that ghc-mod browse can see the symbols exported without problems:

browse works from terminal

On a side-note, ghc-mod boot shows all modules but very few names compared to what ghc-mod browse does. However, none of those functions show up as candidates in the diagnose!

You can use the repository https://github.com/kerscher/preliminaries to try to reproduce.
The library is not on Hackage, yet.

Operator in candidates

Since ghc-modi browse now supports -o option to browse operators, it can be achieved.

Unwanted "Visit tags table (default TAGS)"

I keep getting the "Visit tags table (default TAGS)" dialog whenever company-ghc tries to do code completion.

I had a search and found this for company mode https://github.com/company-mode/company-mode/issues/333

The followiing is the result of M-x describe-variable completion-at-point-function

completion-at-point-functions's value is (haskell-completions-completion-at-point t)

Local in buffer Main.hs; global value is 
(tags-completion-at-point-function)

I have ghc-mod 5.5.0.0 installed with stack. What do I have to do to stop this behaviour ?

nil and 0 candidates

Hi!

I've been unable to successfully use company-ghci. Running
company-ghc-diagnose shows nil and 0 completions:

company-ghc backend found: company-ghc
automatic scan module is enabled

Module                                  Alias               Candidates
-------------------------------------------------------------------------------
Seraph.Types                            -                        nil
Debug.Trace                             -                        nil
MVC                                     -                        nil
Data.Set                                S                        nil
Data.Maybe                              -                        0
Data.Map                                M                        nil
Control.Monad.Writer.Strict             -                        nil
Control.Monad.State.Strict              -                        nil
Control.Lens                            -                        nil
Prelude                                 -                        0

Before you invite me to RTFM, I have read the troubleshooting steps on
this: M-: (setq ghc-debug t) and then M-x ghc-debug. Nothing jumps
out me as erroneous:

% ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.3
% ghc-mod version
ghc-mod version 5.0.1 compiled by GHC 7.8.3
% ghc-modi version
ghc-modi version 5.0.1 compiled by GHC 7.8.3

I'm using flycheck-haskell and haskell-mode. I'm happy to provide any
additional details you find necessary and thankk you in advance for
any help you can provide with debugging.

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.