tzachar / cmp-tabnine

TabNine plugin for hrsh7th/nvim-cmp
MIT License
287 stars 28 forks source link

Allow whitelisting languages #26

Closed mawkler closed 2 years ago

mawkler commented 2 years ago

Currently the configuration allows settting ignored_file_types. Is it possible to allow a whitelist (could for instance be called allowed_file_types) of languages for which tabnine is only enabled for, and disabled for all other languages?

tzachar commented 2 years ago

This would be unelegant. Having both an allow list and a disallowed list is ungainly.

I think a better option would probably be to change it to a callback, such that each user can implement what works for him.

mawkler commented 2 years ago

I personally don't agree that having a whitelist and a blacklist is unelegant, but I adding a callback is fine with me too :)

tzachar commented 2 years ago

Having both, the logic gets comicates fairly quickly. Also, documenting the order of preference between the lists would confound new users.

On Thu, 2 Dec 2021, 16:18 Melker Österberg, @.***> wrote:

I personally don't agree that having a whitelist and a blacklist is unelegant, but I adding a callback is fine with me too :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tzachar/cmp-tabnine/issues/26#issuecomment-984668393, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFXXC7BQ4JLOY42Y5MXELDUO552DANCNFSM5JG6DUOA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tzachar commented 2 years ago

Take a look at this. You can set up a per buffer configuration, based on anything you want. This is supported upstream.

I think I will also remove the blacklist.

mawkler commented 2 years ago

@tzachar Thanks, that worked for me!