Skip to content

Editions: config.idp's edition, deprecated words, and core's fixes as quick fixes - #101

Merged
Kinflou merged 2 commits into
masterfrom
feat/editions
Nov 9, 2026
Merged

Kinflou merged 2 commits into
masterfrom
feat/editions

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 9, 2026

Copy link
Copy Markdown
Member

Language-server half of language editions (core#217).

  • Core fixes become quick fixes, for any diagnostic. Converting a core Diagnostic now keeps its Fix in the LSP diagnostic's data (under fix, as LSP TextEdits already in UTF-16 positions); code_actions::fix_actions offers each back as a preferred quickfix. Wired for schemas and config.idp, and into the existing validation and parse conversions, so a core diagnostic that gains a fix later gets one in the editor with no LS change. (src/analysis/diagnostics.rs with_fix/from_core, src/handlers/code_actions.rs fix_actions, src/backend.rs.)
  • config.idp. edition::check_config runs on an open manifest: a missing specification_version is an error on the congregation line with "Add specification_version = 1"; an unknown one is an error at the number with "Use edition 1". The build's own message for an unknown edition is suppressed when this one is shown, so it isn't said twice.
  • Schemas. Project reads the package's edition from its config.idp (ProjectContext::edition, newest when there's none). Each of the package's own schemas gets edition::deprecations for it: deprecated words as warnings tagged DEPRECATED, removed ones as errors, with their fixes. Dependencies' schemas are skipped.
  • Completions. Keyword and primitive-type items that vocabulary::deprecation knows are tagged DEPRECATED, with the note in their detail.

vocabulary::DEPRECATIONS is empty today, so the tests use a synthetic table (as core's do) through edition_diagnostics(source, edition, table) and mark_deprecated_words(items, lookup), plus round trips that apply the quick fix and check the result.

Pins: core b933209 (core#217), generation bb89a51, comline-rust de0b8e5, comline-typescript 9952c5a. Don't merge before core#217.

Refs ComlineProject/core#102

Kinflou added 2 commits November 9, 2026 11:45
… quick fixes

A config.idp without a specification_version, or with one this core
doesn't know, is an error at its span (core#102). A schema's uses of
words its package's edition deprecates are struck-through warnings, and
removed words errors. Completions mark deprecated keywords and primitive
types.

Any core diagnostic's Fix now travels in the LSP diagnostic's data, and
textDocument/codeAction offers it as a preferred quick fix, for schemas
and config.idp alike.
core b933209 (core#217), generation bb89a51, comline-rust de0b8e5,
comline-typescript 9952c5a: the revs the CLI uses.
@Kinflou
Kinflou merged commit 035fae9 into master Nov 9, 2026
10 checks passed
@Kinflou
Kinflou deleted the feat/editions branch November 9, 2026 04:16
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