Skip to main content

confval v0.11.0

The language server gains rename, document highlight, and folding. The two constraint macros take attributes and a visibility. The six constraint modules moved from pipeline to constraints.

Highlights

  • Rename changes a label and every reference that resolves to it in one edit.
  • A constraint declared with range_constraint! or length_constraint! takes attributes and a visibility.
  • The constraint checkers moved from confval::pipeline to confval::constraints.

Added

  • textDocument/rename and textDocument/prepareRename. Rename refuses a name that would break the value and answers the reason. A name with a quote, a backslash, a control character, ${, or %{ is refused everywhere. A rename onto a name the scope already declares is refused.
  • textDocument/documentHighlight.
  • textDocument/foldingRange. A block, a list, or a map written across more than one line folds.
  • The public handler functions confval_lsp::handlers::{folding_ranges, document_highlight, prepare_rename, rename}, for an embedder that calls the handlers directly.
  • range_constraint! and length_constraint! take attributes and a visibility before the name, as in range_constraint!(#[doc = "The port."] pub PORT, i64, min: 1, max: 65535). A call keeps compiling unless it uses the removed help: None form or declares a min: above its max:.
  • range_constraint! and length_constraint! reject a min: above max: at compile time.

Changed

  • The six constraint modules moved from confval::pipeline to a new confval::constraints module. confval::pipeline keeps the Lower, Validate, narrow, and check_references stages.

Removed

  • The confval::pipeline::{format, keyword, length, non_empty, range, unique} module paths and their re-exports. The item-level re-exports confval::pipeline::{check_format, check_each_format, format_constraint, NON_EMPTY, NonEmptyConstraint, UNIQUE, UniqueConstraint} moved with them. Every module and every item is at the same name under confval::constraints.
  • The length_constraint!(NAME, min: 1, max: 2, help: None) form. Omit help: for a bound with no help line.

Upgrading

If your crate imports a constraint through confval::pipeline::, change the path to confval::constraints::. A crate that uses the prelude or the crate root does not need a change.

[dependencies]
confval = { version = "0.11", features = ["derive", "hcl", "color"] }