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.
This commit is contained in:
Stefan Holderbach 2024-12-30 23:02:57 +01:00 committed by GitHub
parent 378395c22c
commit 1181349c22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,120 +48,120 @@ use std::{
pub enum Value { pub enum Value {
Bool { Bool {
val: bool, val: bool,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Int { Int {
val: i64, val: i64,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Float { Float {
val: f64, val: f64,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
String { String {
val: String, val: String,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Glob { Glob {
val: String, val: String,
no_expand: bool, no_expand: bool,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Filesize { Filesize {
val: Filesize, val: Filesize,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Duration { Duration {
val: i64, val: i64,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Date { Date {
val: DateTime<FixedOffset>, val: DateTime<FixedOffset>,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Range { Range {
val: Box<Range>, val: Box<Range>,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Record { Record {
val: SharedCow<Record>, val: SharedCow<Record>,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
List { List {
vals: Vec<Value>, vals: Vec<Value>,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Closure { Closure {
val: Box<Closure>, val: Box<Closure>,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Error { Error {
error: Box<ShellError>, error: Box<ShellError>,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Binary { Binary {
val: Vec<u8>, val: Vec<u8>,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
CellPath { CellPath {
val: CellPath, val: CellPath,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Custom { Custom {
val: Box<dyn CustomValue>, val: Box<dyn CustomValue>,
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },
Nothing { Nothing {
// note: spans are being refactored out of Value /// note: spans are being refactored out of Value
// please use .span() instead of matching this span value /// please use .span() instead of matching this span value
#[serde(rename = "span")] #[serde(rename = "span")]
internal_span: Span, internal_span: Span,
}, },