Skip to content

fix(types): use portable string literal aliases - #902

Open
oriori1703 wants to merge 1 commit into
stevearc:masterfrom
oriori1703:fix/portable-lsp-format-aliases
Open

oriori1703 wants to merge 1 commit into
stevearc:masterfrom
oriori1703:fix/portable-lsp-format-aliases

Conversation

@oriori1703

Copy link
Copy Markdown

Summary

  • use direct string literals for conform.LspFormatOpts
  • make the alias compatible with both LuaLS and EmmyLua
  • prevent EmmyLua from rejecting valid default_format_opts.lsp_format values

LuaLS understands both the previous nested-quote spelling and the direct literal spelling. EmmyLua only interprets the direct spelling as the actual Lua string value.

Verification

  • emmylua_check 0.25.1: valid values accepted and invalid values rejected
  • lua-language-server 3.19.1: valid values accepted and invalid values rejected
  • Real Conform setup { default_format_opts = { lsp_format = 'fallback' } } call accepted by both analyzers
  • git diff --check

make test was also run. Two unrelated newline-preservation tests fail under Neovim 0.12.5 (fuzzer formats correctly and runner e2e sets the correct output); all other tests pass. make lint could not complete because luacheck is not installed in the environment.

Related: EmmyLuaLs/emmylua-analyzer-rust#1271

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.

1 participant