lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Config Schema `$ref` property is incorrect

Open scottmckendry opened this issue 1 year ago • 3 comments

Describe the bug The yaml language server currently cannot parse the JSON schema provided.

I'm fairly certain this is because the schema references the GitHub page for the schema definition file instead of the raw content.

If you open the schema in a browser, you'll see that the $ref property is:

When it probably should be:

To Reproduce

  1. In an editor running the language server, open a config.yml file
  2. Enter # yaml-language-server: $schema=https://json.schemastore.org/lazygit.json at the top

Expected behavior Language server should parse the schema

scottmckendry avatar Mar 26 '24 17:03 scottmckendry

The schema that's hosted at https://json.schemastore.org/lazygit.json is obsolete, it should have been removed in https://github.com/SchemaStore/schemastore/commit/a6b2657452. Don't use it.

If you are using VS Code with Redhat's Yaml extension, the # yaml-language-server line that you posted is unnecessary. The extension will query the schemastore automatically and get the schema from there, and the catalog correctly links it to https://raw.githubusercontent.com/jesseduffield/lazygit/master/schema/config.json.

stefanhaller avatar Mar 26 '24 18:03 stefanhaller

The schema that's hosted at https://json.schemastore.org/lazygit.json is obsolete, it should have been removed in https://github.com/SchemaStore/schemastore/commit/a6b2657452. Don't use it.

The documentation at https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md still tells you to use it though. Might need an update there. (I'm using neovim, not vscode btw)

floriskruisselbrink avatar Mar 28 '24 12:03 floriskruisselbrink

Ah right, thanks. Fixed in #3451.

stefanhaller avatar Mar 28 '24 12:03 stefanhaller