Replies: 11 comments 4 replies
-
Hi, you're not blind, it's currently not possible to access the The whole bridge machinery I'm using in |
Beta Was this translation helpful? Give feedback.
-
Thanks for your fast response. 🙏🏾 Might be related: |
Beta Was this translation helpful? Give feedback.
-
The project follows semantic versioning and there's a
Technically speaking there's really no difference between e.g. However the |
Beta Was this translation helpful? Give feedback.
-
Yeah, I wouldn't expect any support for arbitrary plugins. Just an easy way to access them. But maybe I need to learn how |
Beta Was this translation helpful? Give feedback.
-
Maybe there could be a way to have procmacro you can use to define an api of a third party macro easily, I did build some here: https://github.com/ModProg/nvim-rust/blob/6edc2435c11e94699efdd574efd981dace69fc33/src/api.rs#L14 and if you would accept something like this in nvim-oxi, this could be exported and made available to a user that quickly wants to create an interface to another plugin where they just need to provide the necessary globals and functions+parameters. |
Beta Was this translation helpful? Give feedback.
-
I'm sorry to abuse this issue, but could someone point me to how I could use |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
Alright, understood. Is it hard to expose this? 🤔 My use-case are two. First, I want to interact with language servers and people often complain that they want to use in-built LSP support or CoC or vim-lsp or... So I intend to have a trait for the language client and have multiple implementations for it. And from there on have some typesafe Rust environment I can develop the core/business-logic of my plugin. I could write only the core of the plugin in Rust and the rest in Lua as "glue-code". But I would really love to make it exclusively in Rust. Lua is simply not a serious language for me except for hacking around some smallish things. It is too error prone and fragile in my opinion. I have an almost complete rewrite of one of my plugins, trying to establish proper architecture, clean code, a lot of unit tests and so forth. But in the end it is still all super loose and doesn't feel great. Lua doesn't has many features even though it is such a high level language and this bugs me. Thanks for your support. 🙏🏾 |
Beta Was this translation helpful? Give feedback.
-
@weilbith I've turned the original issue into this discussion since it was getting a bit off topic and opened #47, #48 instead.
It's not, but that'll work differently to what we're doing now. I'll try to give a bit of context. Currently we only have one module, Unfortunately all other major Note however that with mlua you'll also be calling Lua when using
instead of
Isn't this exactly what
This is probably the biggest reason why I started this project, and also why providing a way to call arbitrary Lua code is outside the scope of this project. |
Beta Was this translation helpful? Give feedback.
-
I think there should be a way to provide access to the Lua Neovim ecosystem. While you could do that through a pure Lua interface as I tried to implement myself: https://github.com/modprog/nvim-rust, I believe the better way would be to access the Neovim API through FFI with C and provide easy access to Lua APIs. Even though rust provides most of what you would ever need, being able to access Neovim specific Lua libraries that are provided as plugins might be useful. I think this can be achieved in two steps:
If you believe that this is not in scope for this library as long as the Lua state is somehow exposed, the helper macros etc. could be provided by a wrapper library. When nvim_oxi allows access to 3rd party Lua functions, those could then be bundled in helper crates e.g. someone could build |
Beta Was this translation helpful? Give feedback.
-
@weilbith @ModProg 71e8f28 introduces I've added a small example to show how to call an arbitrary Lua function (in that case just the global
This is definitely out of scope for |
Beta Was this translation helpful? Give feedback.
-
Hey 👋🏾
First of all, thank you very much for all the effort and time you put into this project. I really appreciate it and it gave the necessary motivation to start working on NeoVim plugins again.
I'm now in need to make some calls to functions that are globally defined in Lua by NeoVim. Means I want to access
vim.lsp
,vim.diagnostic
, ... Unfortunately I don't see how this should be possible right now. But maybe I'm blind. 🙈I took a look into your noib3/nvim-compleet project to checkout how you do it there. But it seems like this includes a huge amount of boilerplate code with a bridge etc. pp. completely independent of this library here. I'm not sure if there is any better way to do it, because I honestly have no clue about this topic. But in any case, do you plan to integrate this feature into
nvim-oxi
too? It looks like you did already all the work for it in the other project, so it would be just a matter of putting it here too and wrap it nicely. Am I wrong?Looking forward to hear what you think. 🙃
Beta Was this translation helpful? Give feedback.
All reactions