Skip to content

Add rust dependency - #3448

Open
CppCXY wants to merge 3 commits into
LuaLS:masterfrom
CppCXY:master
Open

CppCXY wants to merge 3 commits into
LuaLS:masterfrom
CppCXY:master

Conversation

@CppCXY

@CppCXY CppCXY commented Aug 11, 2026

Copy link
Copy Markdown
Member
  1. To achieve better extensibility and higher performance, introduce Rust extension libraries.
  2. Replace the formatter with emmylua_formatter.

@ishermandom

Copy link
Copy Markdown

Thanks for your work on this tool! I've arrived here from investigating zed-extensions/lua#56.

Using Claude, I built this PR and compared it with 3.19.1 over LSP. I found two small bugs, and I have one question:

  1. The editor's tabSize and insertSpaces are ignored.

    formatting.lua passes options as the third argument, but l_format reads only two. So an editor set to 2 spaces or to tabs gets the whole file re-indented to 4 spaces.

    Potential fix: apply them over the .luafmt.toml config, as emmylua_ls does in build_workspace_formatter_config.

  2. The .luafmt.toml lookup gets a file:// URI where a path is expected.

    AFAICT, currently: .luafmt.toml is looked up from the server's working directory instead of the file's folder. A config in a subfolder is never used, and the root config works only if the server was started there.

    Potential fix: pass furi.decode(uri) in script/core/formatting.lua, where it calls rust.luafmt.format.

  3. Question: Whole-file formatting now ignores .editorconfig and Lua.format.defaultConfig, but range formatting still uses them. For example, with quote_style = single, only range formatting changes "x" to 'x'. Is that split intended?

Claude built a tested patch for 1 and 2, with test cases. I can post it if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants