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!orlength_constraint!takes attributes and a visibility. - The constraint checkers moved from
confval::pipelinetoconfval::constraints.
Added
textDocument/renameandtextDocument/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!andlength_constraint!take attributes and a visibility before the name, as inrange_constraint!(#[doc = "The port."] pub PORT, i64, min: 1, max: 65535). A call keeps compiling unless it uses the removedhelp: Noneform or declares amin:above itsmax:.range_constraint!andlength_constraint!reject amin:abovemax:at compile time.
Changed
- The six constraint modules moved from
confval::pipelineto a newconfval::constraintsmodule.confval::pipelinekeeps theLower,Validate,narrow, andcheck_referencesstages.
Removed
- The
confval::pipeline::{format, keyword, length, non_empty, range, unique}module paths and their re-exports. The item-level re-exportsconfval::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 underconfval::constraints. - The
length_constraint!(NAME, min: 1, max: 2, help: None)form. Omithelp: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"] }