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

bug: Neo-tree errors #1676

Closed
3 tasks done
neuromaancer opened this issue Oct 12, 2023 · 9 comments
Closed
3 tasks done

bug: Neo-tree errors #1676

neuromaancer opened this issue Oct 12, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@neuromaancer
Copy link
Contributor

neuromaancer commented Oct 12, 2023

Did you check docs and existing issues?

  • I have read all the LazyVim docs
  • I have searched the existing issues of LazyVim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.9.4

Operating system/version

MacOS 14.0

Describe the bug

   Warn  15:17:39 notify.warn [lspconfig] Cannot access configuration for lua_ls. Ensure this server is listed in `server_configurations.md` or added as a custom server.
   Error  15:17:39 msg_show.lua_error Error detected while processing FileType Autocommands for "*"..function <SNR>43_filetype_changed:
15:17:39 msg_show line    4:
15:17:39 msg_show E492: Not an editor command:             Semshi enable
   Error  15:17:48 notify.error [Neo-tree ERROR] Error opening file: vim/_editor.lua:0: nvim_exec2()..BufReadPost Autocommands for "*": Vim(append):Error executing lua callback: ...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: Error executing lua: ...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:25: nvim_exec2()..BufReadPost Autocommands for "*"..FileType Autocommands for "python"..FileType Autocommands for "*"..function <SNR>43_filetype_changed, line 4: Vim:E492: Not an editor command:             Semshi enable
stack traceback:
	[C]: in function 'nvim_cmd'
	...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:25: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24>
	[C]: in function 'nvim_buf_call'
	...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:10>
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function <vim/_editor.lua:0>
	[C]: in function 'pcall'
	...hare/nvim/lazy/neo-tree.nvim/lua/neo-tree/utils/init.lua:697: in function 'open_file'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:687: in function 'open'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:718: in function 'open_with_cmd'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:727: in function 'open'
	...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:184: in function 'func'
	...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:843: in function <...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:841>
stack traceback:
	[C]: in function 'nvim_buf_call'
	...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:10>
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function <vim/_editor.lua:0>
	[C]: in function 'pcall'
	...hare/nvim/lazy/neo-tree.nvim/lua/neo-tree/utils/init.lua:697: in function 'open_file'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:687: in function 'open'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:718: in function 'open_with_cmd'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:727: in function 'open'
	...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:184: in function 'func'
	...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:843: in function <...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:841>
   Error  15:18:02 notify.error [Neo-tree ERROR] Error opening file: vim/_editor.lua:0: nvim_exec2()..BufReadPost Autocommands for "*": Vim(append):Error executing lua callback: ...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: Error executing lua: ...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:25: nvim_exec2()..BufReadPost Autocommands for "*"..FileType Autocommands for "*"..function <SNR>43_filetype_changed, line 4: Vim:E492: Not an editor command:             Semshi enable
stack traceback:
	[C]: in function 'nvim_cmd'
	...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:25: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24>
	[C]: in function 'nvim_buf_call'
	...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:10>
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function <vim/_editor.lua:0>
	[C]: in function 'pcall'
	...hare/nvim/lazy/neo-tree.nvim/lua/neo-tree/utils/init.lua:697: in function 'open_file'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:687: in function 'open'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:718: in function 'open_with_cmd'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:727: in function 'open'
	...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:184: in function 'func'
	...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:843: in function <...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:841>
stack traceback:
	[C]: in function 'nvim_buf_call'
	...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:10>
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function <vim/_editor.lua:0>
	[C]: in function 'pcall'
	...hare/nvim/lazy/neo-tree.nvim/lua/neo-tree/utils/init.lua:697: in function 'open_file'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:687: in function 'open'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:718: in function 'open_with_cmd'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:727: in function 'open'
	...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:184: in function 'func'
	...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:843: in function <...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:841>
   Error  15:18:36 notify.error [Neo-tree ERROR] Error opening file: vim/_editor.lua:0: nvim_exec2()..BufReadPost Autocommands for "*": Vim(append):Error executing lua callback: ...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: Error executing lua: ...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:25: nvim_exec2()..BufReadPost Autocommands for "*"..FileType Autocommands for "*"..function <SNR>43_filetype_changed, line 4: Vim:E492: Not an editor command:             Semshi enable
stack traceback:
	[C]: in function 'nvim_cmd'
	...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:25: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24>
	[C]: in function 'nvim_buf_call'
	...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:10>
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function <vim/_editor.lua:0>
	[C]: in function 'pcall'
	...hare/nvim/lazy/neo-tree.nvim/lua/neo-tree/utils/init.lua:697: in function 'open_file'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:687: in function 'open'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:718: in function 'open_with_cmd'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:727: in function 'open'
	...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:184: in function 'func'
	...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:843: in function <...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:841>
stack traceback:
	[C]: in function 'nvim_buf_call'
	...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:10>
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function <vim/_editor.lua:0>
	[C]: in function 'pcall'
	...hare/nvim/lazy/neo-tree.nvim/lua/neo-tree/utils/init.lua:697: in function 'open_file'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:687: in function 'open'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:718: in function 'open_with_cmd'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:727: in function 'open'
	...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:184: in function 'func'
	...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:843: in function <...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:841>

Steps To Reproduce

  1. install lang.python, lang.python-semshi extra packages.
  2. sshfs to mount a remote folder containing python project.
  3. run the nvim
  4. open Neo-tree.

Expected Behavior

Neo-tree can be open normally.

Repro

-- DO NOT change the paths and don't remove the colorscheme
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", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/LazyVim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
@neuromaancer neuromaancer added the bug Something isn't working label Oct 12, 2023
@neithanmo
Copy link

same here

@WillEhrendreich
Copy link

ok, I'm not sure what a semshi is, lol, I'm not python guy. nor am I familiar with mac, so you know, take this with a grain of salt.

it sounds like a path issue to me. when you're simply in your terminal, and you type "semshi" does it error out for you?

if that works, I'm thinking it's not found in the Runtimepath .

if you go into neovim and run :set , do any of the paths include this semshi thing?

another thought is that it says "not an editor command" so it seems almost like it's trying to find some sort of usercommand called semshi, which I take it will mean that doesn't exist.

I don't know what semshi does or doesn't do, but you could make a usercommand like this:
if you search help for nvim_create_user_command you get this:

-- Creating user commands lua-guide-commands-create

-- User commands can be created through with |nvim_create_user_command()|. This
-- function takes three mandatory arguments:
-- • a string that is the name of the command (which must start with an uppercase
-- letter to distinguish it from builtin commands);
-- • a string containing Vim commands or a Lua function that is executed when the
-- command is invoked;
-- • a table with |command-attributes|; in addition, it can contain the keys
-- desc (a string describing the command); force (set to false to avoid
-- replacing an already existing command with the same name), and preview (a
-- Lua function that is used for |:command-preview|).

-- Example:
-- >lua
-- vim.api.nvim_create_user_command('Test', 'echo "It works!"', {})
-- vim.cmd.Test()
-- --> It works!
-- <
-- (Note that the third argument is mandatory even if no attributes are given.)

-- Lua functions are called with a single table argument containing arguments and
-- modifiers. The most important are:
-- • name: a string with the command name
-- • fargs: a table containing the command arguments split by whitespace (see ||)
-- • bang: true if the command was executed with a ! modifier (see ||)
-- • line1: the starting line number of the command range (see ||)
-- • line2: the final line number of the command range (see ||)
-- • range: the number of items in the command range: 0, 1, or 2 (see ||)
-- • count: any count supplied (see ||)
-- • smods: a table containing the command modifiers (see ||)

-- For example:
-- >lua
-- vim.api.nvim_create_user_command('Upper',
-- function(opts)
-- print(string.upper(opts.fargs[1]))
-- end,
-- { nargs = 1 })

-- vim.cmd.Upper('foo')
-- --> FOO
-- <
-- The complete attribute can take a Lua function in addition to the
-- attributes listed in |:command-complete|. >lua

-- vim.api.nvim_create_user_command('Upper',
-- function(opts)
-- print(string.upper(opts.fargs[1]))
-- end,
-- { nargs = 1,
-- complete = function(ArgLead, CmdLine, CursorPos)
-- -- return completion candidates as a list-like table
-- return { "foo", "bar", "baz" }
-- end,
-- })
-- <

So you could make a lua function called semshi, and then a corresponding usercommand..

local function semshi(enabled)
-- do super duper semshi things
if enabled and enabled == true then
-- do enabled super duper semshi things
else
--do something else
end
end

vim.api.nvim_create_user_command("Semshi",
function(opts)
semshi(opts.fargs[1])
end, {
nargs = 1,
desc = "Activate for epic semshi times, which are so cool, you don't even know. I do, of course. but you don't. But you're gonna.. oh man are you gonna.. ",
})

if none of that helps, it's probably my unfamiliarity showing. lol.

@amaanq
Copy link
Contributor

amaanq commented Oct 12, 2023

you need pynvim installed and python -c 'import pynvim; print(pynvim)' should print the correct path, but I also tried out semshi w/ pynvim installed globally and couldn't get it to work either way so I just disabled it

Related numirias/semshi#74

@folke
Copy link
Collaborator

folke commented Oct 12, 2023

The extra is using this fork: https://github.com/wookayin/semshi

I never used semshi. Is that still useful? Doesn't pyright do semantic tokens?

@amaanq
Copy link
Contributor

amaanq commented Oct 12, 2023

Nope, pyright doesn't support semantic tokens, MS gated that behind their Pylance extension in vscode :^)

@folke
Copy link
Collaborator

folke commented Oct 12, 2023

right

@folke
Copy link
Collaborator

folke commented Oct 12, 2023

I'm going to close this, since this is 100% user config of the environment which is not under control of LazyVim.

Make sure that:

  • you did not set vim.g.loaded_python3_provider = 0
  • you did not disable rplugin in your lazy.nvim config
  • checkhealth shows your python3 provider is working

Once you fixed all of the above, open Neovim and run :UpdateRemotePlugins.

Apart from that I can't help, sorry

@folke folke closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2023
@neuromaancer
Copy link
Contributor Author

Thank you all solved with :UpdateRemotePlugins!

@amaanq
Copy link
Contributor

amaanq commented Oct 12, 2023

not disabling rplugin was it for me, thank you @folke 😁!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants