Skip to content

Commit

Permalink
commit 91c1114
Browse files Browse the repository at this point in the history
91c1114 fix(diagnostic): avoid change range of diagnostics
cad8c6b fix(workspace): fix range of getSelectedRange with line mode
18f81ab chore(picker): use await to avoid test fail
3efce54 fix(diagnostic): no more emptyRange check (#3147)
837941f fix float window position control to consider multigrid ui (#3150)
046505c test(ci): use node12
acd723d fix(completion): avoid unnecessary redraw for floating window (#3151)
10cfe59 docs: inconsistent suggest.triggerCompletionWait value (#3152)
dafed9d fix: remove polyfill of Promise.prototyp.finally (#3153)
493ea2e fix(diagnostic): check diagnostic next to eol character
31e76d4 refactor(handler): fetch codelens for all buffers on CursorHold
e47e472 fix(diagnostic): adjust diagnostic range which pass last line
ba9c5c8 chore(yarn): upgrade esbuild.js
9b60af3 chore(bin): remove unnecessary check.js
179ca72 fix: typos found by github.com/crate-ci/typos (#3146)
70a7903 LSP 3.16.0 (#2756)
8cb6bdc fix(float): should give foldcolumn a default value (#3140)
171ff2b chore(bin): remove unnecessary check.js
1377f3b fix: yarn.lock (#3136)
  • Loading branch information
chemzqm committed Jun 22, 2021
1 parent 0692698 commit 153fdc4
Show file tree
Hide file tree
Showing 10 changed files with 314 additions and 67,902 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _True snippet and additional text editing support_

## Quick Start

Install [nodejs](https://nodejs.org/en/download/) >= 10.12:
Install [nodejs](https://nodejs.org/en/download/) >= 12.12:

```sh
curl -sL install-node.now.sh/lts | bash
Expand Down
7 changes: 4 additions & 3 deletions autoload/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ endfunction
function! coc#_complete() abort
let items = get(g:coc#_context, 'candidates', [])
let preselect = get(g:coc#_context, 'preselect', -1)
call complete(
\ g:coc#_context.start + 1,
\ items)
let startcol = g:coc#_context.start + 1
if s:select_api && len(items) && preselect != -1
noa call complete(startcol, items)
call nvim_select_popupmenu_item(preselect, v:false, v:false, {})
else
call complete(startcol, items)
endif
return ''
endfunction
Expand Down
2 changes: 1 addition & 1 deletion autoload/coc/compat.vim
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function! coc#compat#matchaddgroups(winid, groups) abort
endif
endfunction

" remove keymap for specfic buffer
" remove keymap for specific buffer
function! coc#compat#buf_del_keymap(bufnr, mode, lhs) abort
if !bufloaded(a:bufnr)
return
Expand Down
4 changes: 3 additions & 1 deletion autoload/coc/float.vim
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ function! coc#float#create_float_win(winid, bufnr, config) abort
" no left border
if s:empty_border(get(a:config, 'border', [])) || a:config['border'][3] == 0
call setwinvar(winid, '&foldcolumn', 1)
else
call setwinvar(winid, '&foldcolumn', 0)
endif
call nvim_win_set_cursor(winid, [1, 0])
call coc#float#nvim_create_related(winid, config, a:config)
Expand Down Expand Up @@ -342,7 +344,7 @@ function! coc#float#nvim_scrollbar(winid) abort
return
endif
let config = nvim_win_get_config(a:winid)
let [row, column] = nvim_win_get_position(a:winid)
let [row, column] = [config.row, config.col]
let width = nvim_win_get_width(a:winid)
let height = nvim_win_get_height(a:winid)
let bufnr = winbufnr(a:winid)
Expand Down
40 changes: 40 additions & 0 deletions autoload/coc/highlight.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,46 @@ if has('nvim-0.5.0')
endtry
endif

function! coc#highlight#get_highlights(bufnr, key) abort
let l:res = []

if s:is_vim
let l:lines = len(getbufline(a:bufnr, 1, '$'))
for l:line in range(l:lines)
let l:list = prop_list(l:line + 1, {"bufnr": a:bufnr})
for l:prop in l:list
if l:prop["start"] == 0 || l:prop["end"] == 0
" multi line tokens are not supported; simply ignore it
continue
endif

let l:group = l:prop["type"]
let l:start = l:prop["col"] - 1
let l:end = l:start + l:prop["length"]
call add(l:res, {
\ "group": l:group,
\ "line": l:line,
\ "startCharacter": l:start,
\ "endCharacter": l:end
\ })
endfor
endfor
else
let srcId = s:create_namespace(a:key)
let l:marks = nvim_buf_get_extmarks(a:bufnr, srcId, 0, -1, {"details": v:true})
for [_, l:line, l:start, l:details] in l:marks
call add(l:res, {
\ "group": l:details["hl_group"],
\ "line": l:line,
\ "startCharacter": l:start,
\ "endCharacter": l:details["end_col"]
\ })
endfor
endif

return l:res
endfunction

" highlight LSP range,
function! coc#highlight#ranges(bufnr, key, hlGroup, ranges) abort
let bufnr = a:bufnr == 0 ? bufnr('%') : a:bufnr
Expand Down
7 changes: 2 additions & 5 deletions autoload/health/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ function! s:checkEnvironment() abort
if empty(ms)
let valid = 0
call health#report_error('Unable to detect version of node, make sure your node executable is http://nodejs.org/')
elseif str2nr(ms[1]) < 8 || (str2nr(ms[1]) == 8 && str2nr(ms[2]) < 10)
elseif str2nr(ms[1]) < 12 || (str2nr(ms[1]) == 12 && str2nr(ms[2]) < 12)
let valid = 0
call health#report_error('Node.js version '.output.' < 8.10.0, please upgrade node.js')
elseif str2nr(ms[1]) < 10 || (str2nr(ms[1]) == 10 && str2nr(ms[2]) < 12)
let valid = 0
call health#report_warn('Node.js version '.trim(output).' < 10.12.0, please upgrade node.js')
call health#report_warn('Node.js version '.trim(output).' < 12.12.0, please upgrade node.js')
endif
if valid
call health#report_ok('Environment check passed')
Expand Down
Loading

0 comments on commit 153fdc4

Please sign in to comment.