Skip to content

Commit

Permalink
fix: some diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
Feel-ix-343 committed Feb 26, 2024
1 parent 16a62ae commit 54e2f69
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 25 deletions.
1 change: 0 additions & 1 deletion src/codeactions.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
26 changes: 3 additions & 23 deletions src/completion.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{hash::{DefaultHasher, Hash, Hasher}, path::{PathBuf, Path}};
use std::path::{PathBuf, Path};


use itertools::Itertools;
Expand All @@ -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,
Expand Down Expand Up @@ -282,26 +282,6 @@ pub fn get_completions(vault: &Vault, initial_completion_files: &[PathBuf], para
}
}

fn calculate_hash<T: Hash>(t: &T) -> u64 {
let mut s = DefaultHasher::new();
t.hash(&mut s);
s.finish()
}

fn get_links(vault: &Vault) -> Option<Vec<Referenceable>> {
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<Range>) -> Option<CompletionItem> {
let refname = referenceable.get_refname(&vault.root_dir())?;
Expand Down
2 changes: 1 addition & 1 deletion src/tokens.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down

0 comments on commit 54e2f69

Please sign in to comment.