@@ -50,7 +50,8 @@ impl Default for VSCodeAPI {
5050pub struct Commands ;
5151
5252impl Commands {
53- pub fn new ( ) -> Self { Self }
53+ /// Create a new Commands instance
54+ pub fn new ( ) -> Self { Self }
5455
5556 /// Register a command
5657 pub fn register_command ( & self , command_id : String , callback : CommandCallback ) -> Result < Command , String > {
@@ -74,15 +75,17 @@ pub type CommandCallback = Box<dyn Fn(Vec<serde_json::Value>) -> Result<serde_js
7475/// Command representation
7576#[ derive( Debug , Clone ) ]
7677pub struct Command {
77- pub id : String ,
78+ /// The unique identifier of the command
79+ pub id : String ,
7880}
7981
8082/// Window namespace
8183#[ derive( Debug , Clone ) ]
8284pub struct Window ;
8385
8486impl Window {
85- pub fn new ( ) -> Self { Self }
87+ /// Create a new Window instance
88+ pub fn new ( ) -> Self { Self }
8689
8790 /// Show an information message
8891 pub async fn show_information_message ( & self , message : String ) -> Result < String , String > {
@@ -109,11 +112,17 @@ impl Window {
109112/// Output channel for logging
110113#[ derive( Debug , Clone ) ]
111114pub struct OutputChannel {
112- name : String ,
115+ /// The name of the output channel
116+ name : String ,
113117}
114118
115119impl OutputChannel {
116- pub fn new ( name : String ) -> Self { Self { name } }
120+ /// Create a new output channel
121+ ///
122+ /// # Arguments
123+ ///
124+ /// * `name` - The name of the output channel
125+ pub fn new ( name : String ) -> Self { Self { name } }
117126
118127 /// Append a line to the channel
119128 pub fn append_line ( & self , line : & str ) {
@@ -146,7 +155,8 @@ impl OutputChannel {
146155pub struct Workspace ;
147156
148157impl Workspace {
149- pub fn new ( ) -> Self { Self }
158+ /// Create a new Workspace instance
159+ pub fn new ( ) -> Self { Self }
150160
151161 /// Get workspace folders
152162 pub fn workspace_folders ( & self ) -> Vec < WorkspaceFolder > {
@@ -176,11 +186,17 @@ pub struct WorkspaceFolder {
176186/// Workspace configuration
177187#[ derive( Debug , Clone ) ]
178188pub struct WorkspaceConfiguration {
179- section : Option < String > ,
189+ /// The configuration section name
190+ section : Option < String > ,
180191}
181192
182193impl WorkspaceConfiguration {
183- pub fn new ( section : Option < String > ) -> Self { Self { section } }
194+ /// Create a new workspace configuration
195+ ///
196+ /// # Arguments
197+ ///
198+ /// * `section` - Optional section name to retrieve
199+ pub fn new ( section : Option < String > ) -> Self { Self { section } }
184200
185201 /// Get a configuration value
186202 pub fn get < T : serde:: de:: DeserializeOwned > ( & self , key : String ) -> Result < T , String > {
@@ -203,7 +219,8 @@ impl WorkspaceConfiguration {
203219pub struct Languages ;
204220
205221impl Languages {
206- pub fn new ( ) -> Self { Self }
222+ /// Create a new Languages instance
223+ pub fn new ( ) -> Self { Self }
207224
208225 /// Register completion item provider
209226 pub async fn register_completion_item_provider < T : CompletionItemProvider > (
@@ -239,13 +256,25 @@ pub type DocumentSelector = Vec<DocumentFilter>;
239256
240257/// Completion item provider
241258pub trait CompletionItemProvider : Send + Sync {
242- fn provide_completion_items (
243- & self ,
244- document : TextDocumentIdentifier ,
245- position : Position ,
246- context : CompletionContext ,
247- token : Option < String > ,
248- ) -> Vec < CompletionItem > ;
259+ /// Provide completion items at the given position
260+ ///
261+ /// # Arguments
262+ ///
263+ /// * `document` - The text document identifier
264+ /// * `position` - The position in the document
265+ /// * `context` - The completion context
266+ /// * `token` - Optional cancellation token
267+ ///
268+ /// # Returns
269+ ///
270+ /// A vector of completion items
271+ fn provide_completion_items (
272+ & self ,
273+ document : TextDocumentIdentifier ,
274+ position : Position ,
275+ context : CompletionContext ,
276+ token : Option < String > ,
277+ ) -> Vec < CompletionItem > ;
249278}
250279
251280/// Completion context
@@ -279,11 +308,17 @@ pub enum CompletionTriggerKind {
279308/// Diagnostic collection
280309#[ derive( Debug , Clone ) ]
281310pub struct DiagnosticCollection {
282- name : Option < String > ,
311+ /// The name of the diagnostic collection
312+ name : Option < String > ,
283313}
284314
285315impl DiagnosticCollection {
286- pub fn new ( name : Option < String > ) -> Self { Self { name } }
316+ /// Create a new diagnostic collection
317+ ///
318+ /// # Arguments
319+ ///
320+ /// * `name` - Optional name for the collection
321+ pub fn new ( name : Option < String > ) -> Self { Self { name } }
287322
288323 /// Set diagnostics for a resource
289324 pub fn set ( & self , uri : String , diagnostics : Vec < Diagnostic > ) {
@@ -311,19 +346,22 @@ impl DiagnosticCollection {
311346pub struct Disposable ;
312347
313348impl Disposable {
314- pub fn new ( ) -> Self { Self }
349+ /// Create a new disposable item
350+ pub fn new ( ) -> Self { Self }
315351
316- pub fn dispose ( & self ) {
317- // Placeholder implementation
318- }
352+ /// Dispose the resource
353+ pub fn dispose ( & self ) {
354+ // Placeholder implementation
355+ }
319356}
320357
321358/// Extensions namespace
322359#[ derive( Debug , Clone ) ]
323360pub struct Extensions ;
324361
325362impl Extensions {
326- pub fn new ( ) -> Self { Self }
363+ /// Create a new Extensions instance
364+ pub fn new ( ) -> Self { Self }
327365
328366 /// Get all extensions
329367 pub fn all ( & self ) -> Vec < Extension > { Vec :: new ( ) }
@@ -355,7 +393,8 @@ pub struct Extension {
355393pub struct Env ;
356394
357395impl Env {
358- pub fn new ( ) -> Self { Self }
396+ /// Create a new Env instance
397+ pub fn new ( ) -> Self { Self }
359398
360399 /// Get environment variable
361400 pub fn get_env_var ( & self , name : String ) -> Option < String > { std:: env:: var ( name) . ok ( ) }
0 commit comments