Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support JSON5 for .vscode/settings.json #542

Open
mrcjkb opened this issue Oct 15, 2024 · 1 comment
Open

Support JSON5 for .vscode/settings.json #542

mrcjkb opened this issue Oct 15, 2024 · 1 comment
Labels
enhancement New feature or request needs triage

Comments

@mrcjkb
Copy link
Owner

mrcjkb commented Oct 15, 2024

Feature description

See also #537.

Optionally, using https://github.com/Joakker/lua-json5.

It may be better to add basic JSON5 support (e.g. ignoring comments and trailing commas) to lua-cjson instead.

@mrcjkb mrcjkb added enhancement New feature or request needs triage labels Oct 15, 2024
@b0o
Copy link

b0o commented Dec 30, 2024

As a temporary workaround, I am overriding vim.json.decode with lua-json5 before loading rustaceanvim:

{
  'mrcjkb/rustaceanvim',
  version = '^5',
  ft = 'rust',
  dependencies = {
    {
      'Joakker/lua-json5',
      build = './install.sh',
      config = function()
        -- Support JSON5 syntax in .vscode/settings.json
        ---@diagnostic disable-next-line: duplicate-set-field
        vim.json.decode = function(str, _) return require('json5').parse(str) end
      end,
    },
  },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

2 participants