Coder Social home page Coder Social logo

Plugin conflicts/debugging about neodev.nvim HOT 8 CLOSED

folke avatar folke commented on June 28, 2024 1
Plugin conflicts/debugging

from neodev.nvim.

Comments (8)

wbthomason avatar wbthomason commented on June 28, 2024 1

Thanks! Everything seems to work for me now! Thanks again for the plugin; this will make my life substantially easier.

from neodev.nvim.

folke avatar folke commented on June 28, 2024

Are you on windows by any chance? Haven't tested it there...

What do you use for adding plugins? packer?

Can you post a print(vim.inspect(...)) of the result you get from luadev.setup?

from neodev.nvim.

wbthomason avatar wbthomason commented on June 28, 2024

Sure:

  • I'm on Linux
  • Neovim version: NVIM v0.5.0-dev+1339-g5d9c56012 (with LuaJIT)
  • I do use packer, yes.

Results of luadev.setup:

{                                                                                                                                                            
  cmd = { "lua-language-server" },                                                                                                                           
  on_new_config = <function 1>,                                                                                                                              
  settings = {                                                                                                                                               
    Lua = {                                                                                                                                                  
      awakened = {                                                                                                                                           
        cat = true,                                                                                                                                          
        <metatable> = <1>{                                                                                                                                   
          __tostring = <function 2>                                                                                                                          
        }                                                                                                                                                    
      },                                                                                                                                                     
      diagnostics = {                                                                                                                                        
        globals = { "vim" },                                                                                                                                 
        <metatable> = <table 1>                                                                                                                              
      },                                                                                                                                                     
      runtime = {                                                                                                                                            
        path = { "./?.lua", "/usr/share/luajit-2.0.5/?.lua", "/usr/local/share/lua/5.1/?.lua", "/usr/local/share/lua/5.1/?/init.lua", "/usr/share/lua/5.1/?.l
ua", "/usr/share/lua/5.1/?/init.lua", "lua/?.lua", "lua/?/init.lua" },                                                                                       
        version = "LuaJIT",                                                                                                                                  
        <metatable> = <table 1>                                                                                                                              
      },                                                                                                                                                     
      telemetry = {                                                                                                                                          
        enable = false,                                                                                                                                      
        <metatable> = <table 1>                                                                                                                              
      },                                                                                                                                                     
      workspace = {                                                                                                                                          
        library = {},                                                                                                                                        
        maxPreload = 2000,                                                                                                                                   
        preloadFileSize = 150,                                                                                                                               
        <metatable> = <table 1>                                                                                                                              
      },                                                                                                                                                     
      <metatable> = <table 1>                                                                                                                                
    },                                                                                                                                                       
    <metatable> = <table 1>                                                                                                                                  
  }                                                                                                                                                          
}

Later in my setup, I modify that table by adding an on_attach and a capabilities table.
My full setup is here:

from neodev.nvim.

folke avatar folke commented on June 28, 2024

What does :lua print(vim.inspect(require("lua-dev.sumneko").library())) give?

from neodev.nvim.

wbthomason avatar wbthomason commented on June 28, 2024

That gets me:

E5108: Error executing lua ...e/pack/packer/start/lua-dev.nvim/lua/lua-dev/sumneko.lua:9: table index is nil

from neodev.nvim.

wbthomason avatar wbthomason commented on June 28, 2024

Looking into that error, it seems that in lua-dev.sumneko.types, the problem is:

f = "/home/wil/.local/share/nvim/site/pack/packer/start/lua-dev.nvim/lua/lua-dev/s
umneko.lua"                                                                   
vim.loop.fs_realpath(f .. '/../../../types') = nil ENOTDIR: not a directory: /home/wil/.local/share/nvim/site/pack/packer/sta
rt/lua-dev.nvim/lua/lua-dev/sumneko.lua/../../../types ENOTDIR

from neodev.nvim.

wbthomason avatar wbthomason commented on June 28, 2024

Using vim.loop.fs_realpath(vim.fn.fnamemodify(f, ':h:h:h') .. '/types') instead of the current ../../../types approach seems to work? I'm not sure why only I have encountered this issue, but I'm happy to make a PR if you'd like to use this change.

from neodev.nvim.

folke avatar folke commented on June 28, 2024

Thank you for debugging this! I just pushed a change with your suggestion.

The code that was there before actually started with a filename to go up, which for some reason works on macos, but probably not on your distro.

So I did something like lua/foo.lua/../../..

Your approach is definitely better :)

from neodev.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.