File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,37 @@ mod server;
6
6
mod session;
7
7
mod workspace;
8
8
9
+ use std:: io:: IsTerminal ;
10
+
9
11
use anyhow:: Result ;
10
12
use tower_lsp_server:: LspService ;
11
13
use tower_lsp_server:: Server ;
12
14
13
15
use crate :: server:: DjangoLanguageServer ;
14
16
15
17
pub fn run ( ) -> Result < ( ) > {
18
+ if std:: io:: stdin ( ) . is_terminal ( ) {
19
+ eprintln ! (
20
+ "---------------------------------------------------------------------------------"
21
+ ) ;
22
+ eprintln ! ( "Django Language Server is running directly in a terminal." ) ;
23
+ eprintln ! (
24
+ "This server is designed to communicate over stdin/stdout with a language client."
25
+ ) ;
26
+ eprintln ! ( "It is not intended to be used directly in a terminal." ) ;
27
+ eprintln ! ( ) ;
28
+ eprintln ! (
29
+ "Note: The server is now waiting for LSP messages, but since you're in a terminal,"
30
+ ) ;
31
+ eprintln ! ( "no editor is connected and the server won't do anything." ) ;
32
+ eprintln ! ( ) ;
33
+ eprintln ! ( "To exit: Press ENTER to send invalid input and trigger an error exit." ) ;
34
+ eprintln ! ( "Ctrl+C will not work as expected due to LSP stdio communication." ) ;
35
+ eprintln ! (
36
+ "---------------------------------------------------------------------------------"
37
+ ) ;
38
+ }
39
+
16
40
let runtime = tokio:: runtime:: Builder :: new_current_thread ( )
17
41
. enable_all ( )
18
42
. build ( ) ?;
You can’t perform that action at this time.
0 commit comments