Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Add omni completion source #170

Merged
merged 1 commit into from
Feb 13, 2021
Merged

Add omni completion source #170

merged 1 commit into from
Feb 13, 2021

Conversation

cbarrete
Copy link
Contributor

This is a basic source that works, but I think that it should be filetype-specific, because it is only relevant in a few cases (e.g. when editing LaTeX files when https://github.com/lervag/vimtex is installed). However, there isn't a good way for users to configure filetypes for sources right now, since they don't have access to the source metadata.

It would be easy to add a global option and read it in get_metadata but that's quite ugly in my opinion.

Ideally, I'd like to configure filetypes via files in an ftplugin directory (which only works for Vimscript, Lua support is planned for 0.6, which is still far away) or autocommands. I feel that it shouldn't be the responsibility of a plugin to handle filetype management since (Neo)Vim already has a very good way to do that.
I can open an issue to discuss that if you don't have a plan for it yet.

@hrsh7th
Copy link
Owner

hrsh7th commented Feb 12, 2021

Thank you very much! I really appreciate contribution!

I'm reviewing.

lua/compe_omni/init.lua Outdated Show resolved Hide resolved
@cbarrete
Copy link
Contributor Author

Thanks for the review, I was hoping for a discussion about filetypes before going into how the omnifunc works, but I'll just open a new issue.
I think we can merge it for all filetypes as it is now (unless you have more comments of course).

@hrsh7th
Copy link
Owner

hrsh7th commented Feb 13, 2021

@cbarrete
Sorry. I was missing that point.

In compe, the filetype metadata can be confifured by g:compe.source.omni = { 'filetypes': ['tex'] }

@hrsh7th
Copy link
Owner

hrsh7th commented Feb 13, 2021

Looks good. I will merge it.

@hrsh7th hrsh7th merged commit 15ea260 into hrsh7th:master Feb 13, 2021
@cbarrete
Copy link
Contributor Author

In compe, the filetype metadata can be confifured by g:compe.source.omni = { 'filetypes': ['tex'] }

Ah thanks, I didn't realize that, I'll still open an issue as I don't think that it's an optimal solution, but we can discuss this :)

jdhao added a commit to jdhao/nvim-config that referenced this pull request Jun 18, 2021
Only enable omni and spell source for certain filetypes. See also hrsh7th/nvim-compe#170
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants