Comments (3)
Hey thanks for the feedback. I don't think it's related to serde, I can replicate the issue simply with
use nvim_oxi::{self as oxi, Dictionary, Function, Object, Result};
// Passing a table here causes a segfault.
fn setup(_: Object) -> Result<()> {
Ok(())
}
#[oxi::module]
fn foobar() -> Result<Dictionary> {
Ok(Dictionary::from_iter([("setup", Function::from_fn(setup))]))
}
I have an idea about what could be causing this but I'll look into it.
from nvim-oxi.
This should be fixed in f08099d. There is one gotcha however: an empty table will be deserialized as an array instead of a dictionary:
require("foobar").setup({}) -- <- gives error
a possible workaround is to implement Deserialize
for Config
by hand, implementing the Visitor::visit_seq
method on your visitor to check if the sequence is empty.
from nvim-oxi.
Thanks @noib3!
from nvim-oxi.
Related Issues (20)
- This crate is causing neovim to crash on the latest commit HOT 4
- Test complete API
- The libuv example doesn't work HOT 2
- Can't locate `lua_pushlstring`
- Simple code error, help! HOT 1
- How to perform the api of nvim in other processes HOT 1
- [Windows][Powershell7] cannot find type `PathBuf` in this scope HOT 3
- [Windows][Powershell7] linking with `link.exe` failed: exit code: 1120 HOT 5
- [Ubuntu] Error while calling lua chunk... undefined symbol: luaopen_... HOT 1
- support derive
- [help] How to call other lua plugin exposed methods HOT 4
- Crash when loading the example plugin on Windows HOT 29
- Test macro doesn't seem to pick up on failures HOT 6
- nvim_oxi::api::types::Mode doesn't allow for Remap ("m") mode HOT 2
- Add Installation Instructions HOT 1
- `println!` writes to nvim process HOT 4
- Not sure you answered my question HOT 2
- Can't find buffer number from `Buffer` HOT 5
- Use LuaFunction as `rhs` for `buffer_keymap_set` that should capture local variable HOT 2
- [Question] Use serializable structs as input to call method? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-oxi.