Skip to content

Commit 8827bf2

Browse files
style(Common): Add blank lines between variable declarations in LanguageFeature and Telemetry modules
Insert empty lines between consecutive `let` bindings in the closure captures across 8 LanguageFeature provider files (ProvideCodeActions, ProvideDocumentFormatting, ProvideInlayHints, ProvideOnTypeFormatting, ProvideReferences, ProvideRenameEdits, ProvideSelectionRanges, ProvideSignatureHelp) to improve visual separation of cloned parameters. Apply the same formatting to the `TraceId` initialization and `Fn` telemetry function in EmitOTLPSpan.rs, adding blank lines between hashing operations, socket connection steps, and HTTP write/read sequences. Also add a blank line before the second biome-ignore comment in TypeScript/Interface/Get.ts. No functional changes — purely stylistic formatting for better code readability.
1 parent 9b7f056 commit 8827bf2

10 files changed

Lines changed: 24 additions & 0 deletions

Source/LanguageFeature/ProvideCodeActions.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ pub fn ProvideCodeActions(
2121
) -> ActionEffect<Arc<dyn LanguageFeatureProviderRegistry>, CommonError, Option<Value>> {
2222
ActionEffect::New(Arc::new(move |Registry:Arc<dyn LanguageFeatureProviderRegistry>| {
2323
let DocumentURIClone = DocumentURI.clone();
24+
2425
let RangeOrSelectionDTOClone = RangeOrSelectionDTO.clone();
26+
2527
let ContextDTOClone = ContextDTO.clone();
2628

2729
Box::pin(async move {

Source/LanguageFeature/ProvideDocumentFormatting.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub fn ProvideDocumentFormatting(
2020
) -> ActionEffect<Arc<dyn LanguageFeatureProviderRegistry>, CommonError, Option<Vec<TextEditDTO>>> {
2121
ActionEffect::New(Arc::new(move |Registry:Arc<dyn LanguageFeatureProviderRegistry>| {
2222
let DocumentURIClone = DocumentURI.clone();
23+
2324
let OptionsDTOClone = OptionsDTO.clone();
2425

2526
Box::pin(async move { Registry.ProvideDocumentFormattingEdits(DocumentURIClone, OptionsDTOClone).await })

Source/LanguageFeature/ProvideInlayHints.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub fn ProvideInlayHints(
1919
) -> ActionEffect<Arc<dyn LanguageFeatureProviderRegistry>, CommonError, Option<Value>> {
2020
ActionEffect::New(Arc::new(move |Registry:Arc<dyn LanguageFeatureProviderRegistry>| {
2121
let DocumentURIClone = DocumentURI.clone();
22+
2223
let RangeDTOClone = RangeDTO.clone();
2324

2425
Box::pin(async move { Registry.ProvideInlayHints(DocumentURIClone, RangeDTOClone).await })

Source/LanguageFeature/ProvideOnTypeFormatting.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ pub fn ProvideOnTypeFormatting(
2727
) -> ActionEffect<Arc<dyn LanguageFeatureProviderRegistry>, CommonError, Option<Vec<TextEditDTO>>> {
2828
ActionEffect::New(Arc::new(move |Registry:Arc<dyn LanguageFeatureProviderRegistry>| {
2929
let DocumentURIClone = DocumentURI.clone();
30+
3031
let CharacterClone = Character.clone();
32+
3133
let OptionsDTOClone = OptionsDTO.clone();
3234

3335
Box::pin(async move {

Source/LanguageFeature/ProvideReferences.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub fn ProvideReferences(
2424
) -> ActionEffect<Arc<dyn LanguageFeatureProviderRegistry>, CommonError, Option<Vec<LocationDTO>>> {
2525
ActionEffect::New(Arc::new(move |Registry:Arc<dyn LanguageFeatureProviderRegistry>| {
2626
let DocumentURIClone = DocumentURI.clone();
27+
2728
let ContextDTOClone = ContextDTO.clone();
2829

2930
Box::pin(async move { Registry.ProvideReferences(DocumentURIClone, PositionDTO, ContextDTOClone).await })

Source/LanguageFeature/ProvideRenameEdits.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub fn ProvideRenameEdits(
2121
) -> ActionEffect<Arc<dyn LanguageFeatureProviderRegistry>, CommonError, Option<Value>> {
2222
ActionEffect::New(Arc::new(move |Registry:Arc<dyn LanguageFeatureProviderRegistry>| {
2323
let DocumentURIClone = DocumentURI.clone();
24+
2425
let NewNameClone = NewName.clone();
2526

2627
Box::pin(async move { Registry.ProvideRenameEdits(DocumentURIClone, PositionDTO, NewNameClone).await })

Source/LanguageFeature/ProvideSelectionRanges.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub fn ProvideSelectionRanges(
1919
) -> ActionEffect<Arc<dyn LanguageFeatureProviderRegistry>, CommonError, Option<Value>> {
2020
ActionEffect::New(Arc::new(move |Registry:Arc<dyn LanguageFeatureProviderRegistry>| {
2121
let DocumentURIClone = DocumentURI.clone();
22+
2223
let PositionsClone = Positions.clone();
2324

2425
Box::pin(async move { Registry.ProvideSelectionRanges(DocumentURIClone, PositionsClone).await })

Source/LanguageFeature/ProvideSignatureHelp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub fn ProvideSignatureHelp(
2121
) -> ActionEffect<Arc<dyn LanguageFeatureProviderRegistry>, CommonError, Option<Value>> {
2222
ActionEffect::New(Arc::new(move |Registry:Arc<dyn LanguageFeatureProviderRegistry>| {
2323
let DocumentURIClone = DocumentURI.clone();
24+
2425
let ContextDTOClone = ContextDTO.clone();
2526

2627
Box::pin(async move {

Source/Telemetry/EmitOTLPSpan.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ fn NowNano() -> u64 {
3030
fn TraceId() -> &'static str {
3131
OTLP_TRACE_ID.get_or_init(|| {
3232
let mut H = DefaultHasher::new();
33+
3334
std::process::id().hash(&mut H);
35+
3436
NowNano().hash(&mut H);
37+
3538
format!("{:032x}", H.finish() as u128)
3639
})
3740
}
@@ -135,13 +138,18 @@ pub fn Fn(Name:&str, StartNano:u64, EndNano:u64, Attributes:&[(&str, &str)]) {
135138

136139
let Ok(SocketAddress) = HostAddress.parse() else {
137140
OTLP_AVAILABLE.store(false, Ordering::Relaxed);
141+
138142
return;
139143
};
144+
140145
let Ok(mut Stream) = TcpStream::connect_timeout(&SocketAddress, Duration::from_millis(200)) else {
141146
OTLP_AVAILABLE.store(false, Ordering::Relaxed);
147+
142148
return;
143149
};
150+
144151
let _ = Stream.set_write_timeout(Some(Duration::from_millis(200)));
152+
145153
let _ = Stream.set_read_timeout(Some(Duration::from_millis(200)));
146154

147155
let HttpReq = format!(
@@ -151,14 +159,19 @@ pub fn Fn(Name:&str, StartNano:u64, EndNano:u64, Attributes:&[(&str, &str)]) {
151159
HostAddress,
152160
Payload.len()
153161
);
162+
154163
if Stream.write_all(HttpReq.as_bytes()).is_err() {
155164
return;
156165
}
166+
157167
if Stream.write_all(Payload.as_bytes()).is_err() {
158168
return;
159169
}
170+
160171
let mut Buf = [0u8; 32];
172+
161173
let _ = Stream.read(&mut Buf);
174+
162175
if !(Buf.starts_with(b"HTTP/1.1 2") || Buf.starts_with(b"HTTP/1.0 2")) {
163176
OTLP_AVAILABLE.store(false, Ordering::Relaxed);
164177
}

TypeScript/Interface/Get.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default interface Interface {
1313
(Instance: {
1414
// biome-ignore lint/suspicious/noExplicitAny:
1515
[key: string]: any;
16+
1617
// biome-ignore lint/suspicious/noExplicitAny:
1718
}): Promise<Map<any, any>>;
1819
}

0 commit comments

Comments
 (0)