meson.build.o7QLX02
[roobuilder] / src / Palete / LanguageClientVala.vala
1
2 namespace Palete {
3         public class LanguageClientVala : LanguageClient {
4         
5         
6                 public LanguageClientVala(Project.Project project)
7                 {
8                         // extend versions will proably call initialize to start and connect to server.
9                         base(project);
10                         
11                         this.startServer();
12                         
13                 
14                 }
15                 public override void startServer()
16                 {
17                         this.initProcess("/usr/bin/vala-language-server");
18                 
19                 }
20                 
21                  public override   void  initialize_server()   {
22                         try {
23                                 Variant? return_value;
24                                     this.jsonrpc_client.call (
25                                     "initialize",
26                                     this.buildDict (
27                                         processId: new Variant.int32 ((int32) Posix.getpid ()),
28                                         rootPath: new Variant.string (this.project.path),
29                                         rootUri: new Variant.string (File.new_for_path (this.project.path).get_uri ())
30                                     ),
31                                     null,
32                                     out return_value
33                                 );
34                                 GLib.debug ("LS replied with %s", Json.to_string (Json.gvariant_serialize (return_value), true));
35                                 this.initialized = true;
36                                 return;
37                         } catch (GLib.Error e) {
38                                 GLib.debug ("LS replied with error %s", e.message);
39                                 this.onClose();
40                         }
41                         
42                 }
43         
44         }
45         
46 }