Giter Site home page Giter Site logo

Comments (5)

iquiw avatar iquiw commented on July 20, 2024

Maybe related to company-mode/company-mode#142 (or not?).

I noticed the behavior, but had no idea how to fix before.
Since company-ghc takes any symbols as prefix, it won't pass to other back-ends.
I think it is usual in company-mode to use grouped back-end in such case.
e.g.

(add-to-list 'company-backends '(company-ghc company-dabbrev))

I am now considering to move some logic in company-ghc-candidates to company-ghc-prefix as written in [1], but I am not sure it will work well.

[1] company-mode/company-mode#142 (comment)

from company-ghc.

dgutov avatar dgutov commented on July 20, 2024

I am now considering to move some logic in company-ghc-candidates to company-ghc-prefix as written in [1], but I am not sure it will work well.

I'd suggest you try to detect the cases which your backend isn't able to handle lexically, somehow, and delegate to dabbrev only in those cases (by returning nil).

Or implement some completion logic in Elisp. In the example on the picture, for instance, point is after a word on the line directly after a function signature. There can be only one completion, no?

from company-ghc.

iquiw avatar iquiw commented on July 20, 2024

I'd suggest you try to detect the cases which your backend isn't able to handle lexically, somehow, and delegate to dabbrev only in those cases (by returning nil).

OK. I will consider the direction.
For the first step, I changed to return nil if the prefix starts from the line beginning.

Or implement some completion logic in Elisp. In the example on the picture, for instance, point is after a word on the line directly after a function signature. There can be only one completion, no?

Another function signature or different function name is possible here.
And this aVeryLongName can appear in function body also.

Some function in haskell-mode may be used to build candidates though.
I will investigate on it.

from company-ghc.

iquiw avatar iquiw commented on July 20, 2024

@bixuanzju Can you clarify the goal of this issue?

I think the reported problem was fixed in very narrow sense.

So is it either
(1) To pass control to other back-ends if there is no candidates
or
(2) To provide candidates from locally defined functions/variables.
?

I think (1) is not possible in general, and only grouped back-end is reasonable solution.
If you want (2), I'd like to create new issue to focus to it explicitly.

from company-ghc.

bixuanzju avatar bixuanzju commented on July 20, 2024

Sorry, I forgot to close this issue. For now, grouped back-end works happily for me :)

from company-ghc.

Related Issues (20)

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.