Comments (10)
should also consider position inside the string:
move_uploaded_file should be 1st suggestion (why is appearing twice?)
version 0.18.0
from autocomplete-plus.
I was using string_score
to score the current term and sort suggestions according to that. would love to have autocomplete-plus do it itself.
from autocomplete-plus.
autocomplete+ v2 will order suggestions by provider, in the order of provider scope registration (the most specific provider wins). You should ensure your provider is then ordering it's suggestions appropriately (perhaps using the technique you suggested.
In practice, the prefix is usually fairly static / the same for all providers so I'm not sure sorting by prefix would provide much value being in the core. See #186 and the new wiki page for the Provider API.
from autocomplete-plus.
@joefitzgerald steelbrain/Atom-Hack@cdd484c#diff-752acd996cb6fc31f4ed093cdfecd4c5R36 currently the autocomplete providers have to do this themselves, wouldn't it be nice if autocomplete-plus would do it?
from autocomplete-plus.
@steelbrain Currently, autocomplete-plus
suggestion order is dictated by:
- Provider order, where the most specific provider (by selector) wins (i.e. a provider registered for
.scope.js .function
will win over a provider registered for.scope.js
or*
) - The order the suggestions are in when returned by the provider (i.e. all subsequent array operations are stable and do not re-order them)
Because the default for maxItems
is 10, typically, there are not ordering challenges with this new technique. Previously, there was no way to guarantee order for providers by specificity of scope, so we're doing much better.
I'm not an advocate for trying to specify order of suggestions across providers, so I think what you're asking for is a helper function to sort by score. But that feels like something _.sortBy
can handle, and is not a big deal. Can you help sell me on why this needs to be in the core? Or correct my understanding?
from autocomplete-plus.
@joefitzgerald AutoComplete providers often parse the code line by line and generate autocomplete suggestions [1] or they use other programs to do it for them [2].
The other programs that providers use often do the sorting themselves, but sometimes they suck it,
for example $mai
would have the $main
result at the top but $main->res
will have $main->asort
at the top.
In both the cases developers have to use modules like fuzzaldrin
to sort the results. and I think it would be a lot more efficient if one package autocomplete-plus
does it instead of all those provider packages.
from autocomplete-plus.
So you would propose a score
property on match
and that autocomplete-plus
would do an ascending sort on that field (if present)? Or something more complex?
from autocomplete-plus.
a simple score field would work great as well. But to generate that score, people will still have to use a node module in each provider, it would be awesome to have autocomplete-plus score the words itself, based on the prefix.
from autocomplete-plus.
I'm not sure we could ever have a single generic scoring algorithm, but would gladly accept a PR that does it. There have been various grumblings similar to this on discuss.atom.io. Even if this was available it would have to be optional as providers like gocode
in go-plus
know way more about the code than a generic scoring algorithm.
from autocomplete-plus.
fwiw at this point, the original request that i made that got turned into this issue was nothing to do with scoring matches (i.e. the order of completions within a provider), but was instead for a UI to allow the user to prioritize the order of the PROVIDERS themselves. e.g. to be able to register a preference for snippets to come before buffer completions (or vice versa). and as a further refinement, to be able to register different sets of provider rankings on a grammar by grammar basis (maybe through separate config files for individual grammars).
from autocomplete-plus.
Related Issues (20)
- Me aparece esto, no se como proceder. HOT 1
- Error while parsing CSL JSON bibliography file
- block global functions php
- Setting: enter key only if starts with same characters
- https://www.facebook.com/konrad.piatek.796/about
- https://www.facebook.com/konrad.piatek.796 HOT 1
- Freezing While Typing
- Go Autocomplete stopped working with go modules
- Failed to activate the autocomplete-plus package
- autocomplete does not. on Atom 1.53.0 and 1.5.4.0beta0 I have the same problem. My bad! I didn't name the file yet, so it didn't have the .html file type.
- Suggestion is repeated upon autocompletion instead of replaced. HOT 2
- RFC: Change the Provider API to allow LSP compliance HOT 2
- In a syntax theme I am working on, I utilise _[postcss-prefixer]_ to add all the `syntax--` noise without having to actually deal with that in my source files… I get the reasoning here, but I'm just thinking it would be a much better “DX” if we did something similar in core instead?
- Update: regexes now have negative lookbehind
- Autocomplete-plus doesn't recognize scss file and not showing autocomplete popup for css
- Add complete suggest when start with "<" ( less, minor, <mytag... )
- Uncaught TypeError: Cannot destructure property 'itemHeight' of 'this.uiProps' as it is undefined.
- > 1. Open Atom app
- Are you sure you arent behind a proxy? This is an issue with your internet not atom. Are you still experiencing this?
- path autocomplete with bash commands
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 autocomplete-plus.