Skip to content

json: omni completion (schema values) doesn't work #797

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

Open
kmARC opened this issue Mar 18, 2025 · 0 comments
Open

json: omni completion (schema values) doesn't work #797

kmARC opened this issue Mar 18, 2025 · 0 comments

Comments

@kmARC
Copy link
Contributor

kmARC commented Mar 18, 2025

The following should work in a package.json file where | is the cursor, and triggering omni completion <i_Ctrl-X_Ctrl-O> would propose "author":

{
    "au|
}

Instead, "Pattern not found".

how to reproduce

Minimal vimrc:

set nocompatible

call plug#begin('~/.vim-debug/plugged')
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
call plug#end()

function! s:on_lsp_buffer_enabled() abort
  setlocal omnifunc=lsp#complete
endfunction

augroup lsp_install
  au!
  autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
augroup END

Example:

vim -u ~/.vim-debug/vimrc package.json
:LspStatus
vscode-json-language-server: running

I also tried with explicit schema, same problem:

{
    "$schema": "https://json.schemastore.org/package.json",
    "au|
}

remarks

  • Other languages (tried python) work perfectly with the same minimal vimrc.
  • :LspSettingsLocalEdit and :LspSettingsGlobalEdit are both empty.
  • vim-lsp-settings version: 4f8471d (Mon Jan 13 16:01:08 2025)
  • vim-lsp version: 04428c9 (Mon Sep 23 01:16:10 2024)
  • vim version:
    VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Mar 02 2025 21:28:22)
    Included patches: 1-1165
    Compiled by Arch Linux
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant