This package is deprecated. Use https://github.com/folke/neodev.nvim instead :)
tjdevries / nlua.nvim Goto Github PK
View Code? Open in Web Editor NEWLua Development for Neovim
License: MIT License
Lua Development for Neovim
License: MIT License
This package is deprecated. Use https://github.com/folke/neodev.nvim instead :)
After pressing gd
, it successfully directs me to the correct file. However, it will open a quickfix list populated with file's first line which I assumed it is not intended since previous action doesn't lead to this behaviour.
gf
but slower):Using Neovim 0.5.0 and Arch btw
I'm thinking I want to make the plugin more opinionated to my style of lua dev.
Maybe we can work on it on stream.
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?
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!
nlua.nvim/lua/nlua/lsp/nvim.lua
Line 32 in a0722bd
should be isdirectory(...) == 1
or all will be added
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?
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
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?
The plugin completion path nvim-lua/completion.nvim
is broken. I think it's supposed to be: nvim-lua/completion-nvim
.
Since lua LSP has predictable platforms it builds to, you could do a conditional check and set the bin location
nlua.nvim/lua/nlua/lsp/nvim.lua
Line 7 in b24d838
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
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.