Skip to content

Commit 1646d22

Browse files
authored
Merge pull request #282 from gluon-lang/gibbz00-notebook
feat: Add notebook support
2 parents 3e6daee + bb4abf6 commit 1646d22

14 files changed

+601
-193
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bitflags = "1.0.1"
1919
serde = { version = "1.0.34", features = ["derive"] }
2020
serde_json = "1.0.50"
2121
serde_repr = "0.1"
22-
url = {version = "2.0.0", features = ["serde"]}
22+
fluent-uri = "0.1.4"
2323

2424
[features]
2525
default = []

src/call_hierarchy.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use serde::{Deserialize, Serialize};
22
use serde_json::Value;
3-
use url::Url;
43

54
use crate::{
65
DynamicRegistrationClientCapabilities, PartialResultParams, Range, SymbolKind, SymbolTag,
7-
TextDocumentPositionParams, WorkDoneProgressOptions, WorkDoneProgressParams,
6+
TextDocumentPositionParams, Uri, WorkDoneProgressOptions, WorkDoneProgressParams,
87
};
98

109
pub type CallHierarchyClientCapabilities = DynamicRegistrationClientCapabilities;
@@ -63,7 +62,7 @@ pub struct CallHierarchyItem {
6362
pub detail: Option<String>,
6463

6564
/// The resource identifier of this item.
66-
pub uri: Url,
65+
pub uri: Uri,
6766

6867
/// The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.
6968
pub range: Range,

src/document_diagnostic.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
use std::collections::HashMap;
22

33
use serde::{Deserialize, Serialize};
4-
use url::Url;
54

65
use crate::{
76
Diagnostic, PartialResultParams, StaticRegistrationOptions, TextDocumentIdentifier,
8-
TextDocumentRegistrationOptions, WorkDoneProgressOptions, WorkDoneProgressParams,
7+
TextDocumentRegistrationOptions, Uri, WorkDoneProgressOptions, WorkDoneProgressParams,
98
};
109

1110
/// Client capabilities specific to diagnostic pull requests.
@@ -158,10 +157,9 @@ pub struct RelatedFullDocumentDiagnosticReport {
158157
/// macro definitions in a file `a.cpp` result in errors in a header file `b.hpp`.
159158
///
160159
/// @since 3.17.0
161-
#[serde(with = "crate::url_map")]
162160
#[serde(skip_serializing_if = "Option::is_none")]
163161
#[serde(default)]
164-
pub related_documents: Option<HashMap<Url, DocumentDiagnosticReportKind>>,
162+
pub related_documents: Option<HashMap<Uri, DocumentDiagnosticReportKind>>,
165163
// relatedDocuments?: { [uri: string]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport; };
166164
#[serde(flatten)]
167165
pub full_document_diagnostic_report: FullDocumentDiagnosticReport,
@@ -180,10 +178,9 @@ pub struct RelatedUnchangedDocumentDiagnosticReport {
180178
/// macro definitions in a file `a.cpp` result in errors in a header file `b.hpp`.
181179
///
182180
/// @since 3.17.0
183-
#[serde(with = "crate::url_map")]
184181
#[serde(skip_serializing_if = "Option::is_none")]
185182
#[serde(default)]
186-
pub related_documents: Option<HashMap<Url, DocumentDiagnosticReportKind>>,
183+
pub related_documents: Option<HashMap<Uri, DocumentDiagnosticReportKind>>,
187184
// relatedDocuments?: { [uri: string]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport; };
188185
#[serde(flatten)]
189186
pub unchanged_document_diagnostic_report: UnchangedDocumentDiagnosticReport,
@@ -223,10 +220,9 @@ impl From<RelatedUnchangedDocumentDiagnosticReport> for DocumentDiagnosticReport
223220
#[derive(Debug, PartialEq, Default, Deserialize, Serialize, Clone)]
224221
#[serde(rename_all = "camelCase")]
225222
pub struct DocumentDiagnosticReportPartialResult {
226-
#[serde(with = "crate::url_map")]
227223
#[serde(skip_serializing_if = "Option::is_none")]
228224
#[serde(default)]
229-
pub related_documents: Option<HashMap<Url, DocumentDiagnosticReportKind>>,
225+
pub related_documents: Option<HashMap<Uri, DocumentDiagnosticReportKind>>,
230226
// relatedDocuments?: { [uri: string]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport; };
231227
}
232228

src/document_link.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use crate::{
2-
PartialResultParams, Range, TextDocumentIdentifier, WorkDoneProgressOptions,
2+
PartialResultParams, Range, TextDocumentIdentifier, Uri, WorkDoneProgressOptions,
33
WorkDoneProgressParams,
44
};
55
use serde::{Deserialize, Serialize};
66
use serde_json::Value;
7-
use url::Url;
87

98
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
109
#[serde(rename_all = "camelCase")]
@@ -50,7 +49,7 @@ pub struct DocumentLink {
5049
pub range: Range,
5150
/// The uri this link points to.
5251
#[serde(skip_serializing_if = "Option::is_none")]
53-
pub target: Option<Url>,
52+
pub target: Option<Uri>,
5453

5554
/// The tooltip text when you hover over this link.
5655
///

0 commit comments

Comments
 (0)