Giter Club home page Giter Club logo

Comments (5)

Olical avatar Olical commented on May 14, 2024

Screenshot_2019-03-29_14-44-21

Progress!

from conjure.

Olical avatar Olical commented on May 14, 2024

So you can try out the completion by depending on c434e00d949c3e7b17b9d15cef472f8c1df8a287 and ensuring you have some version of compliment installed in your project. If you have CIDER / nREPL then I think it comes along with that anyway, so it may already be there.

It works but it can slow you down as you type, not ideal. I could make it entirely async by updating the completions for the buffer in the background when you make changes or the cursor idles then just filter down that list of namespace specific completions.

I took this approach in the Rust version and it worked really well but I'd love to use compliment's context features, that requires actual async completion. I can't think of a way to do that through omnifunc so I think the only way would be through an async completion framework of some kind.

I did however find this interesting gist: https://gist.github.com/prabirshrestha/0b3b7b4e2112c662979bfeeec4e1edb7

It's a tad hack-y but basically on cursor hold they send off some job to get the completions at the cursor. Once that's done it invokes the omnifunc and reads the results from the pre-populated list of completions, including the context.

This gets us the best of both worlds (snappy completion + context aware) but I wonder how that "trigger omnifunc when I'm done fetching" works in practice. I could see it causing all sorts of issues if you're moving the cursor fast enough. Like not needing omnifunc but having it popup at random times anyway.

Maybe I'll try it and see how it actually behaves in practice, I'd love to have actual async completions taking the context into account, it's just going to be tricky within the tools Neovim has to offer.

from conjure.

Olical avatar Olical commented on May 14, 2024

Anyone's thoughts on this are much appreciated 😄 are buffer local completions enough for you if they're super fast? Do you love having completions within let bindings? Do you use a Neovim completion framework that would allow me to hook into it easily? I use deoplete so I worry that I'd need to implement it for every framework under the sun... I hear there's one called CoC?

Maybe I could just not take a hacky route, do it all correctly but require that you have one of a handful of very popular completion frameworks installed. Could be a good tradeoff.

from conjure.

Olical avatar Olical commented on May 14, 2024

Decided to only provide the basic omnicomplete support, async autocompletion can come at a later date through deoplete, CoC or similar. It'll definitely require some work to get their Python processes talking to Conjure's JVM though 😬

For now I'll go with what's stable, easy and predictable. Omnicomplete triggered by <c-x><c-o>, nothing fancy. So I'll add context support, some quick first pass docs and release this.

from conjure.

Olical avatar Olical commented on May 14, 2024

Spent a long time tinkering trying to get autocomplete and context working but ultimately it's a lot of changes for very little gain. I'm going for MVP right now where omnicompletion works and works well. I'll get this released so people can actually start using it.

Async completion should be solved through an async completion framework which will require a bunch of thought about how those Python processes will communicate with Conjure. The context support in compliment can be used but just requires changing some of the form reading stuff I think, I'll probably do that in the future once I have a test suite.

from conjure.

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.