newest release broke or changed something
Blade stopped being recognized as a file type all together, Intelephense LSP won't attach to PHP buffers, syntax highlighting for PHP also stopped working, and I get this error when I navigate to a blade file:
```
BufReadPost Autocommands for "*.blade.php"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[20]..script /home/h/.local/share/nvim-laravel/lazy/blade-nav.nvim/ftplugin/php/blade-nav.lua: Vim(runtime):E5113: Error while calling lua chunk: ...e/nvim-laravel/lazy/blade-nav.nvim/lua/blade-nav/cmp.lua:14: attempt to index local 'opts' (a nil value)
stack traceback:
...e/nvim-laravel/lazy/blade-nav.nvim/lua/blade-nav/cmp.lua:14: in function 'setup'
.../nvim-laravel/lazy/blade-nav.nvim/lua/blade-nav/init.lua:5: in function 'setup'
...m-laravel/lazy/blade-nav.nvim/ftplugin/php/blade-nav.lua:2: in main chunk
[C]: in function '__newindex'
/home/h/.config/nvim-laravel/lua/options.lua:79: in function </home/h/.config/nvim-laravel/lua/options.lua:78>
[C]: at 0x5e2fa72d9fc8
[C]: in function 'pcall'
....local/share/nvim-laravel/lazy/oil.nvim/lua/oil/init.lua:722: in function 'callback'
...re/nvim-laravel/lazy/oil.nvim/lua/oil/adapters/files.lua:260: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
```
And this error when I navigate to a php file:
```
14:43:43 msg_show.echomsg BufReadPost Autocommands for "*": Vim(append):Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[20]..script /home/h/.local/share/nvim-laravel/lazy/blade-nav.nvim/ftplugin/php/blade-nav.lua: Vim(runtime):E5113: Error while calling lua chunk: ...e/nvim-laravel/lazy/blade-nav.nvim/lua/blade-nav/cmp.lua:14: attempt to index local 'opts' (a nil value)
stack traceback:
...e/nvim-laravel/lazy/blade-nav.nvim/lua/blade-nav/cmp.lua:14: in function 'setup'
.../nvim-laravel/lazy/blade-nav.nvim/lua/blade-nav/init.lua:5: in function 'setup'
...m-laravel/lazy/blade-nav.nvim/ftplugin/php/blade-nav.lua:2: in main chunk
[C]: in function 'nvim_cmd'
/usr/share/nvim/runtime/filetype.lua:36: in function </usr/share/nvim/runtime/filetype.lua:35>
[C]: in function 'pcall'
vim/shared.lua: in function <vim/shared.lua:0>
[C]: in function '_with'
/usr/share/nvim/runtime/filetype.lua:35: in function </usr/share/nvim/runtime/filetype.lua:10>
[C]: at 0x5f0f8ab8ffc8
[C]: in function 'pcall'
....local/share/nvim-laravel/lazy/oil.nvim/lua/oil/init.lua:722: in function 'callback'
...re/nvim-laravel/lazy/oil.nvim/lua/oil/adapters/files.lua:260: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
stack traceback:
[C]: in function '_with'
/usr/share/nvim/runtime/filetype.lua:35: in function </usr/share/nvim/runtime/filetype.lua:10>
[C]: at 0x5f0f8ab8ffc8
[C]: in function 'pcall'
....local/share/nvim-laravel/lazy/oil.nvim/lua/oil/init.lua:722: in function 'callback'
...re/nvim-laravel/lazy/oil.nvim/lua/oil/adapters/files.lua:260: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
```
When I reverted to the older release everything went back to normal. Is there a change i need to do on my side to fix this, I am pretty novice when it comes to configuring or troubleshooting in Neovim.
I have this set up for blade files:
```lua
-- Create an augroup for the LSP workaround
local augroup = vim.api.nvim_create_augroup('lsp_blade_workaround', { clear = true })
-- Autocommand to temporarily change 'blade' filetype to 'php' when opening for LSP server activation
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
group = augroup,
pattern = '*.blade.php',
callback = function()
vim.bo.filetype = 'php'
end,
})
-- Additional autocommand to switch back to 'blade' after LSP has attached
vim.api.nvim_create_autocmd('LspAttach', {
pattern = '*.blade.php',
callback = function(args)
vim.schedule(function()
-- Check if the attached client is 'intelephense'
for _, client in ipairs(vim.lsp.get_clients()) do
if client.name == 'intelephense' and client.attached_buffers[args.buf] then
vim.bo[args.buf].filetype = 'blade'
-- update treesitter parser to blade
vim.bo[args.buf].syntax = 'blade'
break
end
end
end)
end,
})
```
Could this be the cause of it?
关闭于 2024-09-19 2 条评论