Repository navigation
feat: add comline targets to print compiled-in generator targets - #32
Merged
Merged
Conversation
added 2 commits
October 2, 2026 10:56
Prints one `language#version` per line to stdout, mirroring `completions`'s existing stdout-payload precedent — everything else goes through `ui::*` to stderr. Reflects how this binary was compiled (which `gen-<lang>` Cargo features are on), not any project, so it ignores `--path` entirely and needs no `config.idp` to exist. A standalone subcommand rather than a `generate --list-targets` flag: `generate::run` calls `ensure_project` as its first line and the rest of the function assumes a real project, which this data has nothing to do with — bolting it on would mean special-casing past that invariant or wrongly requiring a project, plus inventing a rule for what `--target` + `--list-targets` together would even mean. A separate subcommand makes that question structurally impossible instead. Depends on the new `Registry::targets()` in ComlineProject/generation (separate PR) — needed by the upcoming comline-vscode `.idp` completion/ hover work for `code_generation.languages`, so the extension can show the real set of targets instead of guessing.
All four were pinned at older revs (comline-core@ed584ae) while generation/comline-rust/comline-typescript's own default branches had already independently been bumped to comline-core@91b3c1a — this crate was the one left behind in that cascade. Needed as a hard prerequisite for the previous commit: comline-codegen's old pin predates Registry::targets() entirely, so `comline targets` can't compile without at least that one bump — and bumping only that one (while leaving comline-core/-codegen-rust/-codegen-typescript on the old ed584ae-era revs) produces a "multiple different versions of crate comline_core/ comline_codegen in the dependency graph" compile error, since the crates can no longer be unified. All four together resolve to one consistent graph again. Also required two small upstream rev bumps (comline-codegen-rust / comline-codegen-typescript's own comline-codegen pin was one commit behind generation's tip, same root cause) — see ComlineProject/comline-rust#14 and ComlineProject/comline-typescript#12, both merged.
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.
Summary
comline targetssubcommand: prints onelanguage#versionper line to stdout — the exact token syntax.idp'scode_generation.languagesexpects — for every generator this binary was compiled with. Mirrorscompletions's existing stdout-payload precedent (everything else goes throughui::*to stderr). Ignores--path; reflects the build, not a project.generate --list-targetsflag:generate::runcallsensure_projectas its first line and the rest assumes a real project, which this data has nothing to do with.comline-vscode.idpcompletion/hover work forcode_generation.languages, so the extension can show the real set of targets instead of guessing.Second commit, discovered while implementing: bumps all four of this crate's
comline-core/comline-codegen/comline-codegen-rust/comline-codegen-typescriptpins. This crate was the one left behind in an otherwise-already-completecomline-core@91b3c1acascade acrossgeneration/comline-rust/comline-typescript— a pre-existing gap, not introduced by this PR, but a hard prerequisite for it (the oldcomline-codegenpin predatesRegistry::targets()entirely). Required two small upstream rev bumps too, both merged: ComlineProject/comline-rust#14, ComlineProject/comline-typescript#12.Test plan
cargo build/cargo test— 46/46 pass, including 2 new cases fortargetscomline targetsprintsrust#1.70.0,ts#5.0,typescript#5.0with the default feature set;comline targets | head -1exits cleanly (SIGPIPE handling)