Skip to content

Commit

Permalink
commit 9190bfe
Browse files Browse the repository at this point in the history
9190bfe feat(list): add --buffer to list buffer diags (#4958)
fb030d4 fix(defaultAction) fallback to default action on emtpy expression (#4954)
846994b fix(inlayHint): more compact padding highlight group (#4950)
b01ae44 feat(semanticTokens)!: token highlight groups (#4667)
8c85d6f fix(markdown): incorrect list indentation alignment in markdown parser (#4884)
0d66554 fix(inlayHint): hl_mode = 'replace' for neovim (#4949)
1a8244e chore(package): update dependencies (#4948)
4f68722 feat(client): upgrade to marked 7 (#4947)
574c12c feat(package): @types/node@18 (#4946)
d299c66 feat(menu): C-j/k to navigate menu (#4945)
34d3d9d chore(deps): bump follow-redirects from 1.15.4 to 1.15.6 (#4944)
aead8f4 chore(CI): use Node 20 (#4940)
  • Loading branch information
fannheyward committed Mar 26, 2024
1 parent 0ba0b8b commit 183a604
Show file tree
Hide file tree
Showing 7 changed files with 227 additions and 222 deletions.
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a href="https://github.com/neoclide/coc.nvim/actions"><img alt="Actions" src="https://img.shields.io/github/actions/workflow/status/neoclide/coc.nvim/ci.yml?style=flat-square&branch=master"></a>
<a href="https://codecov.io/gh/neoclide/coc.nvim"><img alt="Codecov Coverage Status" src="https://img.shields.io/codecov/c/github/neoclide/coc.nvim.svg?style=flat-square"></a>
<a href="doc/coc.txt"><img alt="Doc" src="https://img.shields.io/badge/doc-%3Ah%20coc.txt-brightgreen.svg?style=flat-square"></a>
<a href="https://matrix.to/#/#coc.nvim:matrix.org"><img alt="Gitter" src="https://img.shields.io/gitter/room/neoclide/coc.nvim.svg?style=flat-square"></a>
<a href="https://matrix.to/#/#coc.nvim:matrix.org"><img alt="Matrix" src="https://img.shields.io/matrix/coc.nvim%3Amatrix.org?style=flat-square"></a>
</p>
</p>

Expand Down Expand Up @@ -471,8 +471,8 @@ Try these steps if you experience problems with coc.nvim:

- Have a question? Start a discussion on [GitHub Discussions](https://github.com/neoclide/coc.nvim/discussions).
- File a bug in [GitHub Issues](https://github.com/neoclide/coc.nvim/issues).
- Chat with us on [Gitter](https://matrix.to/#/#coc.nvim:matrix.org).
- 中文用户请到 [中文 gitter](https://matrix.to/#/#neoclide_coc-cn:gitter.im) 讨论
- Chat with us on [Matrix](https://matrix.to/#/#coc.nvim:matrix.org).
- 中文用户请到 [中文 Matrix](https://matrix.to/#/#neoclide_coc-cn:gitter.im) 讨论

## Backers

Expand Down
6 changes: 4 additions & 2 deletions autoload/coc/highlight.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let s:namespace_map = {}
let s:ns_id = 1
let s:diagnostic_hlgroups = ['CocErrorHighlight', 'CocWarningHighlight', 'CocInfoHighlight', 'CocHintHighlight', 'CocDeprecatedHighlight', 'CocUnusedHighlight']
" Maximum count to highlight each time.
let g:coc_highlight_maximum_count = get(g:, 'coc_highlight_maximum_count', 100)
let g:coc_highlight_maximum_count = get(g:, 'coc_highlight_maximum_count', 200)
let s:term = &termguicolors == 0 && !has('gui_running')

if has('nvim-0.5.0') && s:clear_match_by_window == 0
Expand Down Expand Up @@ -319,7 +319,9 @@ function! coc#highlight#add_highlight(bufnr, src_id, hl_group, line, col_start,
call nvim_buf_add_highlight(a:bufnr, a:src_id, a:hl_group, a:line, a:col_start, a:col_end)
endif
else
call coc#api#exec('buf_add_highlight', [a:bufnr, a:src_id, a:hl_group, a:line, a:col_start, a:col_end, opts])
if hlexists(a:hl_group)
call coc#api#exec('buf_add_highlight', [a:bufnr, a:src_id, a:hl_group, a:line, a:col_start, a:col_end, opts])
endif
endif
endfunction

Expand Down
2 changes: 1 addition & 1 deletion autoload/coc/list.vim
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function! coc#list#setlines(bufnr, lines, append)
endfunction

function! coc#list#options(...)
let list = ['--top', '--tab', '--normal', '--no-sort', '--input=', '--strict',
let list = ['--top', '--tab', '--buffer', '--normal', '--no-sort', '--input=', '--strict',
\ '--regex', '--interactive', '--number-select', '--auto-preview',
\ '--ignore-case', '--no-quit', '--first', '--reverse', '--height=']
if get(g:, 'coc_enabled', 0)
Expand Down
349 changes: 176 additions & 173 deletions build/index.js

Large diffs are not rendered by default.

23 changes: 8 additions & 15 deletions doc/coc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,7 @@ g:coc_highlight_maximum_count *g:coc_highlight_maximum_count*
When highlight items exceed maximum count, highlight items will be
grouped and added by using |timer_start| for better user experience.

Default `100`
Default `200`

g:coc_default_semantic_highlight_groups *g:coc_default_semantic_highlight_groups*

Expand Down Expand Up @@ -3356,27 +3356,20 @@ Semantic highlight groups are starts with `CocSem` which link to related
highlight groups, use variable |g:coc_default_semantic_highlight_groups| to
disable creation of these highlight groups.

The highlight groups rules:
>
`CocSemType + type` for types
`CocSemTypeMode + type + modifier` for modifier with type
<

Only semantic tokens types and `deprecated` modifier have default
highlight groups.

You need create highlight groups for highlight other modifiers and/or specific
modifier with type, for example:
>
" Add highlights for defaultLibrary modifier
hi link CocSemDefaultLibrary TSOtherDefaultLibrary
hi link CocSemDefaultLibraryClass TSTypeDefaultLibrary
hi link CocSemDefaultLibraryInterface TSTypeDefaultLibrary
hi link CocSemDefaultLibraryEnum TSTypeDefaultLibrary
hi link CocSemDefaultLibraryType TSTypeDefaultLibrary
hi link CocSemDefaultLibraryNamespace TSTypeDefaultLibrary
" Add highlights for declaration modifier
hi link CocSemDeclaration TSOtherDeclaration
hi link CocSemDeclarationClass TSTypeDeclaration
hi link CocSemDeclarationInterface TSTypeDeclaration
hi link CocSemDeclarationEnum TSTypeDeclaration
hi link CocSemDeclarationType TSTypeDeclaration
hi link CocSemDeclarationNamespace TSTypeDeclaration
hi link CocSemTypeModClassDeclaration ClassDeclaration
<
The modifier highlight groups have higher priority.

Expand Down
7 changes: 7 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 2024-02-28

- Increase `g:coc_highlight_maximum_count` default to 200
- Break change: semanticTokens highlight groups changed:
- `CocSem + type` to `CocSemType + type`
- `CocSem + modifier + type` to `CocSemTypeMod + type + modifier`

# 2024-03-06

- add `outline.autoHide` configuration to automatically hide the outline window when an item is clicked
Expand Down
56 changes: 28 additions & 28 deletions plugin/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -562,31 +562,31 @@ function! s:Highlight() abort

if get(g:, 'coc_default_semantic_highlight_groups', 1)
let hlMap = {
\ 'Namespace': ['@namespace', 'Include'],
\ 'Type': ['@type', 'Type'],
\ 'Class': ['@constructor', 'Special'],
\ 'Enum': ['@type', 'Type'],
\ 'Interface': ['@type', 'Type'],
\ 'Struct': ['@structure', 'Identifier'],
\ 'TypeParameter': ['@parameter', 'Identifier'],
\ 'Parameter': ['@parameter', 'Identifier'],
\ 'Variable': ['@variable', 'Identifier'],
\ 'Property': ['@property', 'Identifier'],
\ 'EnumMember': ['@property', 'Constant'],
\ 'Event': ['@keyword', 'Keyword'],
\ 'Function': ['@function', 'Function'],
\ 'Method': ['@method', 'Function'],
\ 'Macro': ['@constant.macro', 'Define'],
\ 'Keyword': ['@keyword', 'Keyword'],
\ 'Modifier': ['@storageclass', 'StorageClass'],
\ 'Comment': ['@comment', 'Comment'],
\ 'String': ['@string', 'String'],
\ 'Number': ['@number', 'Number'],
\ 'Boolean': ['@boolean', 'Boolean'],
\ 'Regexp': ['@string.regex', 'String'],
\ 'Operator': ['@operator', 'Operator'],
\ 'Decorator': ['@symbol', 'Identifier'],
\ 'Deprecated': ['@text.strike', 'CocDeprecatedHighlight']
\ 'TypeNamespace': ['@module', 'Include'],
\ 'TypeType': ['@type', 'Type'],
\ 'TypeClass': ['@constructor', 'Special'],
\ 'TypeEnum': ['@type', 'Type'],
\ 'TypeInterface': ['@type', 'Type'],
\ 'TypeStruct': ['@structure', 'Identifier'],
\ 'TypeTypeParameter': ['@variable.parameter', 'Identifier'],
\ 'TypeParameter': ['@variable.parameter', 'Identifier'],
\ 'TypeVariable': ['@variable', 'Identifier'],
\ 'TypeProperty': ['@property', 'Identifier'],
\ 'TypeEnumMember': ['@property', 'Constant'],
\ 'TypeEvent': ['@keyword', 'Keyword'],
\ 'TypeFunction': ['@function', 'Function'],
\ 'TypeMethod': ['@function.method', 'Function'],
\ 'TypeMacro': ['@constant.macro', 'Define'],
\ 'TypeKeyword': ['@keyword', 'Keyword'],
\ 'TypeModifier': ['@keyword.storage', 'StorageClass'],
\ 'TypeComment': ['@comment', 'Comment'],
\ 'TypeString': ['@string', 'String'],
\ 'TypeNumber': ['@number', 'Number'],
\ 'TypeBoolean': ['@boolean', 'Boolean'],
\ 'TypeRegexp': ['@string.regexp', 'String'],
\ 'TypeOperator': ['@operator', 'Operator'],
\ 'TypeDecorator': ['@string.special.symbol', 'Identifier'],
\ 'ModDeprecated': ['@markup.strikethrough', 'CocDeprecatedHighlight']
\ }
for [key, value] in items(hlMap)
let ts = get(value, 0, '')
Expand All @@ -596,7 +596,7 @@ function! s:Highlight() abort
endif
let symbolMap = {
\ 'Keyword': ['@keyword', 'Keyword'],
\ 'Namespace': ['@namespace', 'Include'],
\ 'Namespace': ['@module', 'Include'],
\ 'Class': ['@constructor', 'Special'],
\ 'Method': ['@method', 'Function'],
\ 'Property': ['@property', 'Identifier'],
Expand All @@ -610,7 +610,7 @@ function! s:Highlight() abort
\ 'File': ['@file', 'Statement'],
\ 'Module': ['@module', 'Statement'],
\ 'Package': ['@package', 'Statement'],
\ 'Field': ['@field', 'Identifier'],
\ 'Field': ['@variable.member', 'Identifier'],
\ 'Constructor': ['@constructor', 'Special'],
\ 'Enum': ['@type', 'CocSymbolDefault'],
\ 'Interface': ['@type', 'CocSymbolDefault'],
Expand All @@ -628,7 +628,7 @@ function! s:Highlight() abort
\ 'Struct': ['@structure', 'Keyword'],
\ 'Event': ['@constant', 'Constant'],
\ 'Operator': ['@operator', 'Operator'],
\ 'TypeParameter': ['@parameter', 'Identifier'],
\ 'TypeParameter': ['@variable.parameter', 'Identifier'],
\ }
for [key, value] in items(symbolMap)
let hlGroup = coc#highlight#valid(value[0]) ? value[0] : get(value, 1, 'CocSymbolDefault')
Expand Down

0 comments on commit 183a604

Please sign in to comment.