Comments (12)
I know about this feature, ac-nrepl
used that by calling the backend numerous times to retrieve candidates for each category. I didn't know how to preserve the functionality while reducing the number of calls to one, so I just gave up on that.
I'd be happy to bring it back if it is possible to do without hampering the performance. Perhaps the backend could return candidates in groups, according to their category. Although I'm not sure how then you can use it in ac
(ac
requires a new source per category which means a separate request per source — or doing some unreliable caching magic).
Also, what about the ns/package of the candidate? It is already given out in the popup doc that is requested per candidate. Is it important to have it in completion, for all candidates at once?
from compliment.
I'd be happy to bring it back if it is possible to do without hampering the performance. Perhaps the backend could return candidates in groups, according to their category. Although I'm not sure how then you can use it in ac (ac requires a new source per category which means a separate request per source — or doing some unreliable caching magic).
I think that only the nREPL calls are expensive and doing some type checks in Java should be fairly fast. Once a client receives the candidates and the metadata grouping them on the client side should be pretty fast as well. @gtrak suggested returning a list of maps for the candidates in a similar issue for ClojureScript completion. This seems like a good idea to me. Initially the map could have only two elements - the name and the type of the candidate.
Also, what about the ns/package of the candidate? It is already given out in the popup doc that is requested per candidate. Is it important to have it in completion, for all candidates at once?
I just mentioned this as some other metadata we might need (theoretically) beside the candidate's type.
from compliment.
I think that only the nREPL calls are expensive and doing some type checks in Java should be fairly fast. Once a client receives the candidates and the metadata grouping them on the client side should be pretty fast as well. @gtrak suggested returning a list of maps for the candidates in a similar issue for ClojureScript completion. This seems like a good idea to me. Initially the map could have only two elements - the name and the type of the candidate.
Yes. What I'm saying is that the only way (at least that I'm aware about) in auto-complete
to assign a letter for a candidate is to create a separate source for that letter. So that you have a source for vars, a source for namespaces, a source for functions etc. Now every source has its individual retrieval function that should return the list of completions of that type. How would you multiplex all those calls into single nREPL request? By saving the results of a single request into some local state, so that all the sources' retrieval functions will take candidates from that saved state? Seems pretty hackish to me.
from compliment.
Don't know about auto-complete, but if you're using completion-at-point every candidate is simply passed to an annotation function with adds the extra data for it (here's an example). This works transparently for company-mode and guess auto-complete-mode should start respecting completion-at-point instead of defining its own abstractions.
from compliment.
auto-complete-mode should start respecting completion-at-point instead of defining its own abstractions.
I'm afraid you are addressing the wrong person with this claim:).
from compliment.
@alexander-yakushev So, shall we do this or no? People keep asking me about showing candidate type data for a while now and I have to know whether I'll have to do in the middleware or you'll do it in compliment.
from compliment.
Yeah, perhaps this needs to be done after all. So, does it mean instead of "reduce-kv"
to return {:name "reduce-kv" :type :var :namespace "clojure.core"}
?
Also, in company mode do you plan just to attach the type tag to candidate name? How will it know not to insert that tag into buffer when completing?
from compliment.
Also, in company mode do you plan just to attach the type tag to candidate name? How will it know not to insert that tag into buffer when completing?
There's some standard Emacs support for this. See https://github.com/clojure-emacs/cider/blob/master/cider-interaction.el#L798
from compliment.
OK, it will be easier just to "Hulk smash me write, Bozhidar comment". ETA is tomorrow.
from compliment.
:-) Guess so.
from compliment.
Ping :-)
from compliment.
OK, I need some more time for this. I haven't yet figured the correct way to do this to preserve compatibility with the old method, and to keep the code nice. But I'll get to it soon.
from compliment.
Related Issues (20)
- No completions for locals if context contains qualified keyword with dot in the name HOT 2
- Suggest private vars when using var-quote? HOT 2
- utils/classes-on-classpath can return non-classes HOT 5
- String literals aren't inferred as strings HOT 6
- Give `some->`/`some->>` similar treatment than that of `->`/`->>` HOT 2
- Type inference from static method calls HOT 1
- License on compliment lite HOT 1
- Good completion suggestions require extra type hints HOT 2
- compliment.sources.class-members could add the class to its candidates HOT 4
- Interest in cljs-ish completions? HOT 2
- No completion for locals when hashset literal is used within short lambda syntax HOT 5
- Determining if the prefix is being called within a given function/macro HOT 2
- is there an example how to use `compliment` within emacs but without cider? HOT 2
- Too many completions for Java objects HOT 3
- Don't offer completions for `^:deprecated` vars? HOT 7
- Some of the latest changes are missing in the released version HOT 7
- ns completions for cljc-files HOT 2
- Doc of ns via alias HOT 3
- proposal: completion and documentation with leading literals HOT 7
- var-quote completions without a ns part HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compliment.