[PR #754] [MERGED] [config json schema] declare default values and examples for in-ide documentation #9701

Closed
opened 2026-02-16 18:14:01 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/754
Author: @Schniz
Created: 7/8/2025
Status: Merged
Merged: 7/8/2025
Merged by: @adamdotdevin

Base: devHead: schniz/add-self-documenting-configuration


📝 Commits (2)

  • 37f548b add default and examples to config json schema
  • 5fcea61 add default information in hover

📊 Changes

3 files changed (+285 additions, -79 deletions)

View changed files

📝 packages/opencode/config.schema.json (+222 -45)
📝 packages/opencode/script/schema.ts (+26 -1)
📝 packages/opencode/src/config/config.ts (+37 -33)

📄 Description

this makes most editors autocomplete the default value when you want to override,
acting as an in-ide documentation for the keybindings instead of forcing people to
go to the website.

the only thing I dislike about it is that it is repeating stuff from tui,
and the proof for the fragility of this solution is that the help keybinding
didn't work well and fixed in this PR.

maybe we can use ts->go generation, or go->ts codegen to ensure
they are always in sync.

but that's an issue for a different PR I guess.

screenshot


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/754 **Author:** [@Schniz](https://github.com/Schniz) **Created:** 7/8/2025 **Status:** ✅ Merged **Merged:** 7/8/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `schniz/add-self-documenting-configuration` --- ### 📝 Commits (2) - [`37f548b`](https://github.com/anomalyco/opencode/commit/37f548b4fa63c38d7e72f0f62bf7cf769d486592) add default and examples to config json schema - [`5fcea61`](https://github.com/anomalyco/opencode/commit/5fcea61a67a83c35ffa4ab2568bd6e0ce7cf4dbb) add default information in hover ### 📊 Changes **3 files changed** (+285 additions, -79 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/config.schema.json` (+222 -45) 📝 `packages/opencode/script/schema.ts` (+26 -1) 📝 `packages/opencode/src/config/config.ts` (+37 -33) </details> ### 📄 Description this makes most editors autocomplete the default value when you want to override, acting as an in-ide documentation for the keybindings instead of forcing people to go to the website. the only thing I dislike about it is that it is repeating stuff from tui, and the proof for the fragility of this solution is that the `help` keybinding didn't work well and fixed in this PR. maybe we can use ts->go generation, or go->ts codegen to ensure they are always in sync. but that's an issue for a different PR I guess. ![screenshot](https://github.com/user-attachments/assets/cdd2aa40-15f7-4eec-99ec-7aa1c6b7f2af) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:01 -05:00
yindo closed this issue 2026-02-16 18:14:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9701