From 1181349c22b4e95fa70c891402382cc730af8ce3 Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Mon, 30 Dec 2024 23:02:57 +0100 Subject: [PATCH] Promote note about `internal_span` to doccomment (#14703) Following #14700 we should make sure more folks are aware that you shouldn't use `internal_span` outside of `Value` or core protocol/engine internals. By making it a doccomment maybe a few folks see the text in the lsp hover etc. --- crates/nu-protocol/src/value/mod.rs | 68 ++++++++++++++--------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/crates/nu-protocol/src/value/mod.rs b/crates/nu-protocol/src/value/mod.rs index ac663f4c49..73e6dd4f7a 100644 --- a/crates/nu-protocol/src/value/mod.rs +++ b/crates/nu-protocol/src/value/mod.rs @@ -48,120 +48,120 @@ use std::{ pub enum Value { Bool { val: bool, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Int { val: i64, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Float { val: f64, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, String { val: String, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Glob { val: String, no_expand: bool, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Filesize { val: Filesize, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Duration { val: i64, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Date { val: DateTime, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Range { val: Box, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Record { val: SharedCow, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, List { vals: Vec, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Closure { val: Box, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Error { error: Box, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Binary { val: Vec, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, CellPath { val: CellPath, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Custom { val: Box, - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, }, Nothing { - // note: spans are being refactored out of Value - // please use .span() instead of matching this span value + /// note: spans are being refactored out of Value + /// please use .span() instead of matching this span value #[serde(rename = "span")] internal_span: Span, },