[nvim] fix coc#status error/warning signs

This commit is contained in:
Dmytro Meleshko 2020-01-06 16:16:24 +02:00
parent ff47c00035
commit 42c2d37734
10 changed files with 28 additions and 25 deletions

View file

@ -1,7 +1,7 @@
let s:filetypes = ['c', 'cpp', 'objc', 'objcpp']
let g:coc_filetypes += s:filetypes
call coc#config('languageserver.ccls', {
let g:coc_user_config['languageserver.ccls'] = {
\ 'filetypes': s:filetypes,
\ 'command': 'ccls',
\ 'rootPatterns': ['.ccls', 'compile_commands.json', '.vim/', '.git/', '.hg/'],
@ -10,10 +10,10 @@ call coc#config('languageserver.ccls', {
\ 'directory': '/tmp/ccls',
\ },
\ },
\ })
\ }
" call coc#config('languageserver.clangd', {
" let g:coc_user_config['languageserver.clangd'] = {
" \ 'filetypes': s:filetypes,
" \ 'command': 'clangd',
" \ 'rootPatterns': ['compile_flags.txt', 'compile_commands.json', '.vim/', '.git/', '.hg/'],
" \ })
" \ }

View file

@ -1,2 +1,2 @@
call coc#add_extension('coc-css')
let g:coc_global_extensions += ['coc-css']
let g:coc_filetypes += ['css', 'scss', 'less']

View file

@ -1,8 +1,8 @@
let s:filetypes = ['haskell', 'lhaskell', 'chaskell']
let g:coc_filetypes += s:filetypes
call coc#config('languageserver.haskell', {
let g:coc_user_config['languageserver.haskell'] = {
\ 'filetypes': s:filetypes,
\ 'command': 'hie-wrapper',
\ 'rootPatterns': ['.stack.yaml', 'cabal.config', 'package.yaml'],
\ 'initializationOptions': {},
\ })
\ }

View file

@ -1,4 +1,4 @@
call coc#add_extension('coc-html', 'coc-emmet')
let g:coc_global_extensions += ['coc-html', 'coc-emmet']
let s:emmet_filetype_mapping = { 'jinja': 'html' }
let g:coc_filetypes += ['html'] + keys(s:emmet_filetype_mapping)
call coc#config('emmet.includeLanguages', s:emmet_filetype_mapping)
let g:coc_user_config['emmet.includeLanguages'] = s:emmet_filetype_mapping

View file

@ -1,13 +1,13 @@
call coc#add_extension('coc-tsserver', 'coc-eslint', 'coc-prettier')
let g:coc_global_extensions += ['coc-tsserver', 'coc-eslint', 'coc-prettier']
let g:coc_filetypes += ['javascript', 'javascript.jsx', 'typescript', 'typescript.jsx']
call coc#config('eslint', {
let g:coc_user_config['eslint'] = {
\ 'filetypes': ['javascript', 'javascriptreact'],
\ 'autoFixOnSave': v:true,
\ })
call coc#config('prettier', {
\ }
let g:coc_user_config['prettier'] = {
\ 'singleQuote': v:true,
\ 'trailingComma': 'all',
\ 'jsxBracketSameLine': v:true,
\ 'eslintIntegration': v:true,
\ 'disableSuccessMessage': v:true
\ })
\ }

View file

@ -1,2 +1,2 @@
call coc#add_extension('coc-json')
let g:coc_global_extensions += ['coc-json']
let g:coc_filetypes += ['json', 'json5']

View file

@ -1,7 +1,7 @@
call coc#add_extension('coc-python')
let g:coc_global_extensions += ['coc-python']
let g:coc_filetypes += ['python']
call coc#config('pyls.plugins.pycodestyle.ignore', ['E501'])
call coc#config('python', {
let g:coc_user_config['pyls.plugins.pycodestyle.ignore'] = ['E501']
let g:coc_user_config['python'] = {
\ 'autocomplete': { 'showAdvancedMembers': v:false },
\ 'formatting': { 'provider': 'black' },
\ 'linting': {
@ -9,4 +9,4 @@ call coc#config('python', {
\ 'flake8Enabled': v:true,
\ 'flake8Args': ['--ignore', 'E501'],
\ },
\ })
\ }

View file

@ -1,3 +1,3 @@
call coc#add_extension('coc-rls')
let g:coc_global_extensions += ['coc-rls']
let g:coc_filetypes += ['rust']
call coc#config('rust', { 'clippy_preference': 'on' })
let g:coc_user_config['rust'] = { 'clippy_preference': 'on' }

View file

@ -74,13 +74,16 @@ endif
command! -nargs=0 -range -bar CocFormat call s:CocFormat(<range>, <line1>, <line2>)
" }}}
call coc#add_extension('coc-snippets')
call coc#config('diagnostic', {
let g:coc_global_extensions = []
let g:coc_user_config = {}
let g:coc_global_extensions += ['coc-snippets']
let g:coc_user_config['diagnostic'] = {
\ 'virtualText': v:true,
\ 'enableMessage': 'jump',
\ 'errorSign': 'XX',
\ 'warningSign': '!!',
\ })
\ }
runtime! coc-languages/*.vim

View file

@ -135,7 +135,7 @@ endif
let g:airline_section_{a:section} = g:airline_section_{a:section} . airline#section#create_left([''] + a:items)
endfunction
function s:tweak_airline()
if exists('*coc#status')
if g:vim_ide
call s:airline_section_prepend('x', ['coc#status'])
endif
call s:airline_section_append('y', ['filesize'])