-
Notifications
You must be signed in to change notification settings - Fork 114
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
Memory leak+freezing with lsp intelephense or phpactor #286
Comments
Please provide a minimal init lua. See the wiki |
Ok, seems to be relative with the combo noice + tree-sitter + lsp intelephense/phpactor. Here is the minimal init lua : local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
{
"folke/noice.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
}, config = function()
require('noice').setup({
lsp = {
signature = { enabled = true }
},
});
end
},
{ 'neovim/nvim-lspconfig', config = function()
require('lspconfig').intelephense.setup {}
end },
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
build = function()
pcall(require('nvim-treesitter.install').update { with_sync = true })
end, config = function()
require('nvim-treesitter.configs').setup {
ensure_installed = { 'php' },
}
end
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.opt.termguicolors = true
vim.cmd([[colorscheme tokyonight]])
require("noice").setup() |
I'm not able to reproduce this. I also had to change some of your repro code. Can you give me an example php file that shows this behavior and that can be reproduced with the code below? updated init.lualocal root = vim.fn.fnamemodify("./.repro", ":p") |
Ok, after investigation, I didn't cleanup my .repro between my attempts. Your init.lua doesn't crash for me. I noticed that the treesitter-parser 'html' has to be installed too (no idea why) to cause the crash. Here is an updated version of your init.lua : local root = vim.fn.fnamemodify("./.repro", ":p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG%s_HOME"):format(name:upper())] = root .. "/" .. name
end
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
local plugins = {
"folke/tokyonight.nvim",
{
"folke/noice.nvim",
-- dir = "~/projects/noice.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
config = function()
require("noice").setup({
lsp = {
signature = { enabled = true },
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
})
end,
},
{
"neovim/nvim-lspconfig",
config = function()
require("lspconfig").intelephense.setup({})
end,
dependencies = {
{ "williamboman/mason.nvim", config = true },
{ "williamboman/mason-lspconfig.nvim", config = true },
},
},
{
"nvim-treesitter/nvim-treesitter",
build = function()
pcall(require("nvim-treesitter.install").update({ with_sync = true }))
end,
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = { "php", "html" },
})
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.keymap.set("n", "K", vim.lsp.buf.hover)
vim.opt.termguicolors = true
vim.cmd([[colorscheme tokyonight]])
require("noice").setup() Note that the Here is a simple php example project that trigger the crash : https://github.com/Catvert/noice-crash-php |
Thanks. I can reproduce it now! |
This is triggered somewhere inside Neovim's treesitter code. I couldn't fix the root cause yet, but I disabled any injections when formatting code with treesitter for Noice. That at least will fix the issue for now, but some injected languages would not be shown right now |
Describe the bug
Hello, when I use your plugin with the lsp intelephense or phpactor, noice trigger a memory leak in some specific situations.
For example, the memory leak (quickly consumes all my ram, in about 10 seconds + nvim freeze) is triggered with
lsp.signature.enabled = true
or doc hover with the following settings :This seems to be relative to your plugin for all things that affects the lsp.
If you need more information, don't hesitate to ask me. Thanks to you!
Which version of Neovim are you using?
nvim stable + nightly(28/12/22)
To Reproduce
Steps to reproduce the behavior:
Screenshots
Example, entering the insert mode inside a function (resulting in a crash) :
Noice Log
impossible to get because nvim crashes directly.
The text was updated successfully, but these errors were encountered: