diff --git a/src/codeactions.rs b/src/codeactions.rs index 774c7110..8973dd8a 100644 --- a/src/codeactions.rs +++ b/src/codeactions.rs @@ -1,7 +1,6 @@ use std::path::{Path, PathBuf}; use pathdiff::diff_paths; -use rayon::iter::*; use tower_lsp::lsp_types::{ CodeAction, CodeActionOrCommand, CodeActionParams, CreateFile, DocumentChangeOperation, DocumentChanges, ResourceOp, Url, WorkspaceEdit, CreateFileOptions, TextDocumentEdit, OptionalVersionedTextDocumentIdentifier, OneOf, TextEdit, Range, Position, diff --git a/src/completion.rs b/src/completion.rs index f0e62fb7..aa307f05 100644 --- a/src/completion.rs +++ b/src/completion.rs @@ -1,4 +1,4 @@ -use std::{hash::{DefaultHasher, Hash, Hasher}, path::{PathBuf, Path}}; +use std::path::{PathBuf, Path}; use itertools::Itertools; @@ -8,10 +8,10 @@ use nanoid::nanoid; use nucleo_matcher::{pattern::{Normalization, self, Matchable}, Matcher}; use rayon::prelude::*; -use tower_lsp::{lsp_types::{ +use tower_lsp::lsp_types::{ CompletionItem, CompletionItemKind, CompletionItemLabelDetails, CompletionParams, CompletionResponse, Documentation, CompletionTextEdit, TextEdit, Range, Position, CompletionList, Url, Command, MarkupContent, MarkupKind, -}}; +}; use crate::{ ui::preview_referenceable, @@ -282,26 +282,6 @@ pub fn get_completions(vault: &Vault, initial_completion_files: &[PathBuf], para } } -fn calculate_hash(t: &T) -> u64 { - let mut s = DefaultHasher::new(); - t.hash(&mut s); - s.finish() -} - -fn get_links(vault: &Vault) -> Option> { - let re = vault - .select_referenceable_nodes(None) - .into_iter() - .filter(|referenceable| { - !matches!(referenceable, Referenceable::Tag(_, _)) - && !matches!(referenceable, Referenceable::Footnote(_, _)) - }) - .collect_vec(); - - Some(re) -} - - fn completion_item(vault: &Vault, referenceable: &Referenceable, range: Option) -> Option { let refname = referenceable.get_refname(&vault.root_dir())?; diff --git a/src/tokens.rs b/src/tokens.rs index c894026e..6f190a61 100644 --- a/src/tokens.rs +++ b/src/tokens.rs @@ -1,7 +1,7 @@ use std::{path::Path, iter}; use itertools::Itertools; -use tower_lsp::{lsp_types::{SemanticTokensParams, SemanticTokensResult, SemanticToken}}; +use tower_lsp::lsp_types::{SemanticTokensParams, SemanticTokensResult, SemanticToken}; use crate::vault::Vault;