Skip to content

Commit ca338ae

Browse files
1 parent 71359f4 commit ca338ae

14 files changed

Lines changed: 469 additions & 479 deletions

File tree

Source/API/vscode.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,23 @@ impl LanguageNamespace {
260260
pub fn register_rename_provider(&self, _selector:DocumentSelector) -> Disposable { Disposable::new() }
261261

262262
/// Register document formatting provider
263-
pub fn register_document_formatting_edit_provider(&self, _selector:DocumentSelector) -> Disposable { Disposable::new() }
263+
pub fn register_document_formatting_edit_provider(&self, _selector:DocumentSelector) -> Disposable {
264+
Disposable::new()
265+
}
264266

265267
/// Register document range formatting provider
266-
pub fn register_document_range_formatting_edit_provider(&self, _selector:DocumentSelector) -> Disposable { Disposable::new() }
268+
pub fn register_document_range_formatting_edit_provider(&self, _selector:DocumentSelector) -> Disposable {
269+
Disposable::new()
270+
}
267271

268272
/// Register on-type formatting provider
269-
pub fn register_on_type_formatting_edit_provider(&self, _selector:DocumentSelector, _trigger_characters:Vec<String>) -> Disposable { Disposable::new() }
273+
pub fn register_on_type_formatting_edit_provider(
274+
&self,
275+
_selector:DocumentSelector,
276+
_trigger_characters:Vec<String>,
277+
) -> Disposable {
278+
Disposable::new()
279+
}
270280

271281
/// Register signature help provider
272282
pub fn register_signature_help_provider(&self, _selector:DocumentSelector) -> Disposable { Disposable::new() }
@@ -281,7 +291,9 @@ impl LanguageNamespace {
281291
pub fn register_selection_range_provider(&self, _selector:DocumentSelector) -> Disposable { Disposable::new() }
282292

283293
/// Register semantic tokens provider
284-
pub fn register_document_semantic_tokens_provider(&self, _selector:DocumentSelector) -> Disposable { Disposable::new() }
294+
pub fn register_document_semantic_tokens_provider(&self, _selector:DocumentSelector) -> Disposable {
295+
Disposable::new()
296+
}
285297

286298
/// Register inlay hints provider
287299
pub fn register_inlay_hints_provider(&self, _selector:DocumentSelector) -> Disposable { Disposable::new() }

Source/Binary/Main/Entry.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,12 @@ impl Entry {
195195
"grpc" => {
196196
use crate::Transport::gRPCTransport::gRPCTransport;
197197
Ok(Transport::gRPC(
198-
gRPCTransport::New(&args.grpc_address)
199-
.context("Failed to create gRPC transport")?,
198+
gRPCTransport::New(&args.grpc_address).context("Failed to create gRPC transport")?,
200199
))
201200
},
202201
"ipc" => {
203202
use crate::Transport::IPCTransport::IPCTransport;
204-
Ok(Transport::IPC(
205-
IPCTransport::New().context("Failed to create IPC transport")?,
206-
))
203+
Ok(Transport::IPC(IPCTransport::New().context("Failed to create IPC transport")?))
207204
},
208205
"wasm" => {
209206
use crate::Transport::WASMTransport::WASMTransportImpl;

Source/Host/APIBridge.rs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ pub struct APICallResponse {
3939
/// VS Code API call representation
4040
#[allow(dead_code)]
4141
pub struct APICall {
42-
/// Extension ID
43-
extension_id:String,
44-
/// API method
45-
api_method:String,
46-
/// Arguments
47-
arguments:Vec<serde_json::Value>,
48-
/// Timestamp
49-
timestamp:u64,
42+
/// Extension ID
43+
extension_id:String,
44+
/// API method
45+
api_method:String,
46+
/// Arguments
47+
arguments:Vec<serde_json::Value>,
48+
/// Timestamp
49+
timestamp:u64,
5050
}
5151

5252
/// API method handler callback
@@ -56,30 +56,30 @@ type APIMethodHandler = fn(&str, Vec<serde_json::Value>) -> Result<serde_json::V
5656
/// Async API method handler callback
5757
#[allow(dead_code)]
5858
type AsyncAPIMethodHandler =
59-
fn(&str, Vec<serde_json::Value>) -> Box<dyn std::future::Future<Output = Result<serde_json::Value>> + Send + Unpin>;
59+
fn(&str, Vec<serde_json::Value>) -> Box<dyn std::future::Future<Output = Result<serde_json::Value>> + Send + Unpin>;
6060

6161
/// API method registration
6262
#[derive(Clone)]
6363
pub struct APIMethodInfo {
64-
/// Method name
65-
#[allow(dead_code)]
66-
name:String,
67-
/// Description
68-
#[allow(dead_code)]
69-
description:String,
70-
/// Parameters schema (JSON Schema)
71-
#[allow(dead_code)]
72-
parameters:Option<serde_json::Value>,
73-
/// Return type schema (JSON Schema)
74-
#[allow(dead_code)]
75-
returns:Option<serde_json::Value>,
76-
/// Whether this method is async
77-
#[allow(dead_code)]
78-
is_async:bool,
79-
/// Call count
80-
call_count:u64,
81-
/// Total execution time in microseconds
82-
total_time_us:u64,
64+
/// Method name
65+
#[allow(dead_code)]
66+
name:String,
67+
/// Description
68+
#[allow(dead_code)]
69+
description:String,
70+
/// Parameters schema (JSON Schema)
71+
#[allow(dead_code)]
72+
parameters:Option<serde_json::Value>,
73+
/// Return type schema (JSON Schema)
74+
#[allow(dead_code)]
75+
returns:Option<serde_json::Value>,
76+
/// Whether this method is async
77+
#[allow(dead_code)]
78+
is_async:bool,
79+
/// Call count
80+
call_count:u64,
81+
/// Total execution time in microseconds
82+
total_time_us:u64,
8383
}
8484

8585
/// VS Code API bridge for Grove
@@ -396,10 +396,10 @@ mod tests {
396396
#[tokio::test]
397397
async fn test_method_registration() {
398398
let bridge = APIBridgeImpl::new();
399-
let result: Result<()> = bridge.register_method("test.method", "Test method", None, None, false).await;
399+
let result:Result<()> = bridge.register_method("test.method", "Test method", None, None, false).await;
400400
assert!(result.is_ok());
401401

402-
let methods: Vec<APIMethodInfo> = bridge.get_methods().await;
402+
let methods:Vec<APIMethodInfo> = bridge.get_methods().await;
403403
assert!(methods.iter().any(|m| m.name == "test.method"));
404404
}
405405

Source/Host/Activation.rs

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ use serde::{Deserialize, Serialize};
1010
use tokio::sync::RwLock;
1111
use tracing::{debug, info, instrument, warn};
1212

13-
use crate::{
14-
Host::{ActivationResult, HostConfig},
15-
Host::ExtensionManager::{ExtensionManagerImpl, ExtensionState},
13+
use crate::Host::{
14+
ActivationResult,
15+
ExtensionManager::{ExtensionManagerImpl, ExtensionState},
16+
HostConfig,
1617
};
1718

1819
/// Extension activation event types
@@ -79,33 +80,33 @@ impl std::str::FromStr for ActivationEvent {
7980

8081
/// Activation engine for managing extension activation
8182
pub struct ActivationEngine {
82-
/// Extension manager
83-
extension_manager:Arc<ExtensionManagerImpl>,
84-
/// Host configuration
85-
#[allow(dead_code)]
86-
config:HostConfig,
87-
/// Event handlers mapping
88-
event_handlers:Arc<RwLock<HashMap<String, ActivationHandler>>>,
89-
/// Activation history
90-
activation_history:Arc<RwLock<Vec<ActivationRecord>>>,
83+
/// Extension manager
84+
extension_manager:Arc<ExtensionManagerImpl>,
85+
/// Host configuration
86+
#[allow(dead_code)]
87+
config:HostConfig,
88+
/// Event handlers mapping
89+
event_handlers:Arc<RwLock<HashMap<String, ActivationHandler>>>,
90+
/// Activation history
91+
activation_history:Arc<RwLock<Vec<ActivationRecord>>>,
9192
}
9293

9394
/// Activation handler for an extension
9495
#[derive(Debug, Clone)]
9596
struct ActivationHandler {
96-
/// Extension ID
97-
#[allow(dead_code)]
98-
extension_id:String,
99-
/// Activation events
100-
events:Vec<ActivationEvent>,
101-
/// Activation function path
102-
#[allow(dead_code)]
103-
activation_function:String,
104-
/// Whether extension is currently active
105-
is_active:bool,
106-
/// Last activation time
107-
#[allow(dead_code)]
108-
last_activation:Option<u64>,
97+
/// Extension ID
98+
#[allow(dead_code)]
99+
extension_id:String,
100+
/// Activation events
101+
events:Vec<ActivationEvent>,
102+
/// Activation function path
103+
#[allow(dead_code)]
104+
activation_function:String,
105+
/// Whether extension is currently active
106+
is_active:bool,
107+
/// Last activation time
108+
#[allow(dead_code)]
109+
last_activation:Option<u64>,
109110
}
110111

111112
/// Activation record for tracking

Source/Host/ExtensionHost.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@ use tokio::sync::RwLock;
1111
use tracing::{error, info, instrument, warn};
1212

1313
use crate::{
14-
Host::{Activation, HostConfig},
15-
Host::ExtensionManager::ExtensionManagerImpl,
14+
Host::{Activation, ExtensionManager::ExtensionManagerImpl, HostConfig},
1615
Transport::Strategy::Transport,
1716
WASM::Runtime::{WASMConfig, WASMRuntime},
1817
};
1918

2019
/// Main extension host controller
2120
pub struct ExtensionHostImpl {
22-
/// Host configuration
23-
#[allow(dead_code)]
24-
config:HostConfig,
21+
/// Host configuration
22+
#[allow(dead_code)]
23+
config:HostConfig,
2524
/// Transport for communication
2625
transport:Transport,
2726
/// Extension manager

Source/Host/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ pub mod Lifecycle;
4040
// Re-exports for convenience - use module prefix to avoid E0255 conflicts
4141
pub use Activation::{ActivationEngine, ActivationEvent};
4242
pub use Lifecycle::{LifecycleEvent, LifecycleManager};
43-
// Note: ExtensionHost, ExtensionManager, APIBridge must be accessed via module prefix
43+
// Note: ExtensionHost, ExtensionManager, APIBridge must be accessed via module
44+
// prefix
4445

4546
/// Host configuration
4647
#[derive(Debug, Clone)]

0 commit comments

Comments
 (0)