mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-07-24 12:53:52 +00:00
add protobuf transport and refactor to support (#24)
This commit is contained in:
parent
b3e0ee7b6e
commit
643a47953e
21 changed files with 406 additions and 74 deletions
|
@ -9,6 +9,7 @@ djls-ipc = { workspace = true }
|
|||
djls-server = { workspace = true }
|
||||
|
||||
anyhow = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
|
||||
clap = { version = "4.5.23", features = ["derive"] }
|
||||
|
|
|
@ -33,10 +33,6 @@ impl CommonOpts {
|
|||
enum Commands {
|
||||
/// Start the LSP server
|
||||
Serve(CommonOpts),
|
||||
/// Get Python environment information
|
||||
Info(CommonOpts),
|
||||
/// Print the version
|
||||
Version(CommonOpts),
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
|
@ -49,22 +45,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
PythonProcess::new("djls.lsp", Transport::Json, opts.health_check_interval())?;
|
||||
djls_server::serve(python).await?
|
||||
}
|
||||
Commands::Info(opts) => {
|
||||
let mut python =
|
||||
PythonProcess::new("djls.lsp", Transport::Json, opts.health_check_interval())?;
|
||||
match python.send("python_setup", None) {
|
||||
Ok(info) => println!("{}", info),
|
||||
Err(e) => eprintln!("Failed to get info: {}", e),
|
||||
}
|
||||
}
|
||||
Commands::Version(opts) => {
|
||||
let mut python =
|
||||
PythonProcess::new("djls.lsp", Transport::Json, opts.health_check_interval())?;
|
||||
match python.send("version", None) {
|
||||
Ok(version) => println!("Python module version: {}", version),
|
||||
Err(e) => eprintln!("Failed to get version: {}", e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue