mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-06 18:30:35 +00:00
refactor: Fix imports, remove unused code, and resolve warnings
This commit is contained in:
parent
adf7d1876e
commit
969d267e4c
3 changed files with 3 additions and 23 deletions
|
@ -2,11 +2,12 @@ use anyhow::{anyhow, Result};
|
|||
use djls_project::TemplateTags;
|
||||
use std::collections::HashMap;
|
||||
use tower_lsp::lsp_types::{
|
||||
DidOpenTextDocumentParams, DidChangeTextDocumentParams, DidCloseTextDocumentParams,
|
||||
CompletionItem, CompletionItemKind, CompletionResponse, Documentation, InsertTextFormat,
|
||||
MarkupContent, MarkupKind, Position, Range, Url,
|
||||
};
|
||||
use tower_lsp::Client;
|
||||
use super::diagnostics::Diagnostics;
|
||||
use crate::diagnostics::Diagnostics;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Store {
|
||||
|
|
|
@ -262,17 +262,8 @@ pub enum LexerError {
|
|||
#[error("source is empty")]
|
||||
EmptySource,
|
||||
|
||||
#[error("at beginning of source")]
|
||||
AtBeginningOfSource,
|
||||
|
||||
#[error("at end of source")]
|
||||
AtEndOfSource,
|
||||
|
||||
#[error("invalid character access")]
|
||||
InvalidCharacterAccess,
|
||||
|
||||
#[error("unexpected token type '{0:?}'")]
|
||||
UnexpectedTokenType(TokenType),
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -152,19 +152,7 @@ pub struct ArgSpec {
|
|||
pub is_kwarg: bool,
|
||||
}
|
||||
|
||||
impl ArgSpec {
|
||||
pub fn is_placeholder(arg: &str) -> bool {
|
||||
arg.starts_with('{') && arg.ends_with('}')
|
||||
}
|
||||
|
||||
pub fn get_placeholder_name(arg: &str) -> Option<&str> {
|
||||
if Self::is_placeholder(arg) {
|
||||
Some(&arg[1..arg.len() - 1])
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
impl ArgSpec {}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue