mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-10 12:26:50 +00:00
refactor: Reorder imports and format function signatures in documents.rs
This commit is contained in:
parent
8395a02832
commit
4415d6abfe
1 changed files with 13 additions and 5 deletions
|
@ -1,13 +1,13 @@
|
||||||
|
use crate::diagnostics::Diagnostics;
|
||||||
use anyhow::{anyhow, Result};
|
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, DidChangeTextDocumentParams,
|
||||||
CompletionItem, CompletionItemKind, CompletionResponse, Documentation, InsertTextFormat,
|
DidCloseTextDocumentParams, DidOpenTextDocumentParams, Documentation, InsertTextFormat,
|
||||||
MarkupContent, MarkupKind, Position, Range, Url,
|
MarkupContent, MarkupKind, Position, Range, Url,
|
||||||
};
|
};
|
||||||
use tower_lsp::Client;
|
use tower_lsp::Client;
|
||||||
use crate::diagnostics::Diagnostics;
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Store {
|
pub struct Store {
|
||||||
|
@ -23,7 +23,11 @@ impl Store {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_did_open(&mut self, params: DidOpenTextDocumentParams, client: &Client) -> Result<()> {
|
pub fn handle_did_open(
|
||||||
|
&mut self,
|
||||||
|
params: DidOpenTextDocumentParams,
|
||||||
|
client: &Client,
|
||||||
|
) -> Result<()> {
|
||||||
let uri = params.text_document.uri.clone(); // Clone the URI here
|
let uri = params.text_document.uri.clone(); // Clone the URI here
|
||||||
let document = TextDocument::new(
|
let document = TextDocument::new(
|
||||||
uri.to_string(), // Use the cloned URI
|
uri.to_string(), // Use the cloned URI
|
||||||
|
@ -48,7 +52,11 @@ impl Store {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_did_change(&mut self, params: DidChangeTextDocumentParams, client: &Client) -> Result<()> {
|
pub fn handle_did_change(
|
||||||
|
&mut self,
|
||||||
|
params: DidChangeTextDocumentParams,
|
||||||
|
client: &Client,
|
||||||
|
) -> Result<()> {
|
||||||
let uri = params.text_document.uri.as_str().to_string();
|
let uri = params.text_document.uri.as_str().to_string();
|
||||||
let version = params.text_document.version;
|
let version = params.text_document.version;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue