Mountain/ApplicationState/DTO/
ExtensionDescriptionStateDTO.rs

1//! # ExtensionDescriptionStateDTO
2//!
3//! Defines the Data Transfer Object for storing the state of a single scanned
4//! extension, based on its `package.json` manifest.
5
6#![allow(non_snake_case, non_camel_case_types)]
7
8use serde::{Deserialize, Serialize};
9use serde_json::Value;
10
11/// Represents the deserialized content of an extension's `package.json` file,
12/// augmented with location information and other metadata.
13///
14/// This is stored in `ApplicationState` to provide the extension host with the
15/// list of available extensions and their capabilities.
16#[derive(Serialize, Deserialize, Clone, Debug)]
17#[serde(rename_all = "PascalCase")]
18pub struct ExtensionDescriptionStateDTO {
19	// --- Core Metadata ---
20	// DTO: { value: string, uuid?: string }
21	pub Identifier:Value,
22
23	pub Name:String,
24
25	pub Version:String,
26
27	pub Publisher:String,
28
29	// DTO: { vscode: string }
30	pub Engines:Value,
31
32	// --- Entry Points ---
33	#[serde(skip_serializing_if = "Option::is_none")]
34	pub Main:Option<String>,
35
36	#[serde(skip_serializing_if = "Option::is_none")]
37	pub Browser:Option<String>,
38
39	// --- Type & Flags ---
40	#[serde(rename = "Type", skip_serializing_if = "Option::is_none")]
41	pub ModuleType:Option<String>,
42
43	#[serde(default)]
44	pub IsBuiltin:bool,
45
46	#[serde(default)]
47	pub IsUnderDevelopment:bool,
48
49	// --- Location & Activation ---
50	// Serialized UriComponents DTO
51	pub ExtensionLocation:Value,
52
53	#[serde(skip_serializing_if = "Option::is_none")]
54	pub ActivationEvents:Option<Vec<String>>,
55
56	// --- Contributions ---
57	#[serde(skip_serializing_if = "Option::is_none")]
58	pub Contributes:Option<Value>,
59}