Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace url::Url with fluent_uri::Uri<String> #266

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading
Loading