Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
75385e0
workspace
joshuadavidthomas Aug 25, 2025
74b6b5b
wip
joshuadavidthomas Aug 25, 2025
48dacb2
wip
joshuadavidthomas Aug 25, 2025
588b38c
wip
joshuadavidthomas Aug 25, 2025
b6bc166
wip
joshuadavidthomas Aug 25, 2025
fb768a8
wip
joshuadavidthomas Aug 25, 2025
20163b5
wip
joshuadavidthomas Aug 25, 2025
541200c
wip
joshuadavidthomas Aug 25, 2025
3131470
wip
joshuadavidthomas Aug 25, 2025
3bf25ac
must use!
joshuadavidthomas Aug 25, 2025
269d4bc
lsp types
joshuadavidthomas Aug 25, 2025
4e3446f
wip
joshuadavidthomas Aug 27, 2025
96e0b81
wowza
joshuadavidthomas Aug 29, 2025
21403df
tests
joshuadavidthomas Aug 29, 2025
2dd779b
Fix overlay bug: Salsa wasn't re-reading from buffers when files were…
joshuadavidthomas Aug 29, 2025
f3fb8e7
Improve documentation and consolidate path/URL utilities
joshuadavidthomas Aug 29, 2025
89e979b
Add cross-references and improve documentation consistency
joshuadavidthomas Aug 29, 2025
f6e7f90
Fix missing backticks in documentation
joshuadavidthomas Aug 29, 2025
af8820b
Fix outdated and incorrect db.rs documentation
joshuadavidthomas Aug 29, 2025
c685f53
Clean up more outdated documentation in db.rs
joshuadavidthomas Aug 29, 2025
361d7e2
stuf and thinggs
joshuadavidthomas Aug 30, 2025
00fef52
weeeee
joshuadavidthomas Aug 30, 2025
f474f55
remove
joshuadavidthomas Aug 30, 2025
f7a1816
remove
joshuadavidthomas Aug 30, 2025
8a63ebc
remove
joshuadavidthomas Aug 30, 2025
84f1073
remove
joshuadavidthomas Aug 30, 2025
43138a9
remove
joshuadavidthomas Aug 30, 2025
f47d9df
lint
joshuadavidthomas Aug 30, 2025
196a634
remove comments and adjust some others
joshuadavidthomas Sep 3, 2025
d4b0397
fix some documentation
joshuadavidthomas Sep 3, 2025
4790ee7
wip
joshuadavidthomas Sep 3, 2025
fb1f27e
wipp
joshuadavidthomas Sep 3, 2025
e9e1d77
keep on worrrrking
joshuadavidthomas Sep 3, 2025
6d6b1b2
wipwip
joshuadavidthomas Sep 3, 2025
fb88e8f
wip
joshuadavidthomas Sep 3, 2025
54577aa
simplify
joshuadavidthomas Sep 3, 2025
db1081e
more clean up
joshuadavidthomas Sep 3, 2025
9f70432
wip
joshuadavidthomas Sep 4, 2025
1397513
guard
joshuadavidthomas Sep 4, 2025
8ba7239
move it!
joshuadavidthomas Sep 4, 2025
2faa361
lint and stuff
joshuadavidthomas Sep 4, 2025
846f742
clippy
joshuadavidthomas Sep 4, 2025
8990800
clippy
joshuadavidthomas Sep 4, 2025
c833323
clippy
joshuadavidthomas Sep 4, 2025
4fa3370
fmt
joshuadavidthomas Sep 4, 2025
4858c68
trimming the fat
joshuadavidthomas Sep 5, 2025
576d86c
remove
joshuadavidthomas Sep 5, 2025
958c152
cleaning
joshuadavidthomas Sep 5, 2025
9a08fb6
clean it UP
joshuadavidthomas Sep 5, 2025
9a26025
fmt
joshuadavidthomas Sep 5, 2025
0780a92
use encodign
joshuadavidthomas Sep 5, 2025
27aeede
cleaning
joshuadavidthomas Sep 5, 2025
0ccb304
clean up tests
joshuadavidthomas Sep 5, 2025
d5c5c6e
focused tests
joshuadavidthomas Sep 5, 2025
b3eddc3
paths
joshuadavidthomas Sep 5, 2025
e42980c
fm
joshuadavidthomas Sep 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
482 changes: 437 additions & 45 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ djls-dev = { path = "crates/djls-dev" }
djls-project = { path = "crates/djls-project" }
djls-server = { path = "crates/djls-server" }
djls-templates = { path = "crates/djls-templates" }
djls-workspace = { path = "crates/djls-workspace" }

# core deps, pin exact versions
pyo3 = "0.25.0"
Expand All @@ -17,9 +18,12 @@ salsa = "0.23.0"
tower-lsp-server = { version = "0.22.0", features = ["proposed"] }

anyhow = "1.0"
camino = "1.1"
clap = { version = "4.5", features = ["derive"] }
config = { version ="0.15", features = ["toml"] }
dashmap = "6.1"
directories = "6.0"
notify = "8.2"
percent-encoding = "2.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand All @@ -29,6 +33,7 @@ toml = "0.9"
tracing = "0.1"
tracing-appender = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt", "time"] }
url = "2.5"
which = "8.0"

# testing
Expand Down
7 changes: 7 additions & 0 deletions crates/djls-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ default = []
djls-conf = { workspace = true }
djls-project = { workspace = true }
djls-templates = { workspace = true }
djls-workspace = { workspace = true }

anyhow = { workspace = true }
camino = { workspace = true }
dashmap = { workspace = true }
percent-encoding = { workspace = true }
pyo3 = { workspace = true }
salsa = { workspace = true }
Expand All @@ -23,9 +26,13 @@ tower-lsp-server = { workspace = true }
tracing = { workspace = true }
tracing-appender = { workspace = true }
tracing-subscriber = { workspace = true }
url = { workspace = true }

[build-dependencies]
djls-dev = { workspace = true }

[dev-dependencies]
tempfile = { workspace = true }

[lints]
workspace = true
50 changes: 22 additions & 28 deletions crates/djls-server/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,45 +123,38 @@ macro_rules! request {

#[allow(dead_code)]
pub mod messages {
use tower_lsp_server::lsp_types::MessageActionItem;
use tower_lsp_server::lsp_types::MessageType;
use tower_lsp_server::lsp_types::ShowDocumentParams;
use tower_lsp_server::lsp_types;

use super::get_client;
use super::Display;
use super::Error;

notify!(log_message, message_type: MessageType, message: impl Display + Send + 'static);
notify!(show_message, message_type: MessageType, message: impl Display + Send + 'static);
request!(show_message_request, message_type: MessageType, message: impl Display + Send + 'static, actions: Option<Vec<MessageActionItem>> ; Option<MessageActionItem>);
request!(show_document, params: ShowDocumentParams ; bool);
notify!(log_message, message_type: lsp_types::MessageType, message: impl Display + Send + 'static);
notify!(show_message, message_type: lsp_types::MessageType, message: impl Display + Send + 'static);
request!(show_message_request, message_type: lsp_types::MessageType, message: impl Display + Send + 'static, actions: Option<Vec<lsp_types::MessageActionItem>> ; Option<lsp_types::MessageActionItem>);
request!(show_document, params: lsp_types::ShowDocumentParams ; bool);
}

#[allow(dead_code)]
pub mod diagnostics {
use tower_lsp_server::lsp_types::Diagnostic;
use tower_lsp_server::lsp_types::Uri;
use tower_lsp_server::lsp_types;

use super::get_client;

notify!(publish_diagnostics, uri: Uri, diagnostics: Vec<Diagnostic>, version: Option<i32>);
notify!(publish_diagnostics, uri: lsp_types::Uri, diagnostics: Vec<lsp_types::Diagnostic>, version: Option<i32>);
notify_discard!(workspace_diagnostic_refresh,);
}

#[allow(dead_code)]
pub mod workspace {
use tower_lsp_server::lsp_types::ApplyWorkspaceEditResponse;
use tower_lsp_server::lsp_types::ConfigurationItem;
use tower_lsp_server::lsp_types::LSPAny;
use tower_lsp_server::lsp_types::WorkspaceEdit;
use tower_lsp_server::lsp_types::WorkspaceFolder;
use tower_lsp_server::lsp_types;

use super::get_client;
use super::Error;

request!(apply_edit, edit: WorkspaceEdit ; ApplyWorkspaceEditResponse);
request!(configuration, items: Vec<ConfigurationItem> ; Vec<LSPAny>);
request!(workspace_folders, ; Option<Vec<WorkspaceFolder>>);
request!(apply_edit, edit: lsp_types::WorkspaceEdit ; lsp_types::ApplyWorkspaceEditResponse);
request!(configuration, items: Vec<lsp_types::ConfigurationItem> ; Vec<lsp_types::LSPAny>);
request!(workspace_folders, ; Option<Vec<lsp_types::WorkspaceFolder>>);
}

#[allow(dead_code)]
Expand All @@ -176,19 +169,18 @@ pub mod editor {

#[allow(dead_code)]
pub mod capabilities {
use tower_lsp_server::lsp_types::Registration;
use tower_lsp_server::lsp_types::Unregistration;
use tower_lsp_server::lsp_types;

use super::get_client;

notify_discard!(register_capability, registrations: Vec<Registration>);
notify_discard!(unregister_capability, unregisterations: Vec<Unregistration>);
notify_discard!(register_capability, registrations: Vec<lsp_types::Registration>);
notify_discard!(unregister_capability, unregisterations: Vec<lsp_types::Unregistration>);
}

#[allow(dead_code)]
pub mod monitoring {
use serde::Serialize;
use tower_lsp_server::lsp_types::ProgressToken;
use tower_lsp_server::lsp_types;
use tower_lsp_server::Progress;

use super::get_client;
Expand All @@ -201,22 +193,24 @@ pub mod monitoring {
}
}

pub fn progress<T: Into<String> + Send>(token: ProgressToken, title: T) -> Option<Progress> {
pub fn progress<T: Into<String> + Send>(
token: lsp_types::ProgressToken,
title: T,
) -> Option<Progress> {
get_client().map(|client| client.progress(token, title))
}
}

#[allow(dead_code)]
pub mod protocol {
use tower_lsp_server::lsp_types::notification::Notification;
use tower_lsp_server::lsp_types::request::Request;
use tower_lsp_server::lsp_types;

use super::get_client;
use super::Error;

pub fn send_notification<N>(params: N::Params)
where
N: Notification,
N: lsp_types::notification::Notification,
N::Params: Send + 'static,
{
if let Some(client) = get_client() {
Expand All @@ -228,7 +222,7 @@ pub mod protocol {

pub async fn send_request<R>(params: R::Params) -> Result<R::Result, Error>
where
R: Request,
R: lsp_types::request::Request,
R::Params: Send + 'static,
R::Result: Send + 'static,
{
Expand Down
Loading