Skip to content

Commit

Permalink
Merge pull request #282 from gluon-lang/gibbz00-notebook
Browse files Browse the repository at this point in the history
feat: Add notebook support
  • Loading branch information
Marwes committed May 17, 2024
2 parents 3e6daee + bb4abf6 commit 1646d22
Show file tree
Hide file tree
Showing 14 changed files with 601 additions and 193 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bitflags = "1.0.1"
serde = { version = "1.0.34", features = ["derive"] }
serde_json = "1.0.50"
serde_repr = "0.1"
url = {version = "2.0.0", features = ["serde"]}
fluent-uri = "0.1.4"

[features]
default = []
Expand Down
5 changes: 2 additions & 3 deletions src/call_hierarchy.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use serde::{Deserialize, Serialize};
use serde_json::Value;
use url::Url;

use crate::{
DynamicRegistrationClientCapabilities, PartialResultParams, Range, SymbolKind, SymbolTag,
TextDocumentPositionParams, WorkDoneProgressOptions, WorkDoneProgressParams,
TextDocumentPositionParams, Uri, WorkDoneProgressOptions, WorkDoneProgressParams,
};

pub type CallHierarchyClientCapabilities = DynamicRegistrationClientCapabilities;
Expand Down Expand Up @@ -63,7 +62,7 @@ pub struct CallHierarchyItem {
pub detail: Option<String>,

/// The resource identifier of this item.
pub uri: Url,
pub uri: Uri,

/// The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.
pub range: Range,
Expand Down
12 changes: 4 additions & 8 deletions src/document_diagnostic.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use std::collections::HashMap;

use serde::{Deserialize, Serialize};
use url::Url;

use crate::{
Diagnostic, PartialResultParams, StaticRegistrationOptions, TextDocumentIdentifier,
TextDocumentRegistrationOptions, WorkDoneProgressOptions, WorkDoneProgressParams,
TextDocumentRegistrationOptions, Uri, WorkDoneProgressOptions, WorkDoneProgressParams,
};

/// Client capabilities specific to diagnostic pull requests.
Expand Down Expand Up @@ -158,10 +157,9 @@ pub struct RelatedFullDocumentDiagnosticReport {
/// macro definitions in a file `a.cpp` result in errors in a header file `b.hpp`.
///
/// @since 3.17.0
#[serde(with = "crate::url_map")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
pub related_documents: Option<HashMap<Url, DocumentDiagnosticReportKind>>,
pub related_documents: Option<HashMap<Uri, DocumentDiagnosticReportKind>>,
// relatedDocuments?: { [uri: string]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport; };
#[serde(flatten)]
pub full_document_diagnostic_report: FullDocumentDiagnosticReport,
Expand All @@ -180,10 +178,9 @@ pub struct RelatedUnchangedDocumentDiagnosticReport {
/// macro definitions in a file `a.cpp` result in errors in a header file `b.hpp`.
///
/// @since 3.17.0
#[serde(with = "crate::url_map")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
pub related_documents: Option<HashMap<Url, DocumentDiagnosticReportKind>>,
pub related_documents: Option<HashMap<Uri, DocumentDiagnosticReportKind>>,
// relatedDocuments?: { [uri: string]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport; };
#[serde(flatten)]
pub unchanged_document_diagnostic_report: UnchangedDocumentDiagnosticReport,
Expand Down Expand Up @@ -223,10 +220,9 @@ impl From<RelatedUnchangedDocumentDiagnosticReport> for DocumentDiagnosticReport
#[derive(Debug, PartialEq, Default, Deserialize, Serialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct DocumentDiagnosticReportPartialResult {
#[serde(with = "crate::url_map")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
pub related_documents: Option<HashMap<Url, DocumentDiagnosticReportKind>>,
pub related_documents: Option<HashMap<Uri, DocumentDiagnosticReportKind>>,
// relatedDocuments?: { [uri: string]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport; };
}

Expand Down
5 changes: 2 additions & 3 deletions src/document_link.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use crate::{
PartialResultParams, Range, TextDocumentIdentifier, WorkDoneProgressOptions,
PartialResultParams, Range, TextDocumentIdentifier, Uri, WorkDoneProgressOptions,
WorkDoneProgressParams,
};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use url::Url;

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

/// The tooltip text when you hover over this link.
///
Expand Down

0 comments on commit 1646d22

Please sign in to comment.