Joakker / lua-json5

A json5 parser for luajit
MIT License
27 stars 6 forks source link

Add support for Windows #3

Closed Crax97 closed 1 year ago

Crax97 commented 1 year ago

I use both Windows and Fedora Linux, and while the plugin installs without any issues on Fedora, it had to be adapted to work on Windows.

This pull request:

  1. Bumpsmlua to version to 0.9, since version 0.6.2 (which is the one used in Cargo.lock) doesn't compile on Windows
  2. Removes mlua's vendored feature, since it clashes with module (a compile-time error is generated), and without module the code doesn't compile.
  3. Updates lua-json5's code so that it compiles using mlua 0.9 (ToLua has been renamed to IntoLua in newer versions of mlua, so the code had to be fixed)
  4. Adds an install.ps1 script to install the plugin on Windows, and updates the README to reflect this change, which emulates what install.sh does on linux and macos.

I'm currently using the forked plugin myself: https://github.com/Crax97/dotfiles/blob/c213d0574775ba361f080adf4afa33177f4261e7/nvim/lua/plugins.lua#L14-L18

And, using my setup, it installed fine both on Fedora 38 and Windows build 22621

Joakker commented 1 year ago

Seems good to me. Sorry for the late response, and thank you for your contribution! 😃