File tree Expand file tree Collapse file tree 9 files changed +46
-4
lines changed Expand file tree Collapse file tree 9 files changed +46
-4
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,12 @@ members = ["crates/*"]
33resolver = " 2"
44
55[workspace .dependencies ]
6- djls = { path = " crates/djls" }
76djls-ast = { path = " crates/djls-ast" }
7+ djls-cli = { path = " crates/djls-cli" }
88djls-django = { path = " crates/djls-django" }
99djls-ipc = { path = " crates/djls-ipc" }
1010djls-python = { path = " crates/djls-python" }
11+ djls-server = { path = " crates/djls-server" }
1112djls-worker = { path = " crates/djls-worker" }
1213
1314anyhow = " 1.0.94"
Original file line number Diff line number Diff line change 1+ [package ]
2+ name = " djls-cli"
3+ version = " 0.1.0"
4+ edition = " 2021"
5+
6+ [dependencies ]
7+ djls-django = { workspace = true }
8+ djls-server = { workspace = true }
9+
10+ anyhow = { workspace = true }
11+ tokio = { workspace = true }
12+
13+ clap = { version = " 4.5.23" , features = [" derive" ] }
14+ tower-lsp = { version = " 0.20.0" , features = [" proposed" ] }
15+
16+ [[bin ]]
17+ name = " djls"
18+ path = " src/main.rs"
Original file line number Diff line number Diff line change 1+ use clap:: { Parser , Subcommand } ;
2+
3+ #[ derive( Debug , Parser ) ]
4+ struct Cli {
5+ #[ command( subcommand) ]
6+ command : Commands ,
7+ }
8+
9+ #[ derive( Debug , Subcommand ) ]
10+ enum Commands {
11+ /// Start the LSP server
12+ Serve ,
13+ }
14+
15+ #[ tokio:: main]
16+ async fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
17+ let cli = Cli :: parse ( ) ;
18+
19+ match cli. command {
20+ Commands :: Serve => djls_server:: serve ( ) . await ?,
21+ }
22+
23+ Ok ( ( ) )
24+ }
Original file line number Diff line number Diff line change 11[package ]
2- name = " djls"
2+ name = " djls-server "
33version = " 0.1.0"
44edition = " 2021"
55
File renamed without changes.
Original file line number Diff line number Diff line change @@ -80,8 +80,7 @@ impl LanguageServer for TowerLspBackend {
8080 }
8181}
8282
83- #[ tokio:: main]
84- async fn main ( ) -> Result < ( ) > {
83+ pub async fn serve ( ) -> Result < ( ) > {
8584 let django = DjangoProject :: setup ( ) ?;
8685
8786 let stdin = tokio:: io:: stdin ( ) ;
File renamed without changes.
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments