File tree Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ phf = { version = "0.11.1", features = ["macros"] }
2424jwalk = " 0.8.1"
2525# home = "0.5.3"
2626quit = " 2.0.0"
27- psutil = " 3.2.2"
2827regex = " 1.7.1"
2928serde_json = " 1.0.108"
3029tantivy = " 0.21.1"
@@ -35,4 +34,8 @@ tantivy = "0.21.1"
3534target = " x86_64-unknown-linux-gnu"
3635
3736[target .x86_64-unknown-linux-gnu ]
37+ psutil = " 3.2.2"
3838linker = " /usr/local/bin/x86_64-unknown-linux-gnu-gcc"
39+
40+ [target .'cfg(windows)' .dependencies ]
41+ tasklist = " 0.2.13"
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ export async function activate(_context: ExtensionContext) {
2424 // Apple/Intel
2525 command = `${ base_dir } /bin/fuzzy` ;
2626 }
27+ } else if ( "windows" ) {
28+ command = `${ base_dir } /bin/fuzzy.exe` ;
2729 } else {
2830 command = `${ base_dir } /bin/fuzzy_x86_64-unknown-linux-gnu` ;
2931 }
Original file line number Diff line number Diff line change 8585 "@types/glob" : " ^7.1.3" ,
8686 "@types/mocha" : " ^8.0.0" ,
8787 "@types/node" : " ^12.12.0" ,
88- "@types/vscode" : " ^1.44.0 " ,
88+ "@types/vscode" : " ^1.84.2 " ,
8989 "@typescript-eslint/eslint-plugin" : " ^3.8.0" ,
9090 "@typescript-eslint/parser" : " ^3.8.0" ,
9191 "cross-env" : " ^7.0.2" ,
9797 "ts-loader" : " ^8.0.12" ,
9898 "typescript" : " ^4.4.3" ,
9999 "vscode-test" : " ^1.4.0" ,
100- "vscode-uri" : " ^3.0.2"
100+ "vscode-uri" : " ^3.0.2" ,
101+ "vscode" : " ^1.1.37" ,
102+ "vscode-languageclient" : " ^9.0.1"
101103 }
102104}
Original file line number Diff line number Diff line change 11mod persistence;
22
33use persistence:: Persistence ;
4+ use tasklist:: tasklist;
45
56use std:: sync:: Arc ;
67use tokio:: sync:: Mutex ;
@@ -40,6 +41,7 @@ impl LanguageServer for Backend {
4041 drop ( persistence) ;
4142
4243 tokio:: spawn ( async move {
44+ #[ cfg( not( target_family = "windows" ) ) ]
4345 loop {
4446 let editor_process_id = params. process_id . unwrap_or_else ( || quit:: with_code ( 1 ) ) ;
4547
@@ -55,6 +57,24 @@ impl LanguageServer for Backend {
5557
5658 tokio:: time:: sleep ( Duration :: from_secs ( 60 ) ) . await ;
5759 }
60+ #[ cfg( target_family = "Windows" ) ]
61+ loop {
62+ use tasklist;
63+
64+ let editor_process_id = params. process_id . unwrap_or_else ( || quit:: with_code ( 1 ) ) ;
65+
66+ let editor_process_running = unsafe {
67+ let mut tl = tasklist:: Tasklist :: new ( ) ;
68+ tl. any ( |process| process. get_pid ( ) == editor_process_id)
69+ } ;
70+
71+ if !editor_process_running {
72+ quit:: with_code ( 1 ) ;
73+ }
74+
75+ tokio:: time:: sleep ( Duration :: from_secs ( 60 ) ) . await ;
76+ }
77+
5878 } ) ;
5979
6080 let background_persistence = Arc :: clone ( & self . persistence ) ;
You can’t perform that action at this time.
0 commit comments