{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreie3uy7ma3yhgpcpoywpq6arahlggc6eycr35hkbbaamud67rcv43m",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mncvowibojk2"
  },
  "path": "/t/spec-for-package-yml-files-lsp-support/14194#post_1",
  "publishedAt": "2026-06-02T15:05:38.000Z",
  "site": "https://discourse.haskell.org",
  "tags": [
    "GitHub - sol/hpack: hpack: A modern format for Haskell packages · GitHub",
    "Schema for Hpack's package.yml · GitHub"
  ],
  "textContent": "Good day,\n\nI mainly use Stack to manage my projects. Therefore, I spend a lot of time editing `package.yml` files. For some reason the Yaml LSP always picks up these files as PNPM configuration files (probably because they share the same name).\n\nI looked for a spec for the `package.yml` file format, to, surprisingly, no avail.\n\nThe only official specification I could find seems to be HPack’s Readme ( GitHub - sol/hpack: hpack: A modern format for Haskell packages · GitHub ).\n\nUnless I missed something, I think it’s a bit of a shame that there’s not much more support for this config file, especially since Stack is what newcomers are more likely to use (vs. cabal) when setting up projects.\n\nSo I asked our “best” friend ChatGPT to derive a Yaml spec for it, using HPack’s Readme as a reference.\n\nFor archival purposes, I saved it as a Gist so that other people can use it: Schema for Hpack's package.yml · GitHub\nFor those interested, you simply have to add this line at the top of the `package.yml` file for the LSP to pick up the spec:\n\n\n    # yaml-language-server: $schema=<url-to-the-raw-gist>\n\n\nThis is by no means complete nor 100% correct, but it seems to work OK for simple configs, and it’s nice to have auto-completion (at least for field names).\n\nThe goal of the post is not to show off with an AI-generated shaky Yaml spec. It’s also to raise the question of the DX with this particular config file. I think it is worth looking into. As I said earlier, newcomers are more likely (I think) to use Stack than Cabal. And I believe LSP support/a proper spec would greatly help the DX.",
  "title": "Spec for `package.yml` files + LSP Support"
}