mirror of
https://github.com/raimon49/requirements.txt.vim.git
synced 2026-01-31 04:15:21 +08:00
🔥 Remove coc completion source code
https://github.com/Freed-Wu/requirements-language-server realize a language server for requirements.txt which has more functions and better performance and support all editors which supports LSP. The coc completion source code of this repository can be removed to avoid the conflict of coc.nvim user.
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
---
|
||||
repos:
|
||||
- repo: https://github.com/google/vimdoc
|
||||
rev: 73bc1efaacb55a59d5206d0ac50e5432ea0192c1
|
||||
hooks:
|
||||
- id: vimdoc
|
||||
@@ -1,20 +0,0 @@
|
||||
""
|
||||
" https://github.com/neoclide/coc.nvim/wiki/Create-custom-source
|
||||
function! coc#source#requirements#init() abort
|
||||
return {
|
||||
\ 'shortcut': 'pip',
|
||||
\ 'priority': 9,
|
||||
\ 'filetypes': ['requirements'],
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
""
|
||||
" https://github.com/neoclide/coc.nvim/wiki/Create-custom-source
|
||||
"
|
||||
" Completion pip option and PYPI package names.
|
||||
" Note: completion PYPI package names need install pip-cache from PYPI,
|
||||
" and run `pip-cache update` first to generate cache.
|
||||
function! coc#source#requirements#complete(opt, cb) abort
|
||||
call a:cb(g:requirements#items)
|
||||
endfunction
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
@@ -1,44 +0,0 @@
|
||||
""
|
||||
" @section Introduction, intro
|
||||
" @library
|
||||
" <doc/@plugin(name).txt> is generated by <https://github.com/google/vimdoc>.
|
||||
" See <README.md> for more information about installation and screenshots.
|
||||
|
||||
""
|
||||
" Update cache.
|
||||
function! requirements#update_cache() abort
|
||||
let s:items = []
|
||||
let l:pip_items = split(system('COMP_WORDS="pip install -" COMP_CWORD=2 PIP_AUTO_COMPLETE=1 pip'))
|
||||
let l:pypi_items = split(system('pip-cache pkgnames'))
|
||||
for l:item in l:pip_items
|
||||
let s:items += [{'word': l:item, 'menu': 'pip'}]
|
||||
endfor
|
||||
for l:item in l:pypi_items
|
||||
let s:items += [{'word': l:item, 'menu': 'pypi'}]
|
||||
endfor
|
||||
call writefile([json_encode(s:items)], s:cache)
|
||||
endfunction
|
||||
|
||||
if exists('*stdpath')
|
||||
let s:cache_dir_home = stdpath('cache')
|
||||
else
|
||||
let s:cache_dir_home = $HOME . '/.cache/nvim'
|
||||
endif
|
||||
let s:cache_dir = s:cache_dir_home . '/requirements.vim'
|
||||
call mkdir(s:cache_dir, 'p')
|
||||
""
|
||||
" Completion cache path.
|
||||
call g:requirements#utils#plugin.Flag('g:requirements#cache',
|
||||
\ s:cache_dir . '/requirements.json'
|
||||
\ )
|
||||
let s:cache = g:requirements#cache
|
||||
try
|
||||
let s:items = json_decode(readfile(s:cache)[0])
|
||||
catch /\v^Vim%(\(\a+\))?:E(684|484|491):/
|
||||
call requirements#update_cache()
|
||||
let s:items = json_decode(readfile(s:cache)[0])
|
||||
endtry
|
||||
""
|
||||
" Completion cache contents. For program.
|
||||
call g:requirements#utils#plugin.Flag('g:requirements#items', s:items)
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
@@ -1,45 +0,0 @@
|
||||
*requirements.txt* the Requirements File Format syntax support for Vim
|
||||
raimon *requirements*
|
||||
|
||||
==============================================================================
|
||||
CONTENTS *requirements-contents*
|
||||
1. Introduction.........................................|requirements-intro|
|
||||
2. Configuration.......................................|requirements-config|
|
||||
3. Functions........................................|requirements-functions|
|
||||
|
||||
==============================================================================
|
||||
INTRODUCTION *requirements-intro*
|
||||
|
||||
<doc/requirements.txt> is generated by <https://github.com/google/vimdoc>. See
|
||||
<README.md> for more information about installation and screenshots.
|
||||
|
||||
==============================================================================
|
||||
CONFIGURATION *requirements-config*
|
||||
|
||||
*requirements:g:requirements#cache*
|
||||
Completion cache path.
|
||||
Default: s:cache_dir . '/requirements.json' `
|
||||
|
||||
*requirements:g:requirements#items*
|
||||
Completion cache contents. For program.
|
||||
Default: s:items `
|
||||
|
||||
==============================================================================
|
||||
FUNCTIONS *requirements-functions*
|
||||
|
||||
coc#source#requirements#init() *coc#source#requirements#init()*
|
||||
https://github.com/neoclide/coc.nvim/wiki/Create-custom-source
|
||||
|
||||
coc#source#requirements#complete({opt}, {cb})
|
||||
*coc#source#requirements#complete()*
|
||||
https://github.com/neoclide/coc.nvim/wiki/Create-custom-source
|
||||
|
||||
Completion pip option and PYPI package names. Note: completion PYPI package
|
||||
names need install pip-cache from PYPI, and run `pip-cache update` first to
|
||||
generate cache.
|
||||
|
||||
requirements#update_cache() *requirements#update_cache()*
|
||||
Update cache.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
Reference in New Issue
Block a user