Skip to content

Commit

Permalink
chore(inlayHint): check nvim version
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed Aug 31, 2023
1 parent d81fde9 commit 0189ace
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
4 changes: 2 additions & 2 deletions doc/coc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,8 @@ Use |coc-config-signature| to change default signature help behavior.
------------------------------------------------------------------------------
INLAY HINT *coc-inlayHint*

Inlay hint is enabled for all filetypes by default. Inlay hint uses virtual
text which requires neovim >= 0.5.0 or vim >= 9.0.0067.
Inlay hint is enabled for all filetypes by default. Inlay hint uses virtual
text which requires neovim >= 0.10.0 or vim >= 9.0.0067.

Note: you may need configure extension or languageserver to make inlay hint
works.
Expand Down
9 changes: 9 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 2023-08-31

- Minimal node version changed from 14.14.0 to 16.18.0.
- Inlay hint support requires neovim >= 0.10.0.
- Removed configurations:
- `inlayHint.subSeparator`
- `inlayHint.typeSeparator`
- `inlayHint.parameterSeparator`

# 2023-01-30

- Always show `cancellable` progress as notification without check
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"ts",
"tsx",
"json",
"mjs",
"js"
],
"transform": {
Expand Down Expand Up @@ -91,7 +92,7 @@
"vscode-languageserver": "^8.1.0"
},
"dependencies": {
"@chemzqm/neovim": "^6.1.1",
"@chemzqm/neovim": "^6.1.2",
"ansi-styles": "^5.0.0",
"bytes": "^3.1.0",
"caniuse-lite": "^1.0.30001524",
Expand Down
5 changes: 1 addition & 4 deletions src/handler/inlayHint/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,9 @@ export default class InlayHintBuffer implements SyncItem {
}
if (isVim) {
buffer.setVirtualText(srcId, position.line, chunks, { col })
} else {
} else if (workspace.has('nvim-0.10.0')) {
buffer.setExtMark(srcId, position.line, col - 1, {
virt_text: chunks,
// TODO: needs @chemzqm/neovim to support virt_text_pos inline, disable the error alert for now
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
virt_text_pos: 'inline',
hl_mode: 'combine'
})
Expand Down
4 changes: 2 additions & 2 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2972,7 +2972,7 @@ declare module 'coc.nvim' {
* and [Position.character](#Position.character).
* If the start range position is greater than the end range position,
* then the effect of getText is as if the two positions were swapped.
* @return The text of this document or a substring of the text if a
* range is provided.
*/
Expand Down Expand Up @@ -3832,7 +3832,7 @@ declare module 'coc.nvim' {
hl_eol?: boolean
// A list of [text, highlight] tuples
virt_text?: [string, string | string[]][]
virt_text_pos?: 'eol' | 'overlay' | 'right_align'
virt_text_pos?: 'eol' | 'overlay' | 'right_align' | 'inline'
virt_text_win_col?: number
virt_text_hide?: boolean
virt_lines?: [string, string | string[]][][]
Expand Down
11 changes: 7 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@
ieee754 "^1.1.8"
int64-buffer "^0.1.9"

"@chemzqm/neovim@^6.1.1":
version "6.1.1"
resolved "https://registry.yarnpkg.com/@chemzqm/neovim/-/neovim-6.1.1.tgz#bd624e27844ee7e1b7dc39f3abb30a25bcde2479"
integrity sha512-FadmfnNrtSFv6fsjQEevYCBZG5gxeHmfM545SSqS7lXoHlNBWhqQgeAmzcQ8AQGn3jPeXriDISOAuPvEy8NIgg==
"@chemzqm/neovim@^6.1.2":
version "6.1.2"
resolved "https://registry.yarnpkg.com/@chemzqm/neovim/-/neovim-6.1.2.tgz#d4ae71d5bc6032aaabc5622522e5382ad305f7fe"
integrity sha512-gUQrGlz8cYOgywfj0S8Nht2WfTFQtLvun/erdCIhFdnK0eh1GhxcR2nM5xk1PcSXP3ewRK40gbRgJ3RFP6CSqQ==
dependencies:
"@chemzqm/msgpack-lite" "^0.1.29"

Expand Down Expand Up @@ -3368,6 +3368,7 @@ string-length@^4.0.1:
strip-ansi "^6.0.0"

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
name string-width-cjs
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand All @@ -3386,6 +3387,7 @@ string-width@^5.0.1, string-width@^5.1.2:
strip-ansi "^7.0.1"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
name strip-ansi-cjs
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -3632,6 +3634,7 @@ which@^2.0.1, which@^2.0.2:
isexe "^2.0.0"

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
name wrap-ansi-cjs
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down

0 comments on commit 0189ace

Please sign in to comment.