mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-08 03:10:34 +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 djls_project::TemplateTags;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use tower_lsp::lsp_types::{
|
use tower_lsp::lsp_types::{
|
||||||
|
DidOpenTextDocumentParams, DidChangeTextDocumentParams, DidCloseTextDocumentParams,
|
||||||
CompletionItem, CompletionItemKind, CompletionResponse, Documentation, InsertTextFormat,
|
CompletionItem, CompletionItemKind, CompletionResponse, Documentation, InsertTextFormat,
|
||||||
MarkupContent, MarkupKind, Position, Range, Url,
|
MarkupContent, MarkupKind, Position, Range, Url,
|
||||||
};
|
};
|
||||||
use tower_lsp::Client;
|
use tower_lsp::Client;
|
||||||
use super::diagnostics::Diagnostics;
|
use crate::diagnostics::Diagnostics;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Store {
|
pub struct Store {
|
||||||
|
|
|
@ -262,17 +262,8 @@ pub enum LexerError {
|
||||||
#[error("source is empty")]
|
#[error("source is empty")]
|
||||||
EmptySource,
|
EmptySource,
|
||||||
|
|
||||||
#[error("at beginning of source")]
|
|
||||||
AtBeginningOfSource,
|
|
||||||
|
|
||||||
#[error("at end of source")]
|
#[error("at end of source")]
|
||||||
AtEndOfSource,
|
AtEndOfSource,
|
||||||
|
|
||||||
#[error("invalid character access")]
|
|
||||||
InvalidCharacterAccess,
|
|
||||||
|
|
||||||
#[error("unexpected token type '{0:?}'")]
|
|
||||||
UnexpectedTokenType(TokenType),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
|
@ -152,19 +152,7 @@ pub struct ArgSpec {
|
||||||
pub is_kwarg: bool,
|
pub is_kwarg: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ArgSpec {
|
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue