Skip to content

Instantly share code, notes, and snippets.

@erickpatrick
Last active January 10, 2023 18:42
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save erickpatrick/bc11a2a08ce388d751af5718b839ccd1 to your computer and use it in GitHub Desktop.
Save erickpatrick/bc11a2a08ce388d751af5718b839ccd1 to your computer and use it in GitHub Desktop.
Neovim CoC Intelephense configuration
" TODO: split up config into multiple files
" source $HOME/.config/nvim/vim-plug/plugins.vim
" source $HOME/.config/nvim/<category>/<sub-category-filename>.vim
" source $HOME/.config/nvim/<plug-config>/<plugin-name>.vim
set nocompatible
filetype off
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
" General plugins
Plug 'dracula/vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" better search using fuzzy finding FZF
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug '/usr/local/opt/fzf'
" makes vim autocomplete (), [], {}, '', "", etc
Plug 'jiangmiao/auto-pairs'
" see the git status of the current line in
" the gutter
Plug 'airblade/vim-gitgutter'
" better way to comment lines inside vim
Plug 'preservim/nerdcommenter'
" file tree navigator
Plug 'scrooloose/nerdtree'
" matches pairs of things (if-else, tags, etc)
Plug 'andymass/vim-matchup'
" necessary to follow styles of a project
Plug 'editorconfig/editorconfig-vim'
" previews markdown using local server
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' }
" interesting file navigator in modal window
Plug 'liuchengxu/vim-clap'
" nice way to dispatch work in the background
Plug 'tpope/vim-dispatch'
" PHP specific plugins
Plug 'StanAngeloff/php.vim', { 'for': 'php' }
Plug 'stephpy/vim-php-cs-fixer', { 'for': 'php' }
Plug 'jwalton512/vim-blade'
Plug 'phpactor/phpactor', {'for': 'php', 'do': 'composer install --no-dev -o'}
call plug#end()
filetype plugin indent on
" FZF modal window layout and extra info
" uses <CTRL>+P to fuzzy search in normal mode
nmap <silent> <C-P> :Files<CR>
" <CTRL>+E opens NERDTree file explorer on the right
" after Caleb Porzio VSCode newsletter tip, file tree navigator only on the
" right as it does not make my current code jump when we open it =)
nmap <silent> <C-E> :NERDTreeToggle<CR>
let g:NERDTreeWinPos = "right"
" FZF window will take almost full screen
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.9 } }
" changes file preview window to take 60% of the FZF window, will place
" search bar on top with a bit of margin, will also color the preview
" using the Bat CLI app (it's an alternative to Cat(0) which uses
" syntax highlighting and allows using themes, like Dracula, from
" the Brazilian developer, @Zenorocha. To use one of the themes,
" it's advised to set the env var BAT_THEME into your profile
" file - i.e, ~/.zshrc - to the name of theme you want to use
" and Bat allows to use)
let $FZF_DEFAULT_OPTS="--ansi --preview-window 'right:60%' --layout reverse --margin=1,4 --preview 'bat --color=always --style=header,grid --line-range :300 {}'"
" sets FZF to us RG (ripgrep) and to ignore some folders when searching
let $FZF_DEFAULT_COMMAND = 'rg --files --ignore-case --hidden -g "!{.git,node_modules,vendor}/*"'
set rtp+=/usr/local/opt/fzf
command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
" Clap configuration
" Allows to search through various places (Buffers, history, git changes,
" etc). It also respects current theme when searching. This configuration
" makes it go to the top of the buffer, take 70% of the current width and
" be centralized
let g:clap_layout = { 'width': '70%', 'col': '15%', 'row': '10%', 'relative': 'editor' }
" sets php.vim version adherense
let g:php_version_id = 70405
" does not load highlighting for HTML inside of PHP
let g:php_html_load = 0
" basic mapping to avoid the problem with fast fingers =P
:command! WQ wq
:command! Wq wq
:command! W w
:command! Q q
" if you did not open the file with the correct permissions (sudo perhaps),
" you can issue this command and it will force save the file as like it
" was opened with sudo
cmap w!! w !sudo tee > /dev/null %
" Make Arrowkey do something usefull, resize the viewports accordingly and
" it also forces us to use the default Vim movement keys HJKL
nnoremap <Left> :vertical resize -5<CR>
nnoremap <Right> :vertical resize +5<CR>
nnoremap <Up> :resize -5<CR>
nnoremap <Down> :resize +5<CR>
"basic configuration
set updatetime=250
set background=dark
set tabstop=4
set shiftwidth=4
set softtabstop=0
set smarttab
set expandtab
set wildmenu
set wildmode=list:longest,full
set ttyfast
set showmatch
set hlsearch
set incsearch
set number relativenumber
set matchtime=1
set laststatus=2
set t_Co=256
set backspace=indent,eol,start
set visualbell
set noerrorbells
set splitbelow
set splitright
set noshowmode
" no more *.swap files
set nobackup
set nowritebackup
" ensure we always use this encoding for every
" file
set encoding=UTF-8
set fileencoding=UTF-8
" always keep signcolumn shown
set signcolumn=yes
set shell=/usr/local/bin/zsh
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,var
set hidden
set shortmess+=c
set guifont=JetBrains_Mono:h16
" proper true colors for terminal
if (has("nvim"))
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
set termguicolors
set grepprg='rg'
syntax on
color dracula
let mapleader=","
" removes highlighting of search terms
nnoremap <leader><space> :nohlsearch<CR>
" When in normal mode, press `bb` and it will call vim-clap to show current
" open buffers which we can switch to. The <CTRL>+V & <CTRL>+H shortcuts to
" vertical/horizontal split file opening also work.
nmap <silent> bb :Clap buffers<CR>
if executable('intelephense')
augroup LspPHPIntelephense
au!
au User lsp_setup call lsp#register_server({
\ 'name': 'intelephense',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'intelephense --stdio']},
\ 'whitelist': ['php'],
\ 'initialization_options': {'storagePath': '/tmp/intelephense'},
\ 'workspace_config': {
\ 'intelephense': {
\ 'files': {
\ 'maxSize': 1000000,
\ 'associations': ['*.php', '*.phtml'],
\ 'exclude': [],
\ },
\ 'completion': {
\ 'insertUseDeclaration': v:true,
\ 'fullyQualifyGlobalConstantsAndFunctions': v:false,
\ 'triggerParameterHints': v:true,
\ 'maxItems': 100,
\ },
\ 'format': {
\ 'enable': v:true
\ },
\ },
\ }
\})
augroup END
endif
" Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current
" position. Coc only does snippet and additional edit on confirm.
" <cr> could be remapped by other vim plugin, try `:verbose imap <CR>`.
if exists('*complete_info')
inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
else
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
endif
" Use `[g` and `]g` to navigate diagnostics
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
nnoremap <silent> gb <C-O><CR>
" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code.
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder.
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap keys for applying codeAction to the current line.
nmap <leader>ac <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" Introduce function text object
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap if <Plug>(coc-funcobj-i)
omap af <Plug>(coc-funcobj-a)
" Use <TAB> for selections ranges.
" NOTE: Requires 'textDocument/selectionRange' support from the language server.
" coc-tsserver, coc-python are the examples of servers that support it.
nmap <silent> <TAB> <Plug>(coc-range-select)
xmap <silent> <TAB> <Plug>(coc-range-select)
" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocAction('format')
" Add `:Fold` command to fold current buffer.
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" Add `:OR` command for organize imports of the current buffer.
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
" Add (Neo)Vim's native statusline support.
" NOTE: Please see `:h coc-status` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline.
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Mappings using CoCList:
" Show all diagnostics.
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
" Manage extensions.
nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
" Show commands.
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
" Find symbol of current document.
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols.
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent> <space>j :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
""" FZF mappings
" Mapping selecting mappings
nmap <leader><tab> <plug>(fzf-maps-n)
xmap <leader><tab> <plug>(fzf-maps-x)
omap <leader><tab> <plug>(fzf-maps-o)
" Insert mode completion
imap <c-x><c-k> <plug>(fzf-complete-word)
imap <c-x><c-f> <plug>(fzf-complete-path)
imap <c-x><c-j> <plug>(fzf-complete-file-ag)
imap <c-x><c-l> <plug>(fzf-complete-line)
" Advanced customization using Vim function
inoremap <expr> <c-x><c-k> fzf#vim#complete#word({'right': '25%'})
" use control+hjkl to move between split/vsplit panels
nnoremap <C-j> <C-W><C-J>
nnoremap <C-k> <C-W><C-K>
nnoremap <C-l> <C-W><C-L>
nnoremap <C-h> <C-W><C-H>
" Enable spell check on git commit messages
autocmd BufNewFile,BufRead COMMIT_EDITMSG set spell
" Highlight Markdown files
autocmd BufRead,BufNewFile *.md,*.txt set filetype=markdown
autocmd BufRead,BufNewFile *.php set tabstop=4 shiftwidth=4 tabstop=4
autocmd BufRead,BufNewFile *.blade.php set filetype=blade.html
autocmd BufRead,BufNewFile *.js set tabstop=2 shiftwidth=2 tabstop=2
" Format the entire file
nnoremap <leader>fef :normal! gg=G``<CR>

The following instructions are the basic steps I had when I installed CoC.vim and Intelephense to have a VSCode or PHPStorm like environment inside my Neovim.

What we need first is to install a Neovim package manager. My suggestion is vim-plug. After installing it, install the CoC.vim package so we can have our autocompletion and code navigation functions in place.

After installing CoC.vim, run the following command inside Neovim:

:CocInstall coc-phpls

This will install the language server (yes, the same used by VSCode) for the PHP Language. It is required to allow Intelephense to work properly.

After that we need to install Intelephense itself. Much like any Language Server for VSCode, it is a NPM package. So, if you still don't have Node, please install the latest one (LTS or Head) before proceeding. Once you have Node in place, run the following command in the terminal of your choice.

npm -g i intelephense

Note: This command will install Intelephense globally.

After the installation completes, it's necessary to add the Intelephense License Key to be able to use all of its features. To do so, we run the following command inside of Neovim to open Coc.vimconfig file:

:CocConfig

Once open, place the following content and substitute the placeholde <your-key-here> for your actual Intelephense License Key:

{
    "intelephense.licenseKey": "<your-key-here>",
}

Open the Neovim configuration ~/.config/nvim/init.vim and paste the following code anywhere after call plug#end():

if executable('intelephense')
  augroup LspPHPIntelephense
    au!
    au User lsp_setup call lsp#register_server({
        \ 'name': 'intelephense',
        \ 'cmd': {server_info->[&shell, &shellcmdflag, 'intelephense --stdio']},
        \ 'whitelist': ['php'],
        \ 'initialization_options': {'storagePath': '/tmp/intelephense'},
        \ 'workspace_config': {
        \   'intelephense': {
        \     'files': {
        \       'maxSize': 1000000,
        \       'associations': ['*.php', '*.phtml'],
        \       'exclude': [],
        \     },
        \     'completion': {
        \       'insertUseDeclaration': v:true,
        \       'fullyQualifyGlobalConstantsAndFunctions': v:false,
        \       'triggerParameterHints': v:true,
        \       'maxItems': 100,
        \     },
        \     'format': {
        \       'enable': v:true
        \     },
        \   },
        \ }
        \})
  augroup END
endif

" Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
      \ pumvisible() ? "\<C-n>" :
      \ <SID>check_back_space() ? "\<TAB>" :
      \ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"

function! s:check_back_space() abort
  let col = col('.') - 1
  return !col || getline('.')[col - 1]  =~# '\s'
endfunction

" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()

" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current
" position. Coc only does snippet and additional edit on confirm.
" <cr> could be remapped by other vim plugin, try `:verbose imap <CR>`.
if exists('*complete_info')
  inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
else
  inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
endif

" Use `[g` and `]g` to navigate diagnostics
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)

" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)

" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>

function! s:show_documentation()
  if (index(['vim','help'], &filetype) >= 0)
    execute 'h '.expand('<cword>')
  else
    call CocAction('doHover')
  endif
endfunction

" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')

" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)

" Formatting selected code.
xmap <leader>f  <Plug>(coc-format-selected)
nmap <leader>f  <Plug>(coc-format-selected)

augroup mygroup
  autocmd!
  " Setup formatexpr specified filetype(s).
  autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
  " Update signature help on jump placeholder.
  autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end

" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a  <Plug>(coc-codeaction-selected)
nmap <leader>a  <Plug>(coc-codeaction-selected)

" Remap keys for applying codeAction to the current line.
nmap <leader>ac  <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf  <Plug>(coc-fix-current)

" Introduce function text object
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap if <Plug>(coc-funcobj-i)
omap af <Plug>(coc-funcobj-a)

" Use <TAB> for selections ranges.
" NOTE: Requires 'textDocument/selectionRange' support from the language server.
" coc-tsserver, coc-python are the examples of servers that support it.
nmap <silent> <TAB> <Plug>(coc-range-select)
xmap <silent> <TAB> <Plug>(coc-range-select)

" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocAction('format')

" Add `:Fold` command to fold current buffer.
command! -nargs=? Fold :call     CocAction('fold', <f-args>)

" Add `:OR` command for organize imports of the current buffer.
command! -nargs=0 OR   :call     CocAction('runCommand', 'editor.action.organizeImport')

" Add (Neo)Vim's native statusline support.
" NOTE: Please see `:h coc-status` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline.
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}

" Mappings using CoCList:
" Show all diagnostics.
nnoremap <silent> <space>a  :<C-u>CocList diagnostics<cr>
" Manage extensions.
nnoremap <silent> <space>e  :<C-u>CocList extensions<cr>
" Show commands.
nnoremap <silent> <space>c  :<C-u>CocList commands<cr>
" Find symbol of current document.
nnoremap <silent> <space>o  :<C-u>CocList outline<cr>
" Search workspace symbols.
nnoremap <silent> <space>s  :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent> <space>j  :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent> <space>k  :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent> <space>p  :<C-u>CocListResume<CR>

Reload the source file on your Neovim by running the following command inside Neovim while the configuration file is open:

:source %

This will use the currently opened and selected file (it should be the configuration one) and use it to configure Neovim.

Restart your Neovim and open any PHP file. In the statusline you should be able to see a message like indexing php files. It may take some time, depending on the size of your project.

Once it's done, you will be able to use the shortcuts and code autocompletion just like in VSCode or PHPStorm. With the power of Intelephense, we basically the same powers as PHPStorm with the extra power the Neovim provides us. A win-win situation!

@myself379
Copy link

Hi, thank you for this guide, it helps me greatly and understand better for coc.nvim

However, I need help, why is it my settings in init.vim being ignore for coc.nvim phpls?

For example, I used your example and paste into my init.vim, then I purposely disable insertUseDeclaration to v:false just to see if it works

'insertUseDeclaration': v:false

However, coc-phpls still runs normally, and whenever I write a new class, it'll auto import.

The reason why I'm doing this is because I wanted to add '*.blade.php' into files.associates, but it seems not working

{
'.blade.php': 'php',
'
.php': 'php',
'*.phtml': 'php'
}

I know that the &filetype of .blade.php is html, but it still doesn't make .blade.php as php

@myself379
Copy link

Ah, after some digging, I realized that lsp#register_server is meant for vim-lsp, not coc.nvim

my hunch telling me that somehow the autocomplete triggers coc.nvim, hence that might explains why its ignoring the settings in lsp#register_server

@erickpatrick
Copy link
Author

Hi @myself379,

So, the data you're setting on this node, correct?

       \ 'workspace_config': {
        \   'intelephense': {
        \     'files': {
        \       'maxSize': 1000000,
        \       'associations': ['*.php', '*.phtml'],
        \       'exclude': [],
        \     },
        \     'completion': {
        \       'insertUseDeclaration': v:true,
        \       'fullyQualifyGlobalConstantsAndFunctions': v:false,
        \       'triggerParameterHints': v:true,
        \       'maxItems': 100,
        \     },
        \     'format': {
        \       'enable': v:true
        \     },
        \   },
        \ }

And you're saying that you're setting 'insertUseDeclaration': v:false, but it still keeps adding inserting the use declarations. Is that also correct? For this one You may need to check if you have other plugins (like https://github.com/arnaud-lb/vim-php-namespace) that are enabled as well and inserting the use declarations.

You also want to add *.blade.php to 'associations': ['*.php', '*.phtml'],, correct? In this case, it would only check for PHP related errors and autocomplete (through the Inteliphense). If you need to make *.blade.php files be treated as *.php files, you would need to change the following line:

autocmd BufRead,BufNewFile *.blade.php set filetype=blade.html

See that we're setting filetype=blade.html. You want to change this to filetype=php. As I recall, it would work properly if you want *.blade.php files to be treated as *.php files.

If you still have questions, please let me know and I'll try to help you somehow when I have more time.

@myself379
Copy link

Hi @erickpatrick

Thanks for your reply. Yes, I followed your init.vim. I think I solved my issues. I realized my coc.nvim didn't read lsp#register_server, and instead it loads the config from coc-phpls extension, which will be double loaded if you set via CocConfig coc-settings.json too; i.e.: you'll see your [LS] being returned to you twice

So I uninstalled the coc-phpls extensions, then I map and played around from your lsp#register_server settings into coc-settings.json

This is my coc-settings.json, I only have PHP language server and I didn't install vim-lsp Plug, I only use coc.nvim Plug with coc-phpls extensions removed.

{
  "coc.source.ultisnips.filetypes": ["tex"],
  "languageserver": {
    "intelephense": {
      "enable": true,
      "command": "intelephense",
      "args": ["--stdio"],
      "filetypes": ["php"],
      "initializationOptions": {
        "storagePath": "/tmp/intelephense"
      },
      "settings": {
        "intelephense": {
          "files": {
            "maxSize": 1000000,
            "associations": ["*.php", "*.phtml"]
          },
          "completion": {
            "insertUseDeclaration": true,
            "fullyQualifyGlobalConstantsAndFunctions": false,
            "triggerParameterHints": true,
            "maxItems": 15
          },
          "format": {
            "enable": true
          }
        }
      }
    }
  }
}

Afterwards I toyed around with "insertUseDeclaration" to be false, and indeed Intelephense will not auto-import use and will expend on your input and "maxItems" will return the max number of suggestions from Intelephense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment