neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.33k stars 956 forks source link

Disable TSServer for Flow files #45

Closed camflan closed 6 years ago

camflan commented 6 years ago

Describe the bug Attempting to get only Flow working on flow files, as the tsserver is reporting syntax errors specific to ts type annotations vs flow annotations

To Reproduce Open flow typed files, see tsserver errors.

I've re-added the neovim-languageclient plugin (I had removed it prior to installing Coc) configured the "languageservers" section of the config file and added

"coc.tslint.enable": false,
"coc.tsserver.enable": false,

to my coc config and it still shows tsserver errors in addition to my flow errors.

Expected behavior I would see flow errors, not tsserver errors

Screenshots screen shot 2018-08-07 at 12 22 34 pm

Desktop (please complete the following information):

Additional context .vimrc

" camron flanders <me@camronflanders.com>
" last update: 08-07-2017:CBF

" feel free to use all or part of my vimrc to learn, modify, use. If used in
" a .vimrc you intend to distribute, please credit appropriately.

set nocompatible                                                    "screw vi, vim's better

"git-plug configuration {{{

" plug-ins list  {{{
if has('nvim')
    if empty(glob('~/.config/nvim/autoload/plug.vim'))
        silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
        autocmd VimEnter * PlugInstall | source $MYVIMRC
    endif

    call plug#begin('~/.config/nvim/bundle')
    "Plug 'benekastah/neomake'
else
    " Load vim-plug automatically, even if it's not installed
    if empty(glob('~/.vim/autoload/plug.vim'))
        silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
        autocmd VimEnter * PlugInstall | source $MYVIMRC
    endif

    call plug#begin('~/.vim/bundle')
endif

if has('nvim') || (v:version >= 800)
    Plug 'neoclide/coc.nvim', {'do': './install.sh'}

    Plug 'autozimu/LanguageClient-neovim', {
        \ 'branch': 'next',
        \ 'do': 'bash install.sh',
        \ }
    Plug '/usr/local/opt/fzf' | Plug 'junegunn/fzf.vim'
else
    Plug 'scrooloose/syntastic'
endif

Plug 'Raimondi/delimitMate'
Plug 'Shougo/vimproc.vim'
Plug 'joonty/vdebug'

Plug 'itchyny/lightline.vim'

"Plug 'ctrlpvim/ctrlp.vim'
"Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
Plug 'wincent/terminus'

Plug 'kristijanhusak/vim-carbon-now-sh'

Plug 'christoomey/vim-tmux-navigator'
Plug 'AndrewRadev/switch.vim'
Plug 'dzeban/vim-log-syntax'
Plug 'easymotion/vim-easymotion'
Plug 'godlygeek/tabular'
Plug 'jbgutierrez/vim-babel'

Plug 'brooth/far.vim'

Plug 'mattn/emmet-vim'
Plug 'mhinz/vim-signify'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'rhysd/conflict-marker.vim'
Plug 'rking/ag.vim'
Plug 'scrooloose/nerdcommenter'

Plug 'reasonml-editor/vim-reason-plus'

Plug 'terryma/vim-multiple-cursors'
Plug 'tpope/vim-characterize'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-rsi'
Plug 'tpope/vim-speeddating'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-vinegar'

Plug 'christoomey/vim-conflicted'

Plug 'vim-scripts/YankRing.vim'
Plug 'vim-scripts/vcscommand.vim'
Plug 'wellle/targets.vim'

Plug 'docunext/closetag.vim'

Plug 'vim-scripts/SQLUtilities'
Plug 'vim-scripts/Align'

" syntax/language files
Plug 'sheerun/vim-polyglot'
"Plug 'fatih/vim-go'
Plug 'chrisbra/csv.vim'
Plug '2072/vim-syntax-for-PHP'
Plug 'mxw/vim-jsx'
Plug 'pangloss/vim-javascript'

" color themes
Plug 'altercation/vim-colors-solarized'
Plug 'tomasr/molokai'
Plug 'mhartington/oceanic-next'
"Plug 'marciomazza/vim-brogrammer-theme'

call plug#end()
"}}}
"}}}

if &t_Co > 2
    syntax on
endif

if &t_Co >= 256 || has("termguicolors") || has("gui_running")
    if has("termguicolors")
        set termguicolors
    endif

    if has("gui_running")
        set macligatures
        set anti                                                            "make text pretty
    else
        set mouse=a
    endif

    set background=dark
    let g:oceanic_next_terminal_bold = 1
    let g:oceanic_next_terminal_italic = 1
    colorscheme OceanicNext
endif

if v:version > 703 || v:version == 703 && has('patch541')
  set formatoptions+=j                                              " makes lines join properly, removes extra comment syntax and such
endif

let mapleader = "\<Space>"                                          "set leader to spacebar

set autoread
"set relativenumber                                                  "line numbers show current line and relative offsets
"set number
set noshowmode

set path+=**

"set cursorline                                                      "highlight the current line

" only highlight the cursorline in the active window
augroup CursorLine
  au!
  au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
  au WinLeave * setlocal nocursorline
augroup END

let g:gitgutter_max_signs = 1000                                      "limit how many signs gitgutter calculates, so it doesn't get _too_ slow
let g:gitgutter_realtime = 0
let g:gitgutter_eager = 0

"startup settings {{{

"source a few files {{{

"source macros/matchit.vim

"}}}
"backup/swp settings {{{

set nobackup
set noswapfile
set noundofile

"}}}
"file type settings, on {{{

filetype on
filetype plugin on                                                  "turn on filetype based plugins
                                                                    "filetype indent is also on, in the next section.

"}}}

"}}}
"indention stuff {{{

filetype indent on                                                  "indent based on filetype
set shiftround                                                      "round to a multiple of my tab settings
"set autoindent                                                     "indent, duh
"set smartindent                                                    "we'll autoindent (with intelligence), bitches
"set cin                                                            "auto c-indenting

"}}}
"completion settings {{{

"set complete+=k                                                     "built in plus my defined, below
"set showfulltag                                                     "show me args for tag
"set tags+=.tags,tags,~/.vimtags;

"}}}
"stuff {{{

let xml_use_xhtml = 1                                               "close html as xhtml, properly.
set encoding=utf-8
set scrolloff=3
set nowrap
set hidden                                                          "let me have hidden buffers
set showmatch                                                       "show me where the matching bracket is
set ttyfast
set ruler                                                           "show me the ruler!
set rulerformat=%35(%5l,%-6(%c%V%)\ %5L\ %P%)                       "my ruler shows: line/vColumn/total/pos
set guifont=Fantasque\ Sans\ Mono:h15                               "use guifont=* to open font picker
set history=1000                                                    "keep last 1000 commands
set undolevels=1000                                                 "use many muchos levels of undo
set sc                                                              "show commands as I type
set visualbell                                                      "a quiet vim is a happy vim
set backspace=indent,eol,start                                      "allow backspacing over everything
set modeline
set shortmess=atITA                                                 "I don't want long messages
set nostartofline                                                   "keep my cursor where it was
set fen                                                             "let me fold things
set foldmethod=indent                                               "and fold on indents
set foldlevelstart=99
set foldnestmax=10                                                  "10 nested fold max

set lazyredraw                                                      "don't update the screen during macros

set list                                                            "show chars
set listchars=tab:▸\ ,trail:·,extends:»,nbsp:·                      "how to show chars

nnoremap <leader>z za

"}}}
"wildmenu {{{

set wildmenu                                                        "go wild!
set wildmode=longest,list:longest                                      "tame the wildness, using unix-style match
set wildignore=*.o,*.obj,*.bak,*.exe,*.pyc,*.DS_Store,*.db,*/.git/*,*/tmp/*,*.swp          "don't show me crap I don't want

set completeopt=preview,menuone
"}}}
"gui options {{{

if has('gui_running')
    set guitablabel=%t                                                  "tabs display file name

    "kick it old school, no gui needed.
    set guioptions-=T                                                   "kill toolbar
    set guioptions-=m                                                   "kill menu
    set guioptions-=r                                                   "kill right scrollbar
    set guioptions-=l                                                   "kill left scrollbar
    set guioptions-=L                                                   "kill left scrollbar with multiple buffers
endif

"}}}
"cursor options {{{

set gcr=a:blinkwait500-blinkon1000-blinkoff150                      "tune the blinking of the cursor
set gcr=i:hor10                                                     "underline cursor. not too thick not too thin. goldielocks style
set gcr=v:block                                                     "selecting should cover the text

"}}}
"tab stuff {{{

set expandtab                                                       "expand tabs to spaces, when not an indent
set smarttab                                                        "let's be smart about our tabs
set shiftwidth=4                                                    "make tabs 4 spaces
set softtabstop=4                                                   "softtab value, 4 spaces
set tabstop=4                                                       "keep default for softtab compat.

"}}}
"search / diff {{{

set hlsearch                                                        "highlight what I find
set incsearch                                                       "show matches as I type
set ignorecase smartcase                                            "ignore case unless I type in multi-case

set laststatus=2

"}}}
"plugin settings {{{

"easymotion {{{
"move to line
map <Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader>L <Plug>(easymotion-overwin-line)

" Move to word
map  <Leader>W <Plug>(easymotion-bd-w)
nmap <Leader>W <Plug>(easymotion-overwin-w)

"}}}

"multi cursor
"let g:multi_cursor_start_key='<C-m>'

"surround {{{

autocmd FileType php let b:surround_45 = "<?php \r ?>"
autocmd FileType php let b:surround_95 = "<?= \r ?>"

"}}}

"fzf settings {{{

nnoremap <leader>f :Files<CR>
nnoremap <leader>d :Buffers<CR>
nnoremap <leader>t :Tags<CR>

"[Buffers] Jump to the existing window if possible
let g:fzf_buffers_jump = 1

" Customize fzf colors to match your color scheme
let g:fzf_colors =
  \ { 'fg':      ['fg', 'Normal'],
  \ 'bg':      ['bg', 'Normal'],
  \ 'hl':      ['fg', 'Comment'],
  \ 'fg+':     ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
  \ 'bg+':     ['bg', 'CursorLine', 'CursorColumn'],
  \ 'hl+':     ['fg', 'Statement'],
  \ 'info':    ['fg', 'PreProc'],
  \ 'border':  ['fg', 'Ignore'],
  \ 'prompt':  ['fg', 'Conditional'],
  \ 'pointer': ['fg', 'Exception'],
  \ 'marker':  ['fg', 'Keyword'],
  \ 'spinner': ['fg', 'Label'],
  \ 'header':  ['fg', 'Comment'] }

"}}}

"ctrlP settings {{{
"let g:ctrlp_use_caching = 0

"nnoremap <leader>f :CtrlPMixed<CR>

"if executable('rg')
    "set grepprg=rg\ --color=never
    "let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""'
    "let g:ctrlp_use_caching = 0
"else
    "if executable('ag')
        "set grepprg=ag\ --nogroup\ --nocolor
        "let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
    "endif
"endif
"}}}

"syntastic settings {{{
"set statusline=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*

"let g:syntastic_aggregate_errors = 1
"let g:syntastic_always_populate_loc_list = 0
"let g:syntastic_auto_loc_list = 1
"let g:syntastic_check_on_open = 1
"let g:syntastic_check_on_wq = 0

"let g:syntastic_javascript_checkers = ['flow', 'eslint',]
"let g:syntastic_scss_checkers = ['sassc']
"let g:syntastic_php_checkers = ['php']

"augroup javascript_lint_group
    "autocmd!
    "autocmd FileType javascript call CBFSetEsLintPath()
    "autocmd FileType javascript.jsx call CBFSetEsLintPath()
"augroup END

"function! CBFSetEsLintPath()
    "" Point syntastic checker at locally installed `eslint` if it exists.
    "if executable('node_modules/.bin/eslint')
        "let b:syntastic_javascript_eslint_exec = 'node_modules/.bin/eslint'
        "let g:syntastic_javascript_eslint_args = ['--fix']
    "endif
"endfunction

"function! SyntasticCheckHook(error)
    "checktime
"endfunction
"}}}

"lightline {{{
let g:lightline = {
\   'component': {
\       'lineinfo': "%3l:%-2v/%{line('$')}"
\   }
\ }
"}}}

"YankRing {{{
let g:yankring_history_dir = "/tmp"
"}}}

"JSX {{{
let g:jsx_ext_required = 0

"}}}

"VDebug {{{
if !exists('g:vdebug_options')
    let g:vdebug_options = {}
endif

"let g:vdebug_options["break_on_open"] = 0
let g:vdebug_options["watch_window_height"]=45
let g:vdebug_options["status_window_height"]=5
" let g:vdebug_options["continuous_mode"]=1
let g:vdebug_options["path_maps"] = {
\    "/vagrant": "/Users/camron/src/lodgetools/inntender",
\    "/code": "/Users/camron/src/lodgetools/inntender",
\   "/var/www/html": "/Users/camron/src/lodgetools/channel_manager"
\}
"}}}

"Ultisnips {{{
"let g:UltiSnipsExpandTrigger="<c-j>"
"let g:UltiSnipsJumpBackwardTrigger="<c-z>"

"}}}

"YCM {{{
"let g:ycm_add_preview_to_completeopt = 1
"let g:ycm_autoclose_preview_window_after_completion = 1

"if !exists('g:ycm_semantic_triggers')
    "let g:ycm_semantic_triggers = {}
"endif

"}}}

"CoC configuration {{{

imap <silent> <C-x><C-u> <Plug>(coc-complete-custom)
autocmd CursorHoldI,CursorMovedI * silent! call CocAction('showSignatureHelp')

"}}}

"LanguageClient {{{
"let g:LanguageClient_autoStart = 1
"let g:LanguageClient_autoStop = 1

"let g:LanguageClient_serverCommands = {
    "\ 'reason': ['ocaml-language-server', '--stdio'],
    "\ 'ocaml': ['ocaml-language-server', '--stdio'],
    "\ 'javascript': ['flow-language-server', '--stdio'],
    "\ 'javascript.jsx': ['flow-language-server', '--stdio'],
    "\ 'dockerfile': ['docker-langserver', '--stdio'],
    "\ 'python': ['pyls'],
    "\ }

"nnoremap <silent> <leader>ld :call LanguageClient_textDocument_definition()<cr>
"nnoremap <silent> <leader>lf :call LanguageClient_textDocument_formatting()<cr>
"nnoremap <silent> <leader>lr :call LanguageClient_textDocument_rename()<cr>
"nnoremap <silent> <cr> :call LanguageClient_textDocument_hover()<cr>

"set omnifunc=LanguageClient#complete

"}}}

"Vim-Reason {{{

"}}}

"Ale / linting {{{

let g:javascript_plugin_flow = 1

nmap <silent> <leader>k <Plug>(ale_previous_wrap)
nmap <silent> <leader>j <Plug>(ale_next_wrap)

let g:ale_linters = {}
let g:ale_linters.javascript = ['flow', 'eslint',]
let g:ale_linters.php = ['php']
let g:ale_linters.python = ['flake8']
let g:ale_linters.scss = ['stylelint']

let g:ale_fix_on_save = 1
let g:ale_fixers = {}
let g:ale_fixers.javascript = ['eslint']
let g:ale_fixers.scss = ['stylelint']

let g:ale_history_log_output = 1

"}}}

"Undo Tree {{{

"nnoremap <leader>u :GundoToggle<CR>
"let g:gundo_right = 1

"}}}

"Explore map & settings {{{
nnoremap <leader>e :Ex<CR>

let g:netrw_liststyle=3
autocmd FileType netrw setl bufhidden=delete        " this will remove the explore buffers when hidden, so we can quit without bd! each one

"}}}

"TagBar {{{

"nnoremap <leader>t  :TagbarToggle<CR>

""}}}

"PHP CS Fixer {{{

let g:php_cs_fixer_level = "symfony"
let g:php_cs_fixer_config_file = '.php_cs'

""}}}

"NERDCommenter {{{

let NERDShutUp  =   1                                               "don't complain to me
map <leader>cc <plug>NERDCommenterToggle

"}}}

" prettier {{{
let g:prettier#quickfix_auto_focus = 0
let g:prettier#autoformat = 0
let g:prettier#config#print_width = 80
let g:prettier#config#tab_width = 4
let g:prettier#config#use_tabs = 'false'
let g:prettier#config#semi = 'false'
let g:prettier#config#single_quote = 'true'
let g:prettier#config#bracket_spacing = 'true'
let g:prettier#config#jsx_bracket_same_line = 'false'
let g:prettier#config#arrow_parens = 'always'
let g:prettier#config#trailing_comma = 'es5'
let g:prettier#config#parser = 'babylon'
let g:prettier#config#prose_wrap = 'preserve'

" ignore the above defaults and use file in the project, if found
let g:prettier#config#config_precedence = 'prefer-file'
"autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue PrettierAsync
"}}}

" ctrl space options {{{

"let g:CtrlSpaceSymbols = { "Vis": "ϟ"}
"nnoremap <silent><leader>f :CtrlSpace O<cr>
"nnoremap <silent><leader>b :CtrlSpace H<cr>

"}}}

" Use ag for search
if executable('ag')
  let g:CtrlSpaceGlobCommand = 'ag -l --nocolor -g ""'
endif

"}}}

"Gist options {{{
let g:gist_clip_command = 'pbcopy'
let g:gist_detect_filetype = 1
let g:gist_open_browser_after_post = 1

let g:github_user = "camflan"
let g:github_token = "897b6a6109e0de41cdb13f391ba62ea2"

"}}}

"}}}
"omnicomplete setup {{{

"autocmd FileType python set omnifunc=pythoncomplete#Complete
"autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
"autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
"autocmd FileType css set omnifunc=csscomplete#CompleteCSS
"autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd BufNewFile,BufRead *.scss set ft=scss.css

nnoremap <leader>g :AgBuffer

"}}}
"abbreviations {{{

" Correct Typos {{{

" English {{{
iab beacuse    because
iab becuase    because
iab acn        can
iab cna        can
iab centre     center
iab chnage     change
iab chnages    changes
iab chnaged    changed
iab chnagelog  changelog
iab Chnage     Change
iab Chnages    Changes
iab ChnageLog  ChangeLog
iab debain     debian
iab Debain     Debian
iab defualt    default
iab Defualt    Default
iab differnt   different
iab diffrent   different
iab emial      email
iab Emial      Email
iab figth      fight
iab figther    fighter
iab fro        for
iab fucntion   function
iab ahve       have
iab homepgae   homepage
iab logifle    logfile
iab lokk       look
iab lokking    looking
iab mial       mail
iab Mial       Mail
iab miantainer maintainer
iab amke       make
iab mroe       more
iab nwe        new
iab recieve    receive
iab recieved   received
iab erturn     return
iab retrun     return
iab retunr     return
iab seperate   separate
iab shoudl     should
iab soem       some
iab taht       that
iab thta       that
iab teh        the
iab tehy       they
iab truely     truly
iab waht       what
iab wiht       with
iab whic       which
iab whihc      which
iab yuo        you
iab databse    database
iab versnio    version
iab obnsolete  obsolete
iab flase      false
iab recrusive  recursive
iab Recrusive  Recursive
"}}}
" Days of week {{{
iab monday     Monday
iab tuesday    Tuesday
iab wednesday  Wednesday
iab thursday   Thursday
iab friday     Friday
iab saturday   Saturday
iab sunday     Sunday
"}}}

"}}}

"}}}
"key mappings {{{
"unmaps {{{

"}}}
"plugin mappings {{{

let g:user_emmet_leader_key = '<C-Y>'

"}}}
".vimrc editing maps {{{

"makes it easy to edit/reload vimrc for tweaks. I like to tweak.
:nmap <leader>s :so $MYVIMRC<CR>
:nmap <leader>v :vsp $MYVIMRC<CR>

"}}}
"mappings to swap 2 words {{{

" Swap word with next word
nmap <silent> gw    "_yiw:s/\(\%#\w\+\)\(\_W\+\)\(\w\+\)/\3\2\1/<cr>

"}}}
"newlines while typing {{{

" here are some commands for new lines, quickly while in insert mode
"imap <D-CR> <Esc>o
"imap <D-S-CR> <Esc>A;<CR>
"imap <D-S-A> <Esc>A:<CR>

"}}}
"buffer navigation nmaps {{{

map <C-h> <C-W>h
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-l> <C-W>l

"}}}
"general maps {{{

"make vim use correct regexes
nnoremap / /\v
vnoremap / /\v

nnoremap <leader>l :set list!<cr>

" Speed up scrolling of the viewport slightly
"nnoremap <C-e> 2<C-e>
"nnoremap <C-y> 2<C-y>

"changes :command to ;command making it faster
nnoremap ; :
vnoremap ; :

"make this the way it should work by default
noremap Y y$

"toggle wrap
nmap <leader>w :set nowrap!<CR>

"when wrapping, wrap text to the correct indentation
set breakindent
set showbreak=↪

" make jj esc, in insert mode.
inoremap jj <C-[>

" disable esc key to stop using it
inoremap <esc> <nop>

" easily, temporarily disable search highlighting"
nmap <silent> <leader>/ :silent :nohlsearch<CR>

" sudo write to files that weren't opened with sudo originally!
cmap w!! w !sudo tee % >/dev/null

"}}}
"expansions {{{

"file directory
imap <leader>fd    <C-R>=expand("%:p:h")<CR>
" present working dir
imap <leader>pwd   <C-R>=getcwd()<CR>

"}}}

"}}}

"autocmd {{{
"remove trailling whitespace
autocmd FileType c,cpp,java,php autocmd BufWritePre <buffer> %s/\s\+$//e
"}}}

"functions {{{

"python refactoring method {{{
function! PythonExtractMethod() range
let name = inputdialog("Name of new method: ")
let args = inputdialog("Argument list: ")
'<
exe "normal O\<cr>def " . name ."(" . args . "):\<esc>"
'>
exe "normal o#return \<cr>\<esc>"
normal >'<
endfunction
"}}}
"insert/swap iScript debug statements {{{
function! Logging(level)
    let base_string = 'debug.log("' . a:level . '", "'
    let curr_line = getline('.')

    let match = match(curr_line, "debug")

    if match == -1
        execute "normal i" . base_string
    else
        for this_level in ['CRITICAL', 'ERROR', 'WARNING', 'NOTIFY', 'INFO', 'DEBUG']
            let new_string = substitute(curr_line, '"' . this_level . '"', '"' . a:level . '"', "")
            if new_string != curr_line
                execute "normal ddO" . new_string
                break
            endif
        endfor
    endif
endfunction
"}}}
" Refactor function to easily find/replace a dictionary of words with new words {{{
" Refactor the given lines using a dictionary
" replacing all occurences of each key in the dictionary with its value
function! Refactor(dict) range
  execute a:firstline . ',' . a:lastline .  's/\C\<\%(' . join(keys(a:dict),'\|'). '\)\>/\='.string(a:dict).'[submatch(0)]/ge'
endfunction

command! -range=% -nargs=1 Refactor :<line1>,<line2>call Refactor(<args>)
"}}}

"iScript imaps {{{

"these will input the beginning of a debug.log statement for iScriptDebug
imap \dc <Esc>:call Logging("CRITICAL")<CR>a
imap \de <Esc>:call Logging("ERROR")<CR>a
imap \dw <Esc>:call Logging("WARNING")<CR>a
imap \dn <Esc>:call Logging("NOTIFY")<CR>a
imap \di <Esc>:call Logging("INFO")<CR>a
imap \dd <Esc>:call Logging("DEBUG")<CR>a

"this will swap the current debug level for a new one
nmap \dc :call Logging("CRITICAL")<CR>
nmap \de :call Logging("ERROR")<CR>
nmap \dw :call Logging("WARNING")<CR>
nmap \dn :call Logging("NOTIFY")<CR>
nmap \di :call Logging("INFO")<CR>
nmap \dd :call Logging("DEBUG")<CR>

"}}}

let $PATH=$PATH . ':' . expand('~/.composer/vendor/bin')

" vim:foldmethod=marker:foldlevel=1:ft=vim:

cot-settings.json

{
    "coc.preferences.autoTrigger": "trigger",
    "coc.preferences.timeout": 300,
    "coc.tslint.enable": false,
    "coc.tsserver.enable": false,
    "languageserver": {
        "reason": {
            "command": "ocaml-language-server",
            "args": ["start", "--stdio"],
            "filetypes": ["reason"],
            "initializationOptions": {},
            "settings": {}
        },
        "flow": {
            "command": "flow-language-server",
            "args": ["--stdio"],
            "filetypes": ["javascript", "javascript.jsx"],
            "initializationOptions": {},
            "settings": {}
        }
    }
}
chemzqm commented 6 years ago
"coc.tslint.enable": false,
"coc.tsserver.enable": false,

They're not valid configurations, they won't work, try

yarn global add vscode-json-languageserver

to get completion support for coc-settings.json.

You can disable tsserver by create file .vim/coc-settings.json in the folder of your flow project, and add configuration:

{
  "tsserver.enableJavascript": false
}
camflan commented 6 years ago

Oh, weird. I have the vscode-json-languageserver installed, that's how I got those keys in cot-settings

screen shot 2018-08-08 at 10 39 58 am

I also have "tsserver.enableJavascript": false in my $HOME/.vim/coc-settings.json file. Do I also need this in each of my flow projects?

here's my coc-settings.json for reference,

{
    "coc.preferences.autoTrigger": "trigger",
    "coc.preferences.timeout": 300,
    "coc.tslint.enable": false,
    "coc.tsserver.enable": false,
    "coc.tsserver.enableJavascript": false,
    "languageserver": {
        "reason": {
            "command": "ocaml-language-server",
            "args": ["start", "--stdio"],
            "filetypes": ["reason"],
            "initializationOptions": {},
            "settings": {}
        },
        "flow": {
            "command": "flow-language-server",
            "args": ["--stdio", "--try-flow-bin"],
            "filetypes": ["javascript", "javascript.jsx"],
            "initializationOptions": {},
            "settings": {}
        }
    }
}
chemzqm commented 6 years ago

Do I also need this in each of my flow projects?

Not needed.

"coc.tsserver.enableJavascript": false,

should be

"tsserver.enableJavascript": false,

The json language server use snippet feature, it's better to use confirm to get the completion result, so bind <cr> to <C-y> is recommanded:

  inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"

Another tip is not type " before completion, just type tslint and type <cr> to select.

chemzqm commented 6 years ago

Fix needed for json extension to avoid such miss leading completion.

danielo515 commented 4 years ago

But, disabling tsserver like this will also turn off other features like variable renaming, right?

sushantdhiman commented 4 years ago

"javascript.validate.enable": false works for me

tim-phillips commented 2 years ago

Disable javascript in your flow project only by creating .vim/coc-settings.json in your project's directory with:

{
  "tsserver.enableJavascript": false
}

https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file#configuration-file-resolve

chemzqm commented 2 years ago

Use "tsserver.enable": false and start vim from the directory of your project is recommended