Git Product home page Git Product logo

nlua.nvim's Introduction

nlua.nvim's People

Contributors

dancojocar avatar pta2002 avatar rockerboo avatar shadmansaleh avatar smolck avatar tjdevries avatar willelz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nlua.nvim's Issues

Is this plugin remap the 'K'

for my neovim keymap, I remap the K for <C-d>
after I install this plugin, I step into the help-doc when I use 'K' for scrolling,
How can I fix that?

Error while calling lua chunk: Failed to spawn process

I am getting the following error when trying to run :luafile ./scripts/download_sumneko.lua

E5113: Error while calling lua chunk: .../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:399: Failed to spawn process: {
  _additional_on_exit_callbacks = {},
  _raw_cwd = "/Users/wwilkinson/.cache/nvim/nlua/sumneko_lua/lua-language-server/",
  _shutdown_check = <userdata 1>,
  _stderr_results = {},
  _stdout_results = {},
  _user_on_stdout = <function 1>,
  args = { "submodule", "update", "--init", "--recursive" },
  command = "git",
  enable_handlers = true,
  enable_recording = true,
  interactive = true,
  pid = "ENOENT: no such file or directory",
  stderr = <userdata 2>,
  stdin = <userdata 3>,
  stdout = <userdata 4>,
  user_data = {},
  <metatable> = <1>{
    __index = <table 1>,
    _create_uv_options = <function 2>,
    _execute = <function 3>,
    _pipes_are_closed = <function 4>,
    _prepare_pipes = <function 5>,
    _reset = <function 6>,
    _shutdown = <function 7>,
    _stop = <function 8>,
    add_on_exit_callback = <function 9>,
    after = <function 10>,
    after_failure = <function 11>,
    after_success = <function 12>,
    and_then = <function 13>,
    and_then_on_failure = <function 14>,
    and_then_on_failure_wrap = <function 15>,
    and_then_on_success = <function 16>,
    and_then_on_success_wrap = <function 17>,
    and_then_wrap = <function 18>,
    chain = <function 19>,
    chain_status = <function 20>,
    co_wait = <function 21>,
    is_job = <function 22>,
    join = <function 23>,
    new = <function 24>,
    pid = <function 25>,
    result = <function 26>,
    send = <function 27>,
    shutdown = <function 28>,
    start = <function 29>,
    stderr_result = <function 30>,
    sync = <function 31>,
    wait = <function 32>
  }
}
stack traceback:
        .../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:399: in function '_execute'
        .../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:442: in function 'start'
        .../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:446: in function 'sync'
        scripts/download_sumneko.lua:27: in function 'run'
        scripts/download_sumneko.lua:46: in function 'download'
        scripts/download_sumneko.lua:67: in main chunk

Here is my plugins.lua file

return require('packer').startup(function()
  -- Packer can manage itself
  use 'wbthomason/packer.nvim'
  --Telescope
  use {'nvim-lua/plenary.nvim'}
  use {'nvim-lua/popup.nvim'}
  use {'nvim-telescope/telescope.nvim'}
  use {
      'nvim-telescope/telescope-frecency.nvim',
      requires = {'tami5/sql.nvim'},
      config = function()
          require('telescope').load_extension('frecency')
      end
  }
  use {'nvim-telescope/telescope-symbols.nvim'}
  use {'nvim-telescope/telescope-github.nvim'}
  -- Lua config
  use { 'neovim/nvim-lspconfig' }
  -- Lua development
  use {'tjdevries/nlua.nvim'}
  use { 'hrsh7th/nvim-compe' }
  use { 'hrsh7th/vim-vsnip' }
  use { 'xabikos/vscode-javascript' }
  -- Better syntax
  use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate'}
  use { 'p00f/nvim-ts-rainbow' }
end)

Any help would be greatly appreciated. Thank you!

My Lua plugin, which doesn't do anything fancy, breaks nlua.nvim's diagnostics

When I enable git-blame.nvim, diagnostic messages don't show up in Lua files/projects. When I open a Lua file that is not in a Git repo, diagnostics work. After disabling git-blame.nvim, diagnostics also work. I have no idea why this would happen. git-blame.nvim and sumneko_lua work fine together.

Here's how I set up nlua:

require'nlua.lsp.nvim'.setup(lsp, {
    on_attach = on_attach,
    globals = {'love'},
    disabled_diagnostics = {'lowercase-global'}
})

And default sumneko_lua:

lsp.sumneko_lua.setup {on_attach = on_attach}

My on_attach:

local on_attach = function(_, bufnr)
    require'completion'.on_attach({
        sorter = 'none',
        matcher = {'substring', 'exact', 'fuzzy'}
    })

    -- Mappings
    vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD',
                                '<Cmd>lua vim.lsp.buf.declaration()<CR>',
                                keymap_opts)
    vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd',
                                '<Cmd>lua vim.lsp.buf.definition()<CR>',
                                keymap_opts)
    vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K',
                                '<Cmd>lua vim.lsp.buf.hover()<CR>', keymap_opts)
    vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi',
                                '<cmd>lua vim.lsp.buf.implementation()<CR>',
                                keymap_opts)
    vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>',
                                '<cmd>lua vim.lsp.buf.signature_help()<CR>',
                                keymap_opts)
    vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>D',
                                '<cmd>lua vim.lsp.buf.type_definition()<CR>',
                                keymap_opts)
    vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>rr',
                                '<cmd>lua vim.lsp.buf.rename()<CR>', keymap_opts)
    vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>e',
                                '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>',
                                keymap_opts)
    vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ca',
                                '<cmd>lua vim.lsp.buf.code_action()<CR>',
                                keymap_opts)
    vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>cd',
                                '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>',
                                keymap_opts)
end

I initialize the lsp variable at the top of init.lua:

local lsp = require('lspconfig')

Maybe you have some ideas about why this would happen?

Error while executing scripts/download_sumneko.lua

Got this error while executing :luafile scripts/download_sumneko.lua
I don't know if it is an issue or I have done something wrong, sorry if this is the case.

E5113: Error while calling lua chunk: ...hgh/.config/nvim/bundle/plenary.nvim/lua/plenary/job.lua:80: ./3rd/luamake/luamake: Executable not found
stack traceback:
        ...hgh/.config/nvim/bundle/plenary.nvim/lua/plenary/job.lua:80: in function 'new'
        scripts/download_sumneko.lua:16: in function 'run'
        scripts/download_sumneko.lua:55: in function 'build'
        scripts/download_sumneko.lua:62: in main chunk

question on 'gf' package.path/include_expr

thank you for this v helpful plugin.

with the following hiearchy:

nvim/
  - init.lua
  -  lua/
    - domain/
      - file.lua

a line in file init.lua says "require('domain.file')". If I cd nvim/ && nvim init.lua and then gf on that line, nvim opens an empty buffer. But, if instead I cd nvim/lua/ then gf works exactly as expected.

This difference is because nvim/lua/ is not in my package.path. My question is, should it be (and i'm failing) or is this expected?

Better detection for platform OS

Since lua LSP has predictable platforms it builds to, you could do a conditional check and set the bin location

local bin_location = jit.os

if jit.os == 'osx' then 
  local bin_location = 'macOS'
elseif jit.os == 'linux' then --or what ever the value returned by linux
    local bin_location = 'Linux'
....

Just some ideas

Error when trying to install the scripts/download_sumneko.lua

When I run :luafile scripts/download_sumneko.lua
I get this error, is there something I am doing wrong because I don't fully comprehend the docs maybe (I am a noob into this)
Here the error I get.

I got the latest Neovim installed etc.

  cwd = "/Users/eddyekofo/.cache/nvim/nlua/sumneko_lua/lua-language-server/",
  enable_handlers = true,
  enable_recording = true,
  interactive = true,
  pid = "ENOENT: no such file or directory",
  stderr = <userdata 2>,
  stdin = <userdata 3>,
  stdout = <userdata 4>,
  user_data = {},
  <metatable> = <1>{
    __index = <table 1>,
    _create_uv_options = <function 2>,
    _execute = <function 3>,
    _pipes_are_closed = <function 4>,
    _prepare_pipes = <function 5>,
    _reset = <function 6>,
    _shutdown = <function 7>,
    _stop = <function 8>,
    add_on_exit_callback = <function 9>,
    and_then = <function 10>,
    chain = <function 11>,
    chain_status = <function 12>,
    co_wait = <function 13>,
    is_job = <function 14>,
    join = <function 15>,
    new = <function 16>,
    pid = <function 17>,
    result = <function 18>,
    send = <function 19>,
    shutdown = <function 20>,
    start = <function 21>,
    stderr_result = <function 22>,
    sync = <function 23>,
    wait = <function 24>
  }
}
stack traceback:
        ...ins/neovim/nvim/plugged/plenary.nvim/lua/plenary/job.lua:370: in function '_execute'
        ...ins/neovim/nvim/plugged/plenary.nvim/lua/plenary/job.lua:413: in function 'start'
        ...ins/neovim/nvim/plugged/plenary.nvim/lua/plenary/job.lua:417: in function 'sync'
        plugged/nlua.nvim/scripts/download_sumneko.lua:25: in function 'run'
        plugged/nlua.nvim/scripts/download_sumneko.lua:55: in function 'build'
        plugged/nlua.nvim/scripts/download_sumneko.lua:62: in main chunk

Lua profiler for nvim

One useful addition to a nvim-lua standard library would be a profiler (since the vim prof func * can't trace into lua). I've played a bit with the debug.sethook based approach, either using https://stackoverflow.com/questions/15725744/easy-lua-profiling or https://github.com/charlesmallah/lua-profiler.

Both kinda work, but it'd be nice to have something more nvim-aware (and prettier) :)

There's also https://blast.hk/moonloader/luajit/ext_profiler.html, but I couldn't get this to work properly.

Lua file not showing diagnostic

In the LspInfo I can see sumneko_lua is attached and all the completion and navigation to definition works fine.
image

But I can't seem to get the diagnostic working. For example,

  • I am expecting to see diagnostics telling me I didn't end my function
    image

Appreciate any helps on this. Thanks!

Update

  • Manage to get it work with settings on nvim-lspconfig

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.