Repository navigation
config.idp: the keys it takes, as data - #292
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs ComlineProject/comline-vscode#31.
Problem
config.idp's reader is amatchon 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,encodingsand a dependency'saccept_unverifiedwere missing, andwirestill nameddatagram@2as the default. The language server leaves.idpkey completion to the client, so a key missing there is missing in the editor.What changed
package::config::keys(new):keys()lists every keyconfig.idptakes, at every depth, with its type (integer,string,choice,list,dictionary,mapfor 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.framingandhandshake/handshake.name:official::names, withDEFAULT_FORMATandDEFAULT_FRAMINGas defaults; a namespaced name declared underencodingsis marked as allowed too.handshake's dictionary form:COMLINE2_PARAMS, defaults first.HandshakeParamgainssummaryanddocso the parameters' prose sits beside them.specification_version:Edition::ALL.unverifiedandaccept_unverified: the catalog's guarantees.encodings'kind:ProfileKind.settingsissettings, not described below: its keys are the settings registry's, which the language server serves.schemas/config-idp.json: the table as JSON (version1, thenkeys), generated and held to by a test, asdoc-model.jsonis. Regenerate withCOMLINE_BLESS=1 cargo test -p comline-core --lib config::keys. Editors read it at a commit, as the docs readcomline-toml.json.Held to the reader
Tests in
config::keys(the reader ones need thecompilerfeature):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 throughinterpret_assignmentand is accepted.the_reader_refuses_a_key_the_table_does_not_list: every dictionary the table closes refuses a key it doesn't list. Notdependencies' entries, whose reader skips what it doesn't know, norunverified, whose entries are judged where the guarantees are known.the_table_lists_every_key_the_reader_matches: the string literals in the reader'smatchpatterns (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
group(core#284) is not in the table; it goes in with that change, and the test above fails until it does.settingsis not expanded. If an editor wants its keys, the registry already has them (settings::catalog::block_summary)..idpitself.