GithubHelp home page GithubHelp logo

Comments (6)

Saecki avatar Saecki commented on June 18, 2024

I've also noticed that, but I'm not exactly sure what's the cause. We set sortText on versions and the client/completion provider is supposed to respect them. That used to work when I implemented it, but some time ago something broke.

Here is the line we set sortText:

sortText = string.format("%04d", i),

Here is the line nvim-cmp uses it to sort CompletionItems:
https://github.com/hrsh7th/nvim-cmp/blob/fc0f694af1a742ada77e5b1c91ff405c746f4a26/lua/cmp/config/compare.lua#L74

This needs some more investigation, I'll look into it sometime.

from crates.nvim.

Saecki avatar Saecki commented on June 18, 2024

Found the issue, seems like the default config excludes scoring/sorting by sort_text:
https://github.com/hrsh7th/nvim-cmp/blob/fc0f694af1a742ada77e5b1c91ff405c746f4a26/lua/cmp/config/default.lua#L71

from crates.nvim.

fabolous005 avatar fabolous005 commented on June 18, 2024

So whats the conclusion of this? Would it possible to patch cmp to enable sort_text or is there an other way?

from crates.nvim.

Saecki avatar Saecki commented on June 18, 2024

I don't know, there is no answer to the issue I opened on the nvim-cmp repository. For now it seems like users will have to manually enable the sort_text comparator, if desired.

from crates.nvim.

fabolous005 avatar fabolous005 commented on June 18, 2024

Thank you. Do you mind pasting the issue link in nvim-cmp here? Just for future reference

from crates.nvim.

Saecki avatar Saecki commented on June 18, 2024

It's actually already linked above

from crates.nvim.

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.