Skip to content

feat: add comline targets to print compiled-in generator targets - #32

Merged
Kinflou merged 2 commits into
mainfrom
feature/targets-subcommand
Oct 2, 2026
Merged

Kinflou merged 2 commits into
mainfrom
feature/targets-subcommand

Conversation

@Kinflou

@Kinflou Kinflou commented Oct 2, 2026

Copy link
Copy Markdown
Member

Summary

  • New comline targets subcommand: prints one language#version per line to stdout — the exact token syntax .idp's code_generation.languages expects — for every generator this binary was compiled with. Mirrors completions's existing stdout-payload precedent (everything else goes through ui::* to stderr). Ignores --path; reflects the build, not a project.
  • A standalone subcommand rather than a generate --list-targets flag: generate::run calls ensure_project as its first line and the rest assumes a real project, which this data has nothing to do with.
  • 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.

Second commit, discovered while implementing: bumps all four of this crate's comline-core/comline-codegen/comline-codegen-rust/comline-codegen-typescript pins. This crate was the one left behind in an otherwise-already-complete comline-core@91b3c1a cascade across generation/comline-rust/comline-typescript — a pre-existing gap, not introduced by this PR, but a hard prerequisite for it (the old comline-codegen pin predates Registry::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 for targets
  • Manually verified comline targets prints rust#1.70.0, ts#5.0, typescript#5.0 with the default feature set; comline targets | head -1 exits cleanly (SIGPIPE handling)

Kinflou 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.
@Kinflou
Kinflou merged commit ad56d07 into main Oct 2, 2026
2 checks passed
@Kinflou
Kinflou deleted the feature/targets-subcommand branch October 2, 2026 03:29
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