Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from neoclide:master #248

Merged
merged 3 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions autoload/coc/float.vim
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,6 @@ function! coc#float#has_scroll() abort
endfunction

function! coc#float#scroll(forward, ...)
if !has('nvim-0.4.0') && !has('patch-8.2.0750')
throw 'coc#float#scroll() requires nvim >= 0.4.0 or vim >= 8.2.0750'
endif
let amount = get(a:, 1, 0)
let winids = filter(coc#float#get_float_win_list(), 'coc#float#scrollable(v:val) && getwinvar(v:val,"kind","") !=# "pum"')
if empty(winids)
Expand Down
4 changes: 2 additions & 2 deletions data/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@
"diagnostic.virtualText": {
"type": "boolean",
"scope": "language-overridable",
"description": "Use virtual text to display diagnostics, requires neovim >= 0.5.0 or vim >= 9.0.0067.",
"description": "Use virtual text to display diagnostics.",
"default": false
},
"diagnostic.virtualTextAlign": {
Expand Down Expand Up @@ -2262,7 +2262,7 @@
"suggest.virtualText": {
"type": "boolean",
"scope": "application",
"description": "Show virtual text for insert word of selected item, requires neovim >= 0.5.0 or vim >= 9.0.0067",
"description": "Show virtual text for insert word of selected item",
"default": false
},
"tree.closedIcon": {
Expand Down
7 changes: 3 additions & 4 deletions doc/coc-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,7 @@ Diagnostic~

"diagnostic.virtualText" *coc-config-diagnostic-virtualText*

Use virtual text to display diagnostics, requires neovim >= 0.5.0 or
vim >= 9.0.0067.
Use virtual text to display diagnostics.

Scope: `language-overridable`, default: `false`

Expand Down Expand Up @@ -1386,8 +1385,8 @@ Suggest~

"suggest.virtualText" *coc-config-suggest-virtualText*

Show virtual text for insert word of selected item, requires
neovim >= 0.5.0 or vim >= 9.0.0067.
Show virtual text after cursor for insert word of current selected
complete item.

Scope: `application`, default: `false`

Expand Down
27 changes: 10 additions & 17 deletions doc/coc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,13 @@ automatic completion of coc.nvim by use `"suggest.autoTrigger": "none"` (or
==============================================================================
REQUIREMENTS *coc-requirements*

Neovim >= 0.4.0 or Vim >= 8.1.1719.
Neovim >= 0.8.0 or Vim >= 9.0.0483.

NodeJS https://nodejs.org/ >= 16.18.0.

For neovim user, use command |:checkhealth| to check issue with current
environment.

==============================================================================
INSTALLATION *coc-installation*

Expand Down Expand Up @@ -1002,8 +1005,6 @@ DOCUMENT COLORS *coc-document-colors*
Document colors added color highlights to vim buffers. To enable document
color highlights, use |coc-config-colors-enable|.

The feature requires vim >= 8.1.1719 or neovim >= 0.5.0.

Note: the highlights define gui colors only, make use you have 'termguicolors'
enabled (and your terminal support gui colors) if you're using vim in
terminal.
Expand Down Expand Up @@ -1304,8 +1305,6 @@ SEMANTIC HIGHLIGHTS *coc-semantic-highlights*
Semantic tokens are used to add additional color information to a buffer that
depends on language specific symbol information.

The feature requires vim >= 8.1.1719 or neovim >= 0.5.0.

Use |coc-config-semanticTokens-enable| to enable semantic tokens highlights.

Use `:CocCommand semanticTokens.checkCurrent` to check semantic highlight
Expand Down Expand Up @@ -2316,23 +2315,19 @@ coc#float#has_scroll() *coc#float#has_scroll()*

Example key-mappings:
>
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
<
coc#float#scroll({forward}, [{amount}]) *coc#float#scroll()*

Scroll all scrollable float windows/popups, scroll backward when
{forward} is not `1`. {amount} could be number or full page when
omitted. Popup menu is excluded.

Note: this function requires nvim >= 0.4.0 or vim >= 8.2.750 to work.


CocRequest({id}, {method}, [{params}]) *CocRequest()*

Expand Down Expand Up @@ -3939,8 +3934,6 @@ Note bottom buttons work different on neovim and vim, on neovim you can
click the button since neovim allows focus of window, on vim you have to type
highlighted character to trigger button callback.

Note dialog feature requires neovim >= 0.4.0 or vim >= 8.2.0750 to work.

See |coc-config-dialog| for available configurations.

--------------------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions src/__tests__/modules/extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('extensions', () => {
expect(extensions.onDidActiveExtension).toBeDefined()
expect(extensions.onDidUnloadExtension).toBeDefined()
expect(extensions.schemes).toBeDefined()
expect(extensions.creteInstaller('npm', 'id')).toBeDefined()
expect(extensions.createInstaller('npm', 'id')).toBeDefined()
})

it('should not throw with addSchemeProperty', async () => {
Expand Down Expand Up @@ -162,7 +162,7 @@ describe('extensions', () => {
})

it('should catch error when installExtensions', async () => {
let spy = jest.spyOn(extensions, 'creteInstaller').mockImplementation(() => {
let spy = jest.spyOn(extensions, 'createInstaller').mockImplementation(() => {
return {
on: (_key, cb) => {
cb('msg', false)
Expand All @@ -184,7 +184,7 @@ describe('extensions', () => {
let spy = jest.spyOn(extensions, 'globalExtensionStats').mockImplementation(() => {
return [{ id: 'test' }] as any
})
let s = jest.spyOn(extensions, 'creteInstaller').mockImplementation(() => {
let s = jest.spyOn(extensions, 'createInstaller').mockImplementation(() => {
return {
on: () => {},
update: () => {
Expand All @@ -201,7 +201,7 @@ describe('extensions', () => {
let spy = jest.spyOn(extensions, 'globalExtensionStats').mockImplementation(() => {
return [{ id: 'test' }, { id: 'global', isLocked: true }, { id: 'disabled', state: 'disabled' }] as any
})
let s = jest.spyOn(extensions, 'creteInstaller').mockImplementation(() => {
let s = jest.spyOn(extensions, 'createInstaller').mockImplementation(() => {
return {
on: (_key, cb) => {
cb('msg', false)
Expand All @@ -222,7 +222,7 @@ describe('extensions', () => {
return [{ id: 'test', exotic: true, uri: 'http://example.com' }] as any
})
let called = false
let s = jest.spyOn(extensions, 'creteInstaller').mockImplementation(() => {
let s = jest.spyOn(extensions, 'createInstaller').mockImplementation(() => {
return {
on: (_key, cb) => {
cb('msg', false)
Expand Down Expand Up @@ -262,7 +262,7 @@ describe('extensions', () => {
it('should install global extension', async () => {
expect(extensions.getExtensionById('coc-omni')).toBeUndefined()
let folder = path.join(extensions.modulesFolder, 'coc-omni')
let spy = jest.spyOn(extensions, 'creteInstaller').mockImplementation(() => {
let spy = jest.spyOn(extensions, 'createInstaller').mockImplementation(() => {
return {
on: () => {},
install: async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/diagnostic/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export class DiagnosticBuffer implements SyncItem {
*/
public async echoMessage(truncate = false, position: Position, target?: string): Promise<boolean> {
const config = this.config
if (!config.enable || config.enableMessage === 'never' || config.displayByAle || config.displayByVimDiagnostic) return false
if (!config.enable || config.enableMessage === 'never' || this.displayByAle || this.displayByVimDiagnostic) return false
if (!target) target = config.messageTarget
let useFloat = target == 'float'
let diagnostics = this.getDiagnosticsAtPosition(position)
Expand Down
6 changes: 3 additions & 3 deletions src/extension/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class Extensions {
return silent ? new InstallChannel(isUpdate, this.outputChannel) : new InstallBuffer(isUpdate)
}

public creteInstaller(npm: string, def: string): IInstaller {
public createInstaller(npm: string, def: string): IInstaller {
return new Installer(this.modulesFolder, npm, def)
}

Expand All @@ -188,7 +188,7 @@ export class Extensions {
let fn = async (key: string): Promise<void> => {
try {
installBuffer.startProgress(key)
let installer = this.creteInstaller(npm, key)
let installer = this.createInstaller(npm, key)
installer.on('message', (msg, isProgress) => {
installBuffer.addMessage(key, msg, isProgress)
})
Expand Down Expand Up @@ -231,7 +231,7 @@ export class Extensions {
try {
installBuffer.startProgress(id)
let url = stat.exotic ? stat.uri : null
let installer = this.creteInstaller(npm, id)
let installer = this.createInstaller(npm, id)
installer.on('message', (msg, isProgress) => {
installBuffer.addMessage(id, msg, isProgress)
})
Expand Down
2 changes: 1 addition & 1 deletion src/neovim/api/Buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class Buffer extends BaseApi {
}

/**
* Set virtual text for a line, works on nvim >= 0.5.0 and vim9
* Set virtual text for a line.
* @public
* @param {number} src_id - Source group to use or 0 to use a new group, or -1
* @param {number} line - Line to annotate with virtual text (zero-indexed)
Expand Down
16 changes: 8 additions & 8 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8269,7 +8269,7 @@ declare module 'coc.nvim' {
*/
readonly runtimepath: string
/**
* |virtualText| support in (neo)vim, needs nvim >= 0.5.0 or vim >= 9.0067
* |virtualText| support in (neo)vim
*/
readonly virtualText: boolean
/**
Expand Down Expand Up @@ -8329,15 +8329,15 @@ declare module 'coc.nvim' {
*/
readonly isiTerm: boolean
/**
* version of (neo)vim, on vim it's like: 8020750, on neoivm it's like: 0.5.0
* version of (neo)vim, on vim it's like: 8020750, on neoivm it's like
*/
readonly version: string
/**
* |v:progpath| value, could be empty.
*/
readonly progpath: string
/**
* Is true when dialog feature is supported, which need vim >= 8.2.750 or neovim >= 0.4.0
* Is true when dialog feature is supported
*/
readonly dialog: boolean
/**
Expand Down Expand Up @@ -9829,11 +9829,11 @@ declare module 'coc.nvim' {
cursorline?: boolean
modes?: string[]
excludeImages?: boolean
position?: "fixed" | "auto";
top?: number;
bottom?: number;
left?: number;
right?: number;
position?: "fixed" | "auto"
top?: number
bottom?: number
left?: number
right?: number
}

export interface FloatFactory {
Expand Down
Loading