From 1980bd5992b228021dfd5935a2506a2318836ec2 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 15 Aug 2024 17:46:59 -0400 Subject: [PATCH] helix-lsp-types: Prefer `crate::Url` to `url::Url` This is a cosmetic change to replace all direct `use`s of the `url::Url` type in the `helix-lsp-types` crate with `use crate::Url;`. The types are the same type currently: this refactor will make a future replacement of the Url type less noisy. Connects https://github.com/helix-editor/helix/pull/11889 --- helix-lsp-types/src/call_hierarchy.rs | 3 +-- helix-lsp-types/src/document_diagnostic.rs | 3 +-- helix-lsp-types/src/document_link.rs | 3 +-- helix-lsp-types/src/window.rs | 4 +--- helix-lsp-types/src/workspace_diagnostic.rs | 3 +-- helix-lsp-types/src/workspace_folders.rs | 3 +-- 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/helix-lsp-types/src/call_hierarchy.rs b/helix-lsp-types/src/call_hierarchy.rs index dea78803f..2669e08ee 100644 --- a/helix-lsp-types/src/call_hierarchy.rs +++ b/helix-lsp-types/src/call_hierarchy.rs @@ -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, Url, WorkDoneProgressOptions, WorkDoneProgressParams, }; pub type CallHierarchyClientCapabilities = DynamicRegistrationClientCapabilities; diff --git a/helix-lsp-types/src/document_diagnostic.rs b/helix-lsp-types/src/document_diagnostic.rs index a2b5c41fa..5a1c6b35a 100644 --- a/helix-lsp-types/src/document_diagnostic.rs +++ b/helix-lsp-types/src/document_diagnostic.rs @@ -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, Url, WorkDoneProgressOptions, WorkDoneProgressParams, }; /// Client capabilities specific to diagnostic pull requests. diff --git a/helix-lsp-types/src/document_link.rs b/helix-lsp-types/src/document_link.rs index 1400dd96b..dde0e2011 100644 --- a/helix-lsp-types/src/document_link.rs +++ b/helix-lsp-types/src/document_link.rs @@ -1,10 +1,9 @@ use crate::{ - PartialResultParams, Range, TextDocumentIdentifier, WorkDoneProgressOptions, + PartialResultParams, Range, TextDocumentIdentifier, Url, WorkDoneProgressOptions, WorkDoneProgressParams, }; use serde::{Deserialize, Serialize}; use serde_json::Value; -use url::Url; #[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] diff --git a/helix-lsp-types/src/window.rs b/helix-lsp-types/src/window.rs index ac45e6083..0cfffa0ce 100644 --- a/helix-lsp-types/src/window.rs +++ b/helix-lsp-types/src/window.rs @@ -4,9 +4,7 @@ use serde_json::Value; -use url::Url; - -use crate::Range; +use crate::{Range, Url}; #[derive(Eq, PartialEq, Clone, Copy, Deserialize, Serialize)] #[serde(transparent)] diff --git a/helix-lsp-types/src/workspace_diagnostic.rs b/helix-lsp-types/src/workspace_diagnostic.rs index e8a7646b0..485dcc2bb 100644 --- a/helix-lsp-types/src/workspace_diagnostic.rs +++ b/helix-lsp-types/src/workspace_diagnostic.rs @@ -1,8 +1,7 @@ use serde::{Deserialize, Serialize}; -use url::Url; use crate::{ - FullDocumentDiagnosticReport, PartialResultParams, UnchangedDocumentDiagnosticReport, + FullDocumentDiagnosticReport, PartialResultParams, UnchangedDocumentDiagnosticReport, Url, WorkDoneProgressParams, }; diff --git a/helix-lsp-types/src/workspace_folders.rs b/helix-lsp-types/src/workspace_folders.rs index aeca89ffe..2169cade0 100644 --- a/helix-lsp-types/src/workspace_folders.rs +++ b/helix-lsp-types/src/workspace_folders.rs @@ -1,7 +1,6 @@ use serde::{Deserialize, Serialize}; -use url::Url; -use crate::OneOf; +use crate::{OneOf, Url}; #[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)] #[serde(rename_all = "camelCase")]