Skip to content

config.idp: the keys it takes, as data - #292

Merged
Kinflou merged 2 commits into
masterfrom
config-idp-keys
Nov 15, 2026
Merged

Kinflou merged 2 commits into
masterfrom
config-idp-keys

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 15, 2026

Copy link
Copy Markdown
Member

Refs ComlineProject/comline-vscode#31.

Problem

config.idp's reader is a match on key names (freezing.rs, dependency.rs), so nothing in core could say which keys exist. Every editor kept its own copy, and comline-vscode's went stale: handshake, id, settings, unverified, encodings and a dependency's accept_unverified were missing, and wire still named datagram@2 as the default. The language server leaves .idp key completion to the client, so a key missing there is missing in the editor.

What changed

  • package::config::keys (new): keys() lists every key config.idp takes, at every depth, with its type (integer, string, choice, list, dictionary, map for names the user chooses, oneOf, settings), whether it is required, a summary and a description. The values are not written again here: they come from where core declares them.
    • wire.format, wire.framing and handshake / handshake.name: official::names, with DEFAULT_FORMAT and DEFAULT_FRAMING as defaults; a namespaced name declared under encodings is marked as allowed too.
    • handshake's dictionary form: COMLINE2_PARAMS, defaults first. HandshakeParam gains summary and doc so the parameters' prose sits beside them.
    • specification_version: Edition::ALL. unverified and accept_unverified: the catalog's guarantees. encodings' kind: ProfileKind.
    • settings is settings, not described below: its keys are the settings registry's, which the language server serves.
  • schemas/config-idp.json: the table as JSON (version 1, then keys), generated and held to by a test, as doc-model.json is. Regenerate with COMLINE_BLESS=1 cargo test -p comline-core --lib config::keys. Editors read it at a commit, as the docs read comline-toml.json.

Held to the reader

Tests in config::keys (the reader ones need the compiler feature):

  • the_reader_takes_every_key_the_table_lists: a valid value built from the table, for every key and every alternative of an either-or, goes through interpret_assignment and is accepted.
  • the_reader_refuses_a_key_the_table_does_not_list: every dictionary the table closes refuses a key it doesn't list. Not dependencies' entries, whose reader skips what it doesn't know, nor unverified, whose entries are judged where the guarantees are known.
  • the_table_lists_every_key_the_reader_matches: the string literals in the reader's match patterns (freezing.rs, dependency.rs, scanned from the source) are all in the table, so an arm added to the reader without a row fails. It reads the source's shape, one pattern per line before its =>; it fails closed when it finds fewer than five names.
  • the_committed_schema_matches_the_table, every_key_has_prose.

Not here

  • A dependency's group (core#284) is not in the table; it goes in with that change, and the test above fails until it does.
  • settings is not expanded. If an editor wants its keys, the registry already has them (settings::catalog::block_summary).
  • The table is not served by the CLI or the language server. comline-vscode#31's follow-up is the language server serving .idp itself.

Kinflou added 2 commits November 16, 2026 05:50
package::config::keys lists every key the config.idp reader takes, with its
type, allowed values, default and prose, and writes it as the committed
schemas/config-idp.json. The values come from where core declares them (the
official encodings, comline@2's parameters, the editions, the guarantees).
Tests hold the table to the reader in both directions.

Refs ComlineProject/comline-vscode#31
@Kinflou
Kinflou marked this pull request as ready for review November 15, 2026 22:23
@Kinflou
Kinflou merged commit 4d5b19c into master Nov 15, 2026
33 checks passed
@Kinflou
Kinflou deleted the config-idp-keys branch November 15, 2026 22:23
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